Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

cfhtmltopdf orientation not working

Community Beginner ,
Oct 25, 2023 Oct 25, 2023

This is my code:

<cfhtmltopdf orientation="landscape">
<h3>Test Landscape Output</h3>
</cfhtmltopdf>


This is my output:
Screenshot 2023-10-25 131331.png

5.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 18, 2024 Nov 18, 2024

@dwaynea8754223 ,

Do you mean that you no longer have problems with cfhtmltopdf?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 18, 2024 Nov 18, 2024

no, not what I meant. I can run the tag, but all output is portrait.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 18, 2024 Nov 18, 2024

@dwaynea8754223 wrote:

no, not what I meant. I can run the tag, but all output is portrait.


 

That is strange. Like you, I am on ColdFusion 2023 Update 11. When I copy and run your last code, I get the expected result (a PDF in landscape format - attached). 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 18, 2024 Nov 18, 2024

Further thoughts:

 

  • The message "Error adding PDF Service Manager" makes me think that your ColdFusion installation might have 2 PDF Service Managers on the go.
    Go to the PDF Service page of the Administrator and rule this out. If there is a second PDF Service Manager there, delete it.
  • Go to Package Manager > Available Packages in the Administrator. If there are document-related packages available for installation, install them.


      
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 07, 2024 Dec 07, 2024

I have pretty much the same problem that Dwayne has on one of my servers.  After Update 11, clear felix cache and restart both CF service and cf addon service, it still only generates in portrait using cfhtmltopdf.  Our staging server works perfectly fine and I did not need to clear the felix cache on that server.  I just updated to update 11 in the cfadmin and boom, it worked on staging.  But our production doesn't generate in landscape; only portrait.

 

I even had the same issue with error adding PDF service manager and then restarted and it came back.

 

I've compared the update version and htmltopdf package version between both servers and they are identical.  Both using same version JVM.  I can't make any sense to why it works on one server but not the other.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 07, 2024 Dec 07, 2024
quote

 

I even had the same issue with error adding PDF service manager and then restarted and it came back.

 


By @Stellar_day16E5

You should have updated the existing PDF Service Manager, instead of adding a new PDF Service Manager. See my previous post. An attempt to add a new service manager might result in settings that differ between the servers.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 07, 2024 Dec 07, 2024

That's what I did the first time.  Clicked the Edit icon next to the PDF service and the form populated with the details.  Then clicked Update and instead of updating, it removed the PDF service altogether.

 

So then I clicked Add an added it back, however, it gave the Error adding PDF Service.  I tried 3-4 times to add it.  Finally, just restarted CF and the service was there again.  But still only doing portrait not landscape.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 07, 2024 Dec 07, 2024

I got a patch for this by email from Adobe on Thursday. I haven't installed it. I will asap and let ya'll know how it goes. hf202300-4224136

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 06, 2025 Jan 06, 2025

Hi,

 

Did you ever install the patch Adobe gave you and did it fix the issue?

 

-Steve

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 07, 2024 Dec 07, 2024

I had the same exact problem and it sounds like you installed through add-on services too

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 07, 2024 Dec 07, 2024

Our hosting provider installed CF, so I'm not sure what steps they followed during install.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 07, 2024 Dec 07, 2024

 

  Then clicked Update and instead of updating, it removed the PDF service altogether.

 


By @Stellar_day16E5

 

Removing the last PDF Service Manager? That points to a serious problem right there. I expect ColdFusion to hang on to at least one PDF Service Manager, and to prevent you from deleting the last one.

 

Those retries you did might have upset the settings. I would therefore suggest a reset of the PDF engine.

 

Try the following steps and see if they help:

  1.  In the ColdFusion Administrator, go to the page Server Settings. Check whether the setting 'Default ScriptSrc Directory' is correct. The default is /cf_scripts/scripts/ (relative to the web root). Incorrect values have been known to cause PDF problems.
  2.  Next, proceed to reinstall the PDF packages. Go to the page Data & Services > PDF Service. Click on the 'Disable' button to temporarily disable the PDF Service Manager.
    BKBK_0-1733589303668.png
  3.  Open the command prompt (CMD) as administrator;
  4.  Use the DOS command CD to navigate to C:\ColdFusion2023\cfusion\bin;
  5.  Type cfpm.bat and press ENTER. That should bring up ColdFusion's Package Manager tool.
  6.  Type install all and press ENTER. The Package Manager should then temporarily install all packages.
  7.  Type update packages and press ENTER, instructing the Package Manager to update all packages. When ColdFusion finishes, type quit and press ENTER.
  8.  Close the CMD window.
  9.  Restart ColdFusion 2023. 
  10.  Open Windows Services and restart the ColdFusion 2023 Add-on Services.
  11.  Open the ColdFusion Administrator and return to the page Data & Services > PDF Service. Click on the 'Enable' button, then on the button 'Verify All Service Managers'.
    You should get Connection Status 'OK' .
    BKBK_1-1733594169193.pngBKBK_3-1733594493506.png

     

  12.  Run @jascomp 's test code:
    <cfhtmltopdf orientation="landscape">
    <h3>Test Landscape Output</h3>
    </cfhtmltopdf>​

    Does that work as expected?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jan 06, 2025 Jan 06, 2025

