Setup
Embed PDFs using the Gutenberg block or [pdfdraft_embed_pdf] shortcode.
Last updated on May 18, 2026
PDFDraft allows you to embed PDF documents directly into your WordPress pages and posts using either the Gutenberg block editor or a shortcode. This guide covers both methods and shows you how to configure the embedded PDF viewer.
Prerequisites
PDFDraft plugin installed and activated
At least one PDF design created in PDFDraft
Method 1: Using the Gutenberg Block

Adding the PDF Embed Block
Open the page or post where you want to embed the PDF
Click the plus icon to add a new block
Search for PDFDraft Embed PDF or browse to find it under the Media category
Click the block to insert it into your content
Configuring the Embedded PDF
Once the block is inserted, you can configure the following settings:
Select a project
Click the Select a project dropdown
Choose from your available PDFDraft designs
The selected document will display with its title and page count
To change the selection, click the X icon to remove the current document, then select a different one
Publishing the Embedded PDF
After configuring the block, click Save Draft or Update to save your changes
Click Publish or Update to make the embedded PDF live on your site
Visitors will see an interactive PDF viewer with navigation and zoom controls

Method 2: Using the Shortcode
The pdfdraft_embed_pdf shortcode allows you to embed PDFs in any content area that supports shortcodes, including the Classic Editor, widgets, and custom fields.
Basic Shortcode Usage
The basic shortcode syntax is:
[pdfdraft_embed_pdf]This will embed the default PDF design with standard dimensions.
Shortcode Attributes
You can customize the embedded PDF using the following attributes:
project
Specifies which PDFDraft design to embed
Use the project slug or ID
Example: [pdfdraft_embed_pdf project="certificate-of-appreciation"]
width
Sets the width of the embedded viewer in pixels
Example: [pdfdraft_embed_pdf width="800"]
height
Sets the height of the embedded viewer in pixels
Example: [pdfdraft_embed_pdf height="600"]
Complete Shortcode Example
[pdfdraft_embed_pdf template_id="abc123" width="800px" height="600px"]This embeds the Certificate of Appreciation design with a viewer that is 800 pixels wide and 600 pixels tall.
Troubleshooting
PDF not displaying
Verify that the selected project exists and is published
Check that the project slug or ID in the shortcode is correct
Ensure the PDFDraft plugin is active
Viewer appears too small or too large
Adjust the width and height attributes in the shortcode or block settings
Use pixel values that fit your page layout
Shortcode displays as text
Ensure you are using the shortcode in a content area that supports shortcodes
Check for typos in the shortcode syntax