Reply
YR
Contributor
YR
Posts: 6
0
Accepted Solution

Render PDF as landscape issue ??

Hi

 

I tried to make the visualforce page renderas PDF in landscape with following styles

 

<style >
    @page {
        size:landscape;
   }
 </style>
 

 

But it is not working now. Is anybody face the same issue? or have any idea to render the PDF as landscape??

 

Thanks!

Regular Contributor
eto
Posts: 56
0

Re: Render PDF as landscape issue ??

The pdf renderer has some limitations, maybe this is one of them.

 

The usage of a specific size in the @page-elements works for me, e.g.:

 

 

@page { size: 29.7cm 21.0cm ; margin-top: 1.0cm; margin-left: 1.0cm; margin-right: 1.0cm; margin-bottom: 1.0cm; }

 

(european standard paper, 1cm border on each side)

 

hth

Ingo

 

Trusted Contributor
prageeth
Posts: 262
0

Re: Render PDF as landscape issue ??

[ Edited ]

Following code will work...

 

<head>

<style>

@page {

size:landscape;

}

</style> 

</head> 

Message Edited by prageeth on 09-29-2009 12:31 AM
Newbie
AdamXL
Posts: 1
0

Re: Render PDF as landscape issue ??

Neither specifying the size as landscape or as 29.7cm, 21.0cm seams to get the rendering of PDF to actually be landscape mode. Anyone recently able to do this?

Regular Visitor
shizzle94
Posts: 1
0

Re: Render PDF as landscape issue ??

Just had the same problem, I see this was a recent post. The chosen answer here works, however, not in API version 27, you need to go back to API version 26 on your vf page.
Regular Visitor
Weeball
Posts: 1
0

Re: Render PDF as landscape issue ??

I had this problem for a while, and then I figured out that the tag <html> which I was usind was creating the problem make sure that there aren't any extra tags. 

 

<apex:page renderAs="PDF">
  <head>
   <style>
     @page{
        size: A4 landscape;
                  }
    </style>
   </head>
<h1>Testing Landscape</h1>
Rendering PDF as Landscape
</apex:page>