Hello Steve,

 

We have fix for this issue, please send an Email to cfinstall@adobe.com

 

Thanks & Regards

Ravi

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 07, 2025 Jan 07, 2025
quote

We have fix for this issue, please send an Email to cfinstall@adobe.com


By @Ravi Shankar266617537wjh

 

Thanks for the fix, @Ravi Shankar266617537wjh  and Team.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 07, 2025 Jan 07, 2025

I am having this problem and emailed cfinstall@adobe.com and got a bounce back that the email address does not exist.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jan 07, 2025 Jan 07, 2025

@Stellar_day16E5 Please send it to cf.install@adobe.com

 

Thanks,

Vikram

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 07, 2025 Jan 07, 2025

@Stellar_day16E5 , try cfinstal@adobe.com (with one 'L')

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 04, 2025 Feb 04, 2025

REan across this thread due to having the same issue.   I actually logged in to say "ME TOO!", essentially.  And then I solved it while cleaning up to attach an example.  Try this:

 

<cfhtmltopdf
		destination = "generated.pdf"
		pagetype="custom"
		pagewidth="11" pageheight="8.5"
		overwrite="true" orientation="landscape"
		margintop=".25" marginbottom=".25" marginleft=".25" marginright=".25">
	<cfoutput>WOOT!</cfoutput>
</cfhtmltopdf>

 

The line that made ALL the difference (nothing else really did it), was  the pagetype="custom".  If I take that out, I'm back to portrait.  However, you have to have pageheight/pagewidth, as "custom" requires it.  

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 04, 2025 Feb 04, 2025

Will, thanks for sharing the workaround. 

 

As for others who may consider it, can you clarify if you had or had not gotten the fix jar Adobe offered above? And what cf version are you on, and what update applied? Finally, is your cf add-on service installed separately from cf?

 

Sorry for the barrage of questions, and feel free to say you "don't know" for any. I merely ask in case you DO know 🙂 , again for the sake of others (who may prefer not to make code changes). 


/Charlie (troubleshooter, carehart. org)
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 04, 2025 Feb 04, 2025

I can provide SOME of the info...  I'm using Commandbox, for starters.  However, I'm only using it because that's what I always use locally.  Typically I'm using Lucee for my "scratch" (test) site and my own stuff.  For work, though, it's ACF, so I switched the engine for today's PDF work.  So... on Commandbox, I grabbed these snippets of info, hopefully what you're looking for:

- adobe-2023.0.12.330713

- document:2023.0.08.330668

- image:2023.0.11.330706

- pdf:2023.0.11.330706

-  htmltopdf-2023.0.11.330706

 

I will be testing, at some point, on a full and "normal" CF 2023 installation.  Probably tomorrow or the next day and can report back as to whether it worked correctly or not.  I suspect it will.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 04, 2025 Feb 04, 2025

Thanks for the clarification. So update 12 of cf 2023 is indeed the current latest. And it sounds like you'd not tried the hotfix jar Adobe offered. OK. 

 

As for running cf on Commandbox, you're not at all alone, of course. But that can indeed be quite different with respect to some matters, especially when it comes to where the cf add-on service is implemented. (That's what processes cfhtmltopdf, and the "pdf service" definition in the cf admin points to its port.)

 

In a traditional cf deployment, that add-on service a separate process (running in fact on jetty rather than tomcat, like cf does--and as you may know, Commandbox implements cf atop undertow. I just don't know how it may implement the add-on service. Maybe someone familiar will chime in.) 

 

But let's see how your efforts go tomorrow. If you'll be installing cf, note that it's during that install you'll be asked if you want to install the add on service, and one of its options will be "pdfg", which is the name for the specific Java web app that does that processing of cfhtmltopdf, which would be implemented within the add on service. It can get confusing! 🙂

 

Anyway saying yes would cause that add on service to be implemented in the cf folder and running atop jetty.

 

Some others in this thread said no to that (or whoever installed cf previously did), and so when they later wanted to use cfhtmltopdf (and had no add on service anywhere to point to), they then installed the add on service via a separate installer that Adobe offers on their site...so, lots of variety in deployment possibilities. (Heck, one can also implement both cf and the add on service in containers that Adobe offers, and Commandbox offer their own cf container. But let's not muddy the waters any further, until necessary.) 


/Charlie (troubleshooter, carehart. org)
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 04, 2025 Feb 04, 2025
Well, I didn't see the "custom" attribute offered as a solution, so...
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 04, 2025 Feb 04, 2025

Well, my first reply thanked you for that workaround. I meant that sincerely. 

 

The rest of my replies today have been for the sake of those who may prefer not to make code changes, and for your sake in saying you'd be installing cf.

 

It's a lot to consider, sure.. And I ended my first reply saying I'd understand if you didn't want to go down this rabbit hole of considering configuration matters. 


/Charlie (troubleshooter, carehart. org)
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 04, 2025 Feb 04, 2025
LATEST
All good, Mr Charlie.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources