Add a flipbook from a PDF, build its pages and show it on any page. This guide covers how pages are built, the block and shortcode options, the preview, developer hooks and what to check when something does not look right.
Upload demfilz-flipbook.zip under Plugins → Add New Plugin → Upload Plugin and activate it (WordPress 6.3 or later, PHP 7.4 or later). A Flipbooks menu appears in the dashboard. Flipbooks can be added and edited by Editors and Administrators.
Go to Flipbooks → Add New Flipbook and enter a title. In the PDF and pages box:
| Option | What it does |
|---|---|
| Source PDF | Choose PDF opens the media library, filtered to PDFs; upload a new one or pick an existing one. |
| Or a PDF address | The address of a PDF in this site's uploads folder, used when no PDF is chosen above. Addresses outside the uploads folder, or files that are not PDFs, are refused. |
| Download button | Shows a button that downloads the PDF. Untick it to keep the PDF out of the viewer. |
Click Build pages. Each PDF page becomes a JPEG about 1,000 pixels wide (capped at 1,600) plus a small thumbnail, stored in wp-content/uploads/dflb/<flipbook id>/. The line under the button says which method your site uses:
| Method | How it works |
|---|---|
| Ghostscript | Rendered on the server a few pages per request, so large PDFs do not time out. Needs the exec() function and the gs program. |
| Imagick | Rendered on the server with the Imagick PHP extension, one page at a time. Some hosts block PDFs in the ImageMagick security policy; the build then switches to the browser. |
| Browser | No server renderer: PDF.js renders each page in your browser and uploads it as a JPEG. Keep the tab open until the status says Done; the tab may be in the background. |
A rebuild writes into a separate folder and replaces the live pages only when every page is in place. The default limit is 500 pages per flipbook.
In the block editor, add the Flipbook block and choose the flipbook; the editor shows its cover and page count, and the viewer appears on the published page. The block can be wide or full width. Anywhere shortcodes work, paste the shortcode from the Show this flipbook box:
| Shortcode attribute | What it does |
|---|---|
| id | The flipbook id (required), for example [dflb id="123"]. |
| height | A minimum height for the viewer, for example height="80vh" or height="700px". Numbers, px, em, rem and vh are accepted. |
| download | download="no" hides the download button, download="yes" shows it even when the flipbook setting is off. |
The block has the same settings in its sidebar. A flipbook that is still a draft, or has no pages yet, shows nothing to visitors; editors see a short notice instead.
Once built, Preview flipbook opens the flipbook on a page of its own, visible only to people who can edit it. The Flipbooks list shows each cover, page count and shortcode, with a Preview link on hover.
| Hook or command | What it does |
|---|---|
dflb_server_renderer | Return an empty string to always render in the browser, or force ghostscript / imagick. |
dflb_gs_candidates | The Ghostscript programs tried, in order, for example an absolute path such as /usr/local/bin/gs. |
dflb_max_pages | The page limit per flipbook (default 500). |
dflb_pages_per_request | Pages rendered per server request (default 4). |
wp dflb create --title="Catalogue" --pdf=123 --build | WP-CLI: create a flipbook from an attachment id or an uploads address, and build it. Also wp dflb build <id> and wp dflb build-all [--force] (servers with Ghostscript or Imagick). |
"Your browser could not open the PDF": the PDF is served from another domain (a CDN or offloaded media) that does not allow it to be read from your dashboard. Use the copy in your uploads folder, or allow your site's domain in the CDN's CORS settings.
"Page 3 could not be saved": the server refused the upload. Check the upload size limit (PHP upload_max_filesize and post_max_size) and any security plugin that blocks uploads to admin-ajax.php.
The flipbook shows the old PDF: click Rebuild pages after replacing the PDF.
The viewer shows one page on a wide screen: the content column is narrower than two pages. Use the block's wide or full width alignment.
Deleting and uninstalling: permanently deleting a flipbook deletes its page images. Uninstalling the plugin deletes all flipbooks and their images, but never the PDFs in your media library.
We build and customise WordPress plugins for a living. If your catalogue needs product hotspots, lead capture or a searchable library, tell us what and we'll quote it.