How to render Visualforce page to PDF then Download it. - Domreysa

Post Top Ad

Post Top Ad

Monday, June 11, 2018

How to render Visualforce page to PDF then Download it.


7. How to render Visualforce page to PDF then Download it.
1. You need to have two page first page is main page
ex: <apex:page id="MainPage"
            showHeader="false"
            cache="true"
            contentType="application/x-pdf#PDF_Name.pdf">

    <!-- Here comes another page with a content to be converted to PDF -->
    <apex:include pageName="SecondpageName"/>
</apex:page>
2. your second page
ex: <apex:page renderAs="pdf" >//your code</apex:page>

No comments:

Post a Comment

Post Top Ad

Responsive Ads Here