+ Start a Discussion

Accessing a PDF via a Commandbutton

Hello.  I am trying to create a commandbutton on a VF page that will open a PDF in a separate browser.  I know that I have to upload the PDF to the Documents object - but I am not sure what to do beyond that.  Any suggestions?

Thanks in advance.
The following two articles might help


PrasanntaPrasannta (Salesforce Developers) 

After putting the pfd on document folder, on onclick event of <apex:commandButton>  use window.open method and give the path of the docmunet folder where the pdf is stored.

For example-

<apex:commandButton value="Convert to PDF"  onClick="window.open('/apex/orderReportPDF?id={!Opportunity.Id}');" />

Hope this helps.