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
Divya GoelDivya Goel 

Save VF page which rendered as PDF in static resource

I have created a VF page that renders as PDF file. Now I want to save that PDF file onclick of same button to static resource. Is that possible? Means I have a button on click of which I got a VF page as PDF file. Instead of popping up this page as PDF file I want this PDF to save in my static resource.




Not sure why you wold want to save PDF generated into static resources. AFAIK it is not possible to upload to static resources any other way other than the Meta Data API or via the standard salesforce appilication.


Cuirous to understand your specific requirement on why you need to upload to static resources. 

I haven't tried this, but I would imagine if you created a stripped down metadata-API WSDL, imported it as a new class, then used a Http.Request to grab the page, and then package it into the metadata-API class you created, and invoked it... That sounds like an awful lot of work though.

We also want to save those generated VF pages redered as PDF for downloading purpose.


Any idea??


Try this :


1. Upload PDF as a Static Resource.

2. Create the following page :


<apex:page sidebar="false" showHeader="false" standardStylesheets="false"