PDF Gallery Viewer

plugin banner

A simple plugin that creates a responsive PDF gallery with thumbnail previews of PDF documents.

Author:Sergio Comella (profile at wordpress.org)
WordPress version required:6.0
WordPress version tested:7.0.7
Plugin version:1.8.1
Added to WordPress repository:22-04-2025
Last updated:03-07-2026
Rating, %:100
Rated by:2
Plugin URI:
Total downloads:2 932
Active installs:200+
plugin download
Click to start download

PDF Gallery Viewer allows you to easily embed PDF galleries with live previews. It uses PDF.js to render the first page of each PDF directly in the browser, without relying on server-side libraries like Imagick. Each item includes a customizable title and a “View” button that opens the PDF in a modal viewer.

The layout is responsive and adapts from a multi-column grid to a single-column stack on smaller screens.

Key Features:

  • Live thumbnail of first PDF page (via PDF.js) — lazy-loaded via IntersectionObserver
  • Responsive layouts (Grid, List, or Slider)
  • Modal viewer with zoom, navigation, and download
  • Gutenberg block with layout selector and drag-and-drop file integration
  • Tooltip + truncation for long titles
  • Dynamic shortcode generation by category, tag, or post
  • Sorting UI (Title / Filename / Manual drag & drop)
  • Manual ordering with FIFO/LIFO behavior for newly added items
  • Zero external requests — all assets (PDF.js, Font Awesome, Swiper.js) served locally
  • Assets only load on pages that contain a gallery
  • Settings page (Settings > PDF Gallery Viewer) for site-wide accent color, surface color, text color, corner radius, and default layout
  • Per-gallery accent color override via the accent_color shortcode/block attribute

Usage

Basic usage:

[pdf_gallery url=”https://example.com/doc.pdf” title=”Document Title”]

Multiple items in a container:

[pdf_gallery_container layout=”grid”]
[pdf_gallery url=”…” title=”…”]
[pdf_gallery url=”…” title=”…”]
[/pdf_gallery_container]

Sorting / ordering:

[pdf_gallery_container layout=”grid” order_by=”title” order=”asc” ui=”1″]
…
[/pdf_gallery_container]

Manual ordering (UI drag & drop) with FIFO/LIFO for newly added items:

[pdf_gallery_container id=”my-gallery” layout=”grid” order_by=”manual” manual_mode=”fifo” ui=”1″]
…
[/pdf_gallery_container]

IMPORTANT: Manual ordering is managed by admins and saved server-side (post meta) so the order is the same for all visitors.
For reliable persistence, always set a stable id=”…” on each container (the Gutenberg block does this automatically).

Dynamic by category:

[pdf_gallery_container category=”brochures” layout=”slider”]

Per-gallery accent color (overrides the site-wide default set in Settings > PDF Gallery Viewer):

[pdf_gallery_container layout=”grid” accent_color=”#ff6600″]
…
[/pdf_gallery_container]


Screenshots
FAQ
ChangeLog