I have a VF page that is designed to export as a PDF. It looks at a parent record: Division__c and uses a component to loop through and create a PDF of all the child records: Region__c. Currently, if you launch the page you will get a one long multi-page PDF file. Would there be a way to create separate PDF files for download instead?

Below is a sample of the current page that loops through a component.

<apex:page id="MultiRegionPage" standardController="Division__c" extensions="DivisionScoreCardExtension" renderAs="advanced_pdf">
    <apex:repeat value="{!regionList}" var="region">
        <c:SingleRegionCard region="{!region}" heathCheckValues="{!healthCheckValues}" colors="{!colors}"
                            percentContactedA="{!percentContactedA}" percentContactedB="{!percentContactedB}" percentContactedC="{!percentContactedC}" percentContactedD="{!percentContactedD}"
                            openRateA="{!openRateA}" openRateB="{!openRateB}" openRateC="{!openRateC}" openRateD="{!openRateD}"
                            ctrA="{!ctrA}" ctrB="{!ctrB}" ctrC="{!ctrC}" ctrD="{!ctrD}"
                            optOutA="{!optOutA}" optOutB="{!optOutB}" optOutC="{!optOutC}" optOutD="{!optOutD}"  />
  • 2
    I don't believe this is possible with the way your page is currently built, however you can turn Visualforce PDF's into Blobs with PageReference.getContent(). You may be able to change your process to have users click on buttons or links that create the Blobs and prompt a user to download. developer.salesforce.com/docs/atlas.en-us.apexcode.meta/… – nbrown Oct 9 at 16:09

Your Answer

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

Browse other questions tagged or ask your own question.