Layout · Gutenberg

Print / PDF Button block for WordPress

A print button that opens the browser print dialog (Save as PDF included). Supports custom icons via the shared icon picker.

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

A print button that opens the browser print dialog (Save as PDF included). Supports custom icons via the shared icon picker.

Inspector panels on this block: Content, Icon, Layout, Size & shape. Those titles come from index.js, not from a shared template.

Behavior controls: “ARIA label (optional)” (Overrides the accessible name when the visible label is empty); “Icon position” options: Left, Right; “Placement” options: Inline (in content), Floating (fixed); “Layout — Alignment” options: Left, Center, Right.

Where to find it

Gutenberg inserter → Layout → search “Print / PDF Button” (block name `blockenberg/print-button` in block.json). Style it in the sidebar after insert.

How to use Print / PDF Button block for WordPress

  1. Install Blockenberg. Install from WordPress.org and activate the plugin.
  2. Insert the block. Edit a page, click +, search for “Print / PDF Button”, insert it. Category: Layout.
  3. Configure inspector controls that exist on this block. Open Content. Set “Show label”, “Button label”, “ARIA label (optional)”, “Show icon”.
  4. Check the published page. The view script reads HTML data attributes: data-bkbg-print. The block editor preview may not run the same view script.

Inspector controls from this block’s code

ControlWhat the code does
Show labelOn/off toggle in the inspector. On by default. Saved as `showLabel`.
Button labelText field in the inspector. block.json default: Print / Save PDF. Saved as `label`.
ARIA label (optional)Text field in the inspector. Overrides the accessible name when the visible label is empty. Saved as `ariaLabel`.
Show iconOn/off toggle in the inspector. On by default. Saved as `showIcon`.
Icon positionSelect control; the chosen value is saved on the block. Options: Left; Right. block.json default: left. Saved as `iconPosition`.
Icon size (px)Numeric range control in the inspector. Range 12–40. block.json default: 18. Saved as `iconSize`.
PlacementSelect control; the chosen value is saved on the block. Options: Inline (in content); Floating (fixed). block.json default: inline. Saved as `layout`.
Layout — AlignmentSelect control; the chosen value is saved on the block. Options: Left; Center; Right. block.json default: left. Saved as `alignBtn`.
Screen positionSelect control; the chosen value is saved on the block. Options: Bottom right; Bottom left; Bottom center; Top right; Top left. block.json default: bottom-right. Saved as `position`.
Horizontal offset (px)Numeric range control in the inspector. Range 8–120. block.json default: 24. Saved as `offsetX`.
Vertical offset (px)Numeric range control in the inspector. Range 8–120. block.json default: 24. Saved as `offsetY`.
Z-indexNumeric range control in the inspector. Range 100–99999. block.json default: 9990. Saved as `zIndex`.
Horizontal padding (px)Numeric range control in the inspector. Range 8–64. block.json default: 20. Saved as `paddingH`.
Vertical padding (px)Numeric range control in the inspector. Range 4–40. block.json default: 12. Saved as `paddingV`.
Border radius (px)Numeric range control in the inspector. Range 0–999. block.json default: 8. Saved as `borderRadius`.
Border width (px)Numeric range control in the inspector. Range 0–6. block.json default: 0. Saved as `borderWidth`.
Drop shadowOn/off toggle in the inspector. On by default. Saved as `shadow`.
Button textShared Blockenberg typography popover (family, size, weight, spacing). Saved as `typoBtn`.
Colors — BackgroundColor control in the inspector. block.json default: #1e293b. Saved as `bgColor`.
Text / iconColor control in the inspector. block.json default: #ffffff. Saved as `textColor`.
Hover backgroundColor control in the inspector. block.json default: #0f172a. Saved as `hoverBg`.
Hover text / iconColor control in the inspector. block.json default: #ffffff. Saved as `hoverColor`.
Colors — BorderColor control in the inspector. block.json default: #1e293b. Saved as `borderColor`.

What the front-end script actually does

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 Print / PDF Button block in WordPress?

Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “Print / PDF Button”. It sits under Layout. After insert, open Content and set “Show label”, “Button label”, “ARIA label (optional)”, “Show icon”.

Does Print / PDF Button generate a PDF on the server?

No. It opens the browser print dialog. Visitors can choose Save as PDF there.

Is the Print / PDF Button Gutenberg block free?

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

Can I style Print / PDF Button 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: Content, Icon, Layout, Size & shape).

Related layout blocks

Get Blockenberg

Install Blockenberg from WordPress.org, then insert Print / PDF Button from the Gutenberg inserter.

Get Blockenberg