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

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 method and give the path of the docmunet folder where the pdf is stored.

For example-

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

Hope this helps.