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
Otilia StraitOtilia Strait 

Generate a PDF document

Hi all,

I would really need your help. :(

I need to generate for my organization a PDF document (Order Insertion for our advertising campaigns). I would need to add different fields that the SF users could fill in, like: Campaign Name: xxxx , Campaign Start Date: xx/xxx/xxxx, Price: xx/CPM, etc.

Also, I need to add a header (picture- logo of the company) and a footer (contact, signature, etc).

Basically, I have the Order Insertion in a .xlsx format and I would like to transfer all the info from the Excel in Salesforce. As I understood, it could work with VisualPage creation and customization but I think I need some programmatic help.

Thank you very much for your answer,
Otilia
Greg HGreg H
I wrote about this a few years ago. Here's a link to that post: https://www.interactiveties.com/blog/2015/render-visualforce-pdf.php. It may help to get you started. Good luck.
-greg
Deepali KulshresthaDeepali Kulshrestha
Hi Otilia,

For converting vf page into pdf, modify the <apex: page> to.

<apex:page renderAs="pdf">

For converting vf page into excel, modify the <apex: page> tag to include the contentType="application/vnd.ms-excel">

<apex:page standardController="Account" contentType="application/vnd.ms-excel">


For more pdf page detail I suggest to visit this link, it will help you

https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_output_pdf_renderas.htm

For creating the whole page in excel, I suggest to visit this link, it will help you

https://www.supinfo.com/articles/single/6886-salesforce-create-pdf-or-excel-export-with-visualforce

Thanks and Regards,

Deepali Kulshrestha.