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.
Disabling clickjack protection may make your Salesforce org less secure.
To disable the clickjack protection:
- In Setup, navigate to Security > Session Settings.
- Scroll to the Clickjack Protection section.
- Deselect the checkboxes
Enable clickjack protection for customer Visualforce pages with standard headersand
Enable clickjack protection for customer Visualforce pages with headers disabled.
This disables the clickjack protection. Consequently, the PDF preview displays normally.
Remember that disabling clickjack protection may make your Salesforce org less secure.