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

Auto Populate PDF with Fields from Custom Object??

Is there a way to auto-populate a PDF with fields from Custom Objects


The easiest native way is to create a custom Visualforce page with the renderAs attribute set to PDF. Include the fields you want in the pdf in the custom page. As an example, here's a page that prints a list view of accounts with name and annual revenue. You can use also cusom objects and standard or custom controllers.


<apex:page standardController="Account" recordSetVar="accounts" renderAs="PDF">
    <apex:form >
        <apex:pageBlock >
          <apex:pageBlockTable value="{!accounts}" var="account">
                <apex:column >
                    <apex:facet name="Header">Account Name:</apex:facet> 
                    <apex:outputField value="{!account.Name}"/>
              <apex:column >
                    <apex:facet name="Header">Annual Revenue:</apex:facet> 
                    <apex:outputField value="{!account.annualrevenue}"/>

 Please clarify if you had something else in mind.


There is only one way to generate PDF out of any VF page where you are showing custom field of any custom object. 

<apex:page  standardController="Account" rendeAs="pdf" >


<apex:outputfield value="{!Account.Name} />




I already have a PDF form , I want to populate some of the fields in the PDF form with the Salesforce custom object info either with a button or other option. Is there a way to do this?