0

Recently my CSS to format a VisualForce Page renderes as PDF is not showing in landscape nor are page numbers showing. Both the preview from SalesForce and download show the PDF in prtrait with no page numbers. The CSS has not changed and is at the bottom of the CSS file. CSS is used as a static resource. Anyone know of recent changes that would impact this ?

    @page {
/* Landscape orientation */
size: ledger landscape;

/* Put page numbers in the top right corner of each
   page in the pdf document. */
@bottom-right {
 content: "Page " counter(page) "of " counter(pages);
}
   margin-top:3cm;
   margin-left:2.54cm;
   margin-right:2.54cm;
   margin-bottom:3cm;

   margin-top:1cm;
   margin-left:1cm;
   margin-right:1cm;
   margin-bottom:1cm;

}
  • I did this awhile back and the only difference I see in our code is div {} @bottom-right {.... the div – EricSSH May 3 '17 at 15:36
  • Weird. Even if I comment out my <apex:stylesheet value.... on the PDF rendered page and wrap the CSS in the <Head><Style> the PDF remains as a portrait with no page numbering. It's almost like the PDF integration with the page is not listening. – rickmac May 3 '17 at 16:52
1

This was caused by an upstream CSS button that did not have a closing } .

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.