Skip to content

Why does the PDF preview display a blank page?

When previewing PDF documents using the View PDF button, users may be presented an empty page even if the PDF file exists. A possible reason for this behavior may be that your org has the clickjack protection enabled.

Generally, clickjack protection in Salesforce prevents a page, button, or link from appearing on your page that comes from a frame or iframe - which is the case with PDF previews. To allow the PDF preview, you can disable the clickjack protection.

Note

Disabling clickjack protection may make your Salesforce org less secure.

To disable the clickjack protection:

  1. In Setup, navigate to Security > Session Settings.
  2. Scroll to the Clickjack Protection section.
  3. Deselect the checkboxes Enable clickjack protection for customer Visualforce pages with standard headers and Enable clickjack protection for customer Visualforce pages with headers disabled.
  4. Click Save.

    ▶ This disables the clickjack protection. Consequently, the PDF preview displays normally.

    Remember that disabling clickjack protection may make your Salesforce org less secure.

Related information:

Modify Session Security Settings in the Salesforce Help
Salesforce Clickjacking Protection in the Salesforce Help