function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
p100p100 

PDF Landscape

Hi

 

As a test im trying to render a pdf as landscape, however the following code does npt work. any ideas?

 

<apex:page renderAs="PDF">

<head>
    <style>
        @page{
            size: landscape;
        }
    </style>
</head>
  <h1>Testing Landscape</h1>
  Rendering PDF as Landscape

</apex:page>

 Thanks

Best Answer chosen by Admin (Salesforce Developers) 
p100p100

Thanks for the suggestion, I've actually got it working by downgrading the API version from 28 to 26.

 

Cheers

Paul

All Answers

sfdcfoxsfdcfox
<apex:page showHeader="false" renderAs="PDF">
    <head>
    <style type="text/css">
@page {
    size: landscape;
}
</style>
    </head>

Minus some attributes specific to our PDF, this is a direct copy and paste from one of our PDF VF pages.

 

Try add showHeader="false" and see if that changes things.

p100p100

Thanks for the suggestion, I've actually got it working by downgrading the API version from 28 to 26.

 

Cheers

Paul

This was selected as the best answer