Media · Gutenberg

PDF Embed block for WordPress

Embed a PDF document in an iframe with optional download button and toolbar controls.

Get Blockenberg

Free Gutenberg block in Blockenberg. The inspector controls and front-end behavior on this page come from this block’s source, not a shared stub.

Get Blockenberg

What it actually does

Embed a PDF document in an iframe with optional download button and toolbar controls.

Inspector panels on this block: PDF Source, Display, Download Button, Fallback. Those titles come from index.js, not from a shared template.

PDF Embed has no render.php and no frontend.js. The saved Gutenberg HTML is what visitors see, plus Blockenberg layout/typography CSS.

Where to find it

Gutenberg inserter → Media → search “PDF Embed” (block name `blockenberg/pdf-embed` in block.json). Style it in the sidebar after insert.

How to use PDF Embed block for WordPress

  1. Install Blockenberg. Install from WordPress.org and activate the plugin.
  2. Insert the block. Edit a page, click +, search for “PDF Embed”, insert it. Category: Media.
  3. Configure inspector controls that exist on this block. Open PDF Source. Set “PDF URL”, “Document title (for accessibility)”, “Height (px)”, “Width (%)”.
  4. Publish. Save the page. Output is the saved block HTML; typography/colors follow Blockenberg shared panels.

Inspector controls from this block’s code

ControlWhat the code does
PDF URLText field in the inspector. Saved as `pdfUrl`.
Document title (for accessibility)Text field in the inspector. block.json default: PDF Document. Saved as `pdfTitle`.
Height (px)Numeric range control in the inspector. Range 200–1600. block.json default: 600. Saved as `height`.
Width (%)Numeric range control in the inspector. Range 40–100. block.json default: 100. Saved as `width`.
Show PDF toolbarOn/off toggle in the inspector. On by default. Saved as `showToolbar`.
Border radius (px)Numeric range control in the inspector. Range 0–24. block.json default: 8. Saved as `borderRadius`.
Border width (px)Numeric range control in the inspector. Range 0–8. block.json default: 1. Saved as `borderWidth`.
Show download buttonOn/off toggle in the inspector. On by default. Saved as `showDownload`.
Button labelText field in the inspector. block.json default: Download PDF. Saved as `downloadLabel`.
Fallback messageText field in the inspector. block.json default: Your browser does not support inline PDF preview.. Saved as `fallbackMessage`.
Show fallback download linkOn/off toggle in the inspector. On by default. Saved as `showFallbackLink`.
Frame backgroundColor control in the inspector. block.json default: #f9fafb. Saved as `bgColor`.
Colors — BorderColor control in the inspector. block.json default: #e5e7eb. Saved as `borderColor`.
Download button bgColor control in the inspector. block.json default: #2563eb. Saved as `downloadBtnBg`.
Download button textColor control in the inspector. block.json default: #ffffff. Saved as `downloadBtnColor`.

When this is the right block

Notes from the implementation

viewScript: this folder’s frontend.js is enqueued on the front end for this block.

FAQ

How do I add the PDF Embed block in WordPress?

Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “PDF Embed”. It sits under Media. After insert, open PDF Source and set “PDF URL”, “Document title (for accessibility)”, “Height (px)”, “Width (%)”.

What makes PDF Embed different from other Blockenberg blocks?

Embed a PDF document in an iframe with optional download button and toolbar controls. Inspector labels on this block include “PDF URL”, “Document title (for accessibility)”, “Height (px)”, “Width (%)”.

Is the PDF Embed Gutenberg block free?

Yes. PDF Embed ships inside Blockenberg. Get the plugin from WordPress.org — no paid add-on is required for this block.

Can I style PDF Embed to match my theme?

Yes. Blockenberg’s shared typography and color panels apply here, plus any block-specific style controls listed on this page (panels: PDF Source, Display, Download Button, Fallback).

Related media blocks

Get Blockenberg

Install Blockenberg from WordPress.org, then insert PDF Embed from the Gutenberg inserter.

Get Blockenberg