Activity Forums Salesforce® Discussions How to include stylesheet in visualforce page rendered as pdf ? Reply To: How to include stylesheet in visualforce page rendered as pdf ?

  • shariq

    Member
    September 21, 2018 at 12:12 am

    Hi,

    VisualForce allows you to create PDF documents (<apex:page RenderAs="PDF">), but did you know those files can be easily manipulated with CSS, for example you can break a document on different pages, you can set footers and headers, set the page size, and add page numbering.
    Resolution

     

    This page creates a PDF file that:
    Uses "Letter" as the paper size
    Has margins of 1/4 centimetres
    Has a title on every page
    Every page shows the page number in this format (page # of #)
    Controls what content goes on each page.

    Note: Provided solution may not work for all situations. You may have to enable/disable <apex:page> options to get the desired result.

    Hope this helps.