Today in the office we had a short conversation about the ability to [tweet_quote]generate a PDF from Salesforce.[/tweet_quote] One of our Salesforce Admins chimed in and said “Yes, we do it all the time and it’s super easy”. That’s music to my ears. First of all, there are many great partners out on the Salesforce AppExchange who provide great solutions for document management and dynamic document generation. We have used DocuSign, EchoSign, S-Docs and a few others depending on the complexity as well as the requirements of generating the PDF. But oftentimes, the requirements are just very simple – generate a PDF from fields in Salesforce laid out nicely.
Generating a PDF within Salesforce can be done with VisualForce and Apex and is very easy (even for those with very little VisualForce and Apex experience). You are able to generate any Salesforce page as a PDF by adding the renderAs attribute to the component, and specifying “pdf” as the rendering service.
Depending on your browser settings the Visualforce page that you generate as PDF will either display in the browser or be downloaded as a PDF file.
Salesforce has a nice tutorial on Rendering a Page as a PDF. This is a great place to start. Give it a try and you’ll see just how easy it is to generate a PDF within Salesforce.