Skip to main content
Inspiring
July 22, 2011
Question

Working with PDF, how to make it landscape?

  • July 22, 2011
  • 1 reply
  • 4807 views

I'm using CF8 and I just want to create a very simple PDF report.

Here is what I did:

<cfdocument format="PDF" orientation = "landscape" saveasname="ReportName"

                                  pagetype="custom" pageheight="8.5" pagewidth="15.5" margintop="0.5" marginbottom="0.5" marginright="1" marginleft="1">

     <!--- page object need to be within cfdocumentitem --->

     <cfdocumentsection name="Main Report">

           <cfdocumentitem type="header">

                <cfoutput><div align="right" style="font-size:11px;">Page: #cfdocument.currentpagenumber#</div></cfoutput>

           </cfdocumentitem>   

           <!--- Report content is here --->

     </cfdocumentsection>

</cfdocument>

This create the report just fine BUT it does NOT create a landscape report. My report is still potrait. What have I done wrong or how to force it so it shows landscape?

This topic has been closed for replies.

1 reply

Inspiring
July 22, 2011

On 7/22/2011 7:02 AM, BYJ_wntrsnt said:

<cfdocument format="PDF" orientation = "landscape" saveasname="ReportName" pagetype="custom" pageheight="8.5" pagewidth="15.5" margintop="0.5" marginbottom="0.5" marginright="1" marginleft="1">

<!--- page object need to be within cfdocumentitem ---> <cfdocumentsection name="Main Report">

<cfdocumentitem type="header"> <cfoutput><div align="right" style="font-size:11px;">Page: #cfdocument.currentpagenumber#</div></cfoutput> </cfdocumentitem>

>

<!--- Report content is here --->

>

</cfdocumentsection>

</cfdocument>

either swap height & width or change orientation to portrait. your custom height

& width already layout as landscape.

Inspiring
July 22, 2011

I replaced orientation with porttrait and now showing up as landscape. How is that possible? I don't understand. Thank you for the advice to swap.

Inspiring
July 22, 2011

On 7/22/2011 7:04 PM, BYJ_wntrsnt said:

I replaced orientation with porttrait and now showing up as landscape. How is

that possible? I don't understand. Thank you for the advice to swap.

as i said you created a custom page that was landscape already. telling the

iText engine (the lib behind cfdocument) that you wanted landscape, causes it to

rotate that page essentially back to portrait.