function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SAI CHARAN MADUGULASAI CHARAN MADUGULA 

Create a pdf custom button on the visualforce page

Hello All,
I need to create a custom Button called (export pdf).i have a vf page and class i need to add this action button in vf page(summary page).when we click on summary page  a pdf button should populate and when we click export pdf button it should generate the summary page as pdf.I need to code can any one help me out for this and if any body can do this i will send my code vf page and class.

Thanks,
charan
@Karanraj@Karanraj
You can able to export any page as PDF using renderas attribute in visualforce page tag
<apex:page renderAs="pdf">
Create one more visualforce page with same controller code and visualforce page code and the only change is use renderas attribute in the visualforce page code. Then call this visualforce page from the 'Export to PDF' custom button action and pass the necessary parameters to the visualforce page to render the data as PDF page. 

Check this visualforce developer guide for more details - https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_quick_start_renderas_pdf.htm

 
SAI CHARAN MADUGULASAI CHARAN MADUGULA
Thank you.
Ajith Kumar 89Ajith Kumar 89
Hi @karanraj, Can you please explain in detail about how to pass those necessary parameters to the action button.