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

cfhtmltopdf orientation not working

New Here ,
Oct 25, 2023 Oct 25, 2023

Copy link to clipboard

Copied

This is my code:

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


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

Views

974

Translate

Translate

Report

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

Copy link to clipboard

Copied

@dwaynea8754223 ,

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied


@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). 

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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.


      

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

quote

 

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

 


By @AdeptDeveloper

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.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST

 

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

 


By @AdeptDeveloper

 

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?

Votes

Translate

Translate

Report

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
Documentation