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
Nikitha PraveenNikitha Praveen 

How to generate PDF for Opportunity?

Best Answer chosen by Nikitha Praveen
shaik murthujavalishaik murthujavali
Hi Nikitha,
Use the below visual force page includes standard controller, if you have any other requirement you can also use controller.
<apex:page standardController="Opportunity" renderAs="pdf">

<h1>Opportunity</h1>
<p>Thank you for <b><apex:outputText value=" {!Opportunity.Name}"/></b></p>
<table>
<tr><th>Opportunity Name</th>
    <td><apex:outputText value="{!Opportunity.Name}"/></td>
    </tr>
<tr><th>Account Rep</th>
    <td><apex:outputText value="{!Opportunity.Owner.Name}"/></td>
    </tr>
</table>
</apex:page>
Hope it helps, let me know if it works for you/need any further help on this.

Thanks,
Shaik Murthujavali

All Answers

shaik murthujavalishaik murthujavali
Hi Nikitha,
Use the below visual force page includes standard controller, if you have any other requirement you can also use controller.
<apex:page standardController="Opportunity" renderAs="pdf">

<h1>Opportunity</h1>
<p>Thank you for <b><apex:outputText value=" {!Opportunity.Name}"/></b></p>
<table>
<tr><th>Opportunity Name</th>
    <td><apex:outputText value="{!Opportunity.Name}"/></td>
    </tr>
<tr><th>Account Rep</th>
    <td><apex:outputText value="{!Opportunity.Owner.Name}"/></td>
    </tr>
</table>
</apex:page>
Hope it helps, let me know if it works for you/need any further help on this.

Thanks,
Shaik Murthujavali
This was selected as the best answer
Khan AnasKhan Anas (Salesforce Developers) 
Hi Nikitha,

Greetings to you!

Please refer to the below links which might help you further with the above requirement.

https://www.linkedin.com/pulse/generate-pdfs-salesforce-without-writing-any-code-harleen-mann/

https://salesforce.stackexchange.com/questions/175381/how-can-we-generate-pdf-from-selected-standard-and-custom-objects

http://www.interactiveties.com/blog/2015/visualforce-button-pdf.php

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas
Gabriel LinusGabriel Linus
Hi Nikitha,

If you're looking for guidance on generating a PDF for an Opportunity in Salesforce, a helpful resource is available at https://arrify.com/generate-pdf-in-salesforce/. This article provides a detailed guide with step-by-step instructions and code samples to help you generate PDFs in Salesforce. The guide is designed to demonstrate how to Generate PDF in Salesforce with a button click, and you can customize it to meet your specific requirements.
Sai Shanmukh 15Sai Shanmukh 15
Hi, is it possible to create a button on the Opportunity object that generates a downloadable pdf using a pre-existing quote template?