Search code examples
salesforceapex

Can we add multiple pages in renderAsPdf in visualforce page


I have single page pdf document from Visualforce page using renderAsPdf, can we add multiple pages in the pdf document?

Thank you


Solution

  • To generate multiple paper pages out of one Visualforce page you could read up about CSS page-break-before: always;. https://salesforce.stackexchange.com/a/194196/799 is a pretty decent example (shameless plug)

    To generate 1 master PDF that combines content from multiple different Visualforce pages/components... Read up about apex:include, maybe apex:composition. Experiment with joining them up like that as simple html and use renderAs="pdf" when you're happy.