I would like to generate a multi-page PDF using Salesforce \ Visualforce, so that I can print multiple records at once.
Each PDF page comes from a ContentVersion
record.
I know I can generate a PDF using a visualforce page with the renderAs="pdf"
attribute.
And I know I can control the page size using:
<style>
@page {
margin: 0;
padding: 0;
size: 6in 4in;
}
</style>
But the challenge is generating each individual page, as they need to print in a batch, but each record should appear on a new page.
I thought I might be able to do something like:
<apex:repeat ... >
<apex:include pageName="page1?contentVersionId=xxxxxxxx" />
</apex:repeat>
So I could loop over the ContentVersion
records passing the ContentVersion.ID
into the <apex:include
but it doesn't seem to be possible to pass parameters into the <apex:include
Questions
- How can I generate a PDF with multiple pages where each page is a
ContentVersion
record?