No Results
Search Tips:
- Please consider misspellings
- Try different search keywords
Newer Version Available
Best Practices for Rendering PDFs
Rendering a Visualforce page as a PDF is a great way to easily share information about your Salesforce organization. In addition to the guidelines listed in Rendering a Page as a PDF, you should familiarize yourself with the following concepts.
PDF Rendering Performance
For better performance when rendering Visualforce pages as PDFs, reference static image and stylesheet resources through the $Resource global variable.
Component Behavior in PDFs
The following
section lists the components that can always be used in a PDF, the
components that may not always work, and the components that can never
be used. As a general rule, don’t use components that:
- Rely on JavaScript to perform an action
- Depend on Salesforce stylesheets
Components That Are Safe to Use in a PDF
- <apex:composition> (as long as the page contains PDF-safe components)
- <apex:dataList>
- <apex:define>
- <apex:facet>
- <apex:include> (as long as the page contains PDF-safe components)
- <apex:insert>
- <apex:image>
- <apex:outputLabel>
- <apex:outputLink>
- <apex:outputPanel>
- <apex:outputText>
- <apex:page>
- <apex:panelGrid>
- <apex:panelGroup>
- <apex:param>
- <apex:repeat>
- <apex:stylesheet> (as long as the URL isn’t directly referencing Salesforce stylesheets)
- <apex:variable>
Components to Use with Caution in a PDF
- <apex:attribute>
- <apex:column>
- <apex:component>
- <apex:componentBody>
- <apex:dataTable>
Components That Are Unsafe to Use in a PDF
- <apex:actionFunction>
- <apex:actionPoller>
- <apex:actionRegion>
- <apex:actionStatus>
- <apex:actionSupport>
- <apex:commandButton>
- <apex:commandLink>
- <apex:detail>
- <apex:enhancedList>
- <apex:flash>
- <apex:form>
- <apex:iframe>
- <apex:includeScript>
- <apex:inputCheckbox>
- <apex:inputField>
- <apex:inputFile>
- <apex:inputHidden>
- <apex:inputSecret>
- <apex:inputText>
- <apex:inputTextarea>
- <apex:listViews>
- <apex:message>
- <apex:messages>
- <apex:outputField>
- <apex:pageBlock>
- <apex:pageBlockButtons>
- <apex:pageBlockSection>
- <apex:pageBlockSectionItem>
- <apex:pageBlockTable>
- <apex:pageMessage>
- <apex:pageMessages>
- <apex:panelBar>
- <apex:panelBarItem>
- <apex:relatedList>
- <apex:scontrol>
- <apex:sectionHeader>
- <apex:selectCheckboxes>
- <apex:selectList>
- <apex:selectOption>
- <apex:selectOptions>
- <apex:selectRadio>
- <apex:tab>
- <apex:tabPanel>
- <apex:toolbar>
- <apex:toolbarGroup>