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
Jason Adler 9Jason Adler 9 

How do I set up save feature for visualforce pdf using renderAs="PDF"?

The visualforce code is copied below...I was under impression that the renderAs="pdf" should have default save ability. On my community page, I am using a feed publisher attached to action that calls visualforce page which renders pdf. The save button is greyed out. How do I add functionality to this save button, or use a workaround? I need to offer my community user ability to save their pdf to their local machine.

save button greyed out


<apex:page standardController="Case" renderAs="pdf" applyBodyTag="false"> <head> <style> body { font-family: 'Arial Unicode MS'; } .companyName { font: bold 10px; color: black; text-overflow:hidden; overflow:hidden} .finePrint {font: 8px; color: black;} .redPrint { font: bold 14px; color: red; text-overflow:hidden; overflow:hidden} <apex:outputPanel layout="none" rendered="{!IF(Case.Existing_Residual_Cap_Calculation_N__r.Status__c == 'Estimated', true, false)}"> .watermark { background-repeat: repeat; background-image: url("{!URLFOR($Resource.watermark_estimated)}"); } </apex:outputPanel> <apex:outputPanel layout="none" rendered="{!IF(Case.Existing_Residual_Cap_Calculation_N__r.Status__c == 'Canceled / Rejected', true, false)}"> .watermark { background-repeat: repeat; background-image: url("{!URLFOR($Resource.rejected_watermark)}"); } </apex:outputPanel> table {border-collapse:collapse; table-layout:fixed; } table td {border:solid 1px ; border-color: white; font: bold 13px; color: black; word-wrap:break-word;} </style> </head> <body class="watermark"> <!-- set length of text output <apex:variable var="c" value="{!23}" /> <apex:variable var="c2" value="{!26}" />--> <apex:variable var="c" value="{!23}" /> <apex:variable var="c2" value="{!34}" /> <div align="right"> <apex:image url="{!$Resource.KNA_Logo}" style="float:right;width:25%; height:60px; margin:10px" /></div> <h2 align="right">Reduced Capacity Request Report (RCR)</h2> <!-- <br /> --> <h3>Basic Information Section</h3> <table> <tr > <td width="110px"><apex:outputText value="{!LEFT("Case No.",c)}"/></td> <td width="230px"><apex:outputText value="{!LEFT(Case.CaseNumber,c2)}"/></td> <td width="110px"><apex:outputText value="{!LEFT("Calculation No.",c)}" styleclass="redPrint"/></td> <td width="230px"><apex:outputText value="{!LEFT(Case.Existing_Residual_Cap_Calculation_N__r.Calculation_No__c,c2)}" styleclass="redPrint"/></td> </tr> <tr> <td><apex:outputText value="{!LEFT("Dealership",c)}"/> </td> <td><apex:outputText value="{!LEFT(Case.Account.Name,c2)}"/> </td> <td><apex:outputText value="{!LEFT("Status",c)}"/> </td> <td><apex:outputText value="{!LEFT(Case.Existing_Residual_Cap_Calculation_N__r.Status__c,c2)}"/> </td> </tr> <tr> <td><apex:outputText value="{!LEFT("Requester Name",c)}"/> </td> <td><apex:outputText value="{!LEFT(Case.Contact.Name,c2)}"/> </td> <td><apex:outputText value="{!LEFT("Date Closed",c)}"/> </td> <td><apex:outputText value="{0, date, MMMM d',' yyyy}"><apex:param value="{!Case.ClosedDate}" /></apex:outputText></td> </tr> </table> <br /> <apex:outputText value="______________!!! USE CALCULATION NO. AS REFERENCE ON THE ORDER FORM !!!________________" styleclass="redPrint"></apex:outputText> <br /> <h3>Equipment Section</h3> <table> <tr > <td width="130px"><apex:outputText value="{!LEFT("Truck Series",c)}"/></td> <td width="220px"><apex:outputText value="{!LEFT(Case.Existing_Residual_Cap_Calculation_N__r.Truck_Series__c,c2)}"/> </td> <td width="130px"><apex:outputText value="{!LEFT("Attachment #1",c)}"/></td> <td width="220px"><apex:outputText value="{!LEFT(Case.Existing_Residual_Cap_Calculation_N__r.Attachment_01__r.Name,c2)}"/></td> </tr> <tr> <td><apex:outputText value="{!LEFT("Truck Model",c)}"/></td> <td><apex:outputText value="{!LEFT(Case.Existing_Residual_Cap_Calculation_N__r.Truck_Model__c,c2)}"/></td> <td><apex:outputText value="{!LEFT("Attachment #2",c)}"/></td> <td><apex:outputText value="{!LEFT(Case.Existing_Residual_Cap_Calculation_N__r.Attachment_2__r.Name,c2)}"/></td> </tr> <tr> <td><apex:outputText value="{!LEFT("Mast Type",c)}"/></td> <td><apex:outputText value="{!LEFT(Case.Existing_Residual_Cap_Calculation_N__r.Mast_Salescode__r.Name,c2)}"/> </td> <td><apex:outputText value="{!LEFT("Attachment #3",c)}"/></td> <td><apex:outputText value="{!LEFT(Case.Existing_Residual_Cap_Calculation_N__r.Attachment_3__r.Name,c2)}"/></td> </tr> <tr> <td><apex:outputText value="{!LEFT("Tires Type",c)}"/></td> <td><apex:outputText value="{!LEFT(Case.Existing_Residual_Cap_Calculation_N__r.Tires__r.Description,c2)}"/> </td> <td><apex:outputText value="{!LEFT("Forks",c)}"/></td> <td><apex:outputText value="{!LEFT(Case.Existing_Residual_Cap_Calculation_N__r.Attachment_4__r.Name,c2)}"/></td> </tr> <tr> <td><apex:outputText value="{!LEFT("Carriage Type",c)}"/></td> <td><apex:outputText value="{!LEFT(Case.Existing_Residual_Cap_Calculation_N__r.Carriage__r.Name,c2)}"/> </td> <td><apex:outputText value="{!LEFT("Carriage Info",c)}"/></td> <td><apex:outputText value="{!LEFT(Case.Existing_Residual_Cap_Calculation_N__r.Carriage__r.Description,c2)}"/></td> </tr> </table> <br /> <h3>Application Section</h3> <table> <tr > <td width="150px"><apex:outputText value="{!LEFT("Payload Length [in.]",c)}"/></td> <td width="190x"><apex:outputText value="{!Case.Existing_Residual_Cap_Calculation_N__r.Payload_Length_in__c}"/> </td> <td width="150px"><apex:outputText value="{!LEFT("Payload Width [in.]",c)}"/></td> <td width="190px"><apex:outputText value="{!Case.Existing_Residual_Cap_Calculation_N__r.Payload_Width_in__c}"/></td> </tr> <tr> <td><apex:outputText value="{!LEFT("Payload Height [in.]",c)}"/></td> <td><apex:outputText value="{!Case.Existing_Residual_Cap_Calculation_N__r.Payload_Height_in__c}"/></td> <td><apex:outputText value="{!LEFT("Payload Weight [lb]",c)}"/></td> <td><apex:outputText value="{!Case.Existing_Residual_Cap_Calculation_N__r.Payload_Weight_lb__c}"/></td> </tr> <tr> <td><apex:outputText value="{!LEFT("1st Load Center [in.]",c)}"/></td> <td><apex:outputText value="{!Case.Existing_Residual_Cap_Calculation_N__r.X1st_Load_Center_in__c}"/> </td> <td><apex:outputText value="{!LEFT("2nd Load Center [in.]",c)}"/></td> <td><apex:outputText value="{!Case.Existing_Residual_Cap_Calculation_N__r.X2nd_Load_Center_in__c}"/> </td> </tr> <tr valign="top" > <td height="50px" ><apex:outputText value="{!LEFT("Application Description",c)}"/></td> <td colspan="3"><apex:outputText value="{!LEFT(Case.Existing_Residual_Cap_Calculation_N__r.Application_Description__c,255)}"/></td> </tr> </table> <br /> <h3>Result Section</h3> <table> <tr > <td width="130px"><apex:outputText value="{!LEFT("Capacity 1st LC [lb]",c)}"/></td> <td width="210px"><apex:outputText value="{!Case.Existing_Residual_Cap_Calculation_N__r.Capacity_lbs_result_1__c}"/> </td> <td width="130px"><apex:outputText value="{!LEFT("Capacity 2nd LC [lb]",c)}"/></td> <td width="210px"><apex:outputText value="{!Case.Existing_Residual_Cap_Calculation_N__r.Capacity_lbs_result_2__c}"/> </td> </tr> <tr> <td><apex:outputText value="{!LEFT("up to max Hgt. [in.]",c)}"/></td> <td><apex:outputText value="{!Case.Existing_Residual_Cap_Calculation_N__r.up_to_max_Hgt_in_1__c}"/></td> <td><apex:outputText value="{!LEFT("up to max Hgt. [in.]",c)}"/></td> <td><apex:outputText value="{!Case.Existing_Residual_Cap_Calculation_N__r.up_to_max_Hgt_in_2__c}"/></td> </tr> <tr> <td><apex:outputText value="{!LEFT("out to max. off. [in]",c)}"/></td> <td><apex:outputText value="{!Case.Existing_Residual_Cap_Calculation_N__r.out_to_max_off_in_1__c}"/></td> <td><apex:outputText value="{!LEFT("out to max. off. [in]",c)}"/></td> <td><apex:outputText value="{!Case.Existing_Residual_Cap_Calculation_N__r.out_to_max_off_in_2__c}"/></td> </tr> <tr> <td><apex:outputText value="@LC [in]"/></td> <td><apex:outputText value="{!Case.Existing_Residual_Cap_Calculation_N__r.X1st_Load_Center_in__c}"/> </td> <td><apex:outputText value="@LC [in]"/></td> <td><apex:outputText value="{!Case.Existing_Residual_Cap_Calculation_N__r.X2nd_Load_Center_in__c}"/> </td> </tr> <tr valign="top" > <td height="50px" ><apex:outputText value="{!LEFT("Notes from KION Engineer",30)}"/></td> <td colspan="3"><apex:outputText value="{!LEFT(Case.Existing_Residual_Cap_Calculation_N__r.Notes_from_KION_Engineer__c,255)}"/></td> </tr> </table> <br /> <br /> <apex:outputText value="{!NOW()}" styleclass="companyName"></apex:outputText> <br /> <apex:outputText value="The requestor assumes the responsibility of informing the lift equipment owner about forklift capacity ratings. Lift Height, load Center and lateral offset limitations must not be exceeded. Ratings are calculated estimates and actual rating plate values may vary in some cases. The information on this form in no way constitutes a guarantee that KION can or will provide the equipment specified. Certification of availability is obtained only through the KION sales department." styleClass="finePrint"/> </body> </apex:page>
ShirishaShirisha (Salesforce Developers) 
Hi Jason,

Greetings!

Can you please check the sample code to save the visualforce page as  PDF in the below thread.

https://developer.salesforce.com/forums/?id=906F0000000Ai0XIAS

Kindly mark it as best answer if it helps so that it can help others in the future.

Warm Regards,
Shirisha Pathuri