WPThumbs
Themes Plugins By purpose By industry Best-of lists Fix it guides
Free Plugin by Ben Lawson v3.1.1

PDF.js Viewer

Embed a beautiful PDF viewer into pages.

PDF.js Viewer

The facts

Rating
4.4★ from 53
Active installs
20k+
Price
Free
Last updated
21 Apr 2026
Added
Nov 2013
Requires WP
5.0
Tested up to
WP 7.0.4
Requires PHP
7.4
Downloads
445,045

Our analysis

AI-assisted

PDF.js Viewer is a WordPress plugin that allows you to embed PDF documents directly into your posts and pages using a Gutenberg block or shortcode. It utilises Mozilla's PDF.js library to display PDF files within web browsers, providing a user-friendly interface for viewing documents online.

The plugin features an Elementor widget, customizable buttons, and supports mobile devices. It also includes functionalities such as page navigation, search capabilities, and the ability to enter passwords for protected PDFs. This plugin is suitable for users who need to display PDF content on their WordPress sites, particularly those using Gutenberg or Elementor.

Best for: This plugin is best for WordPress users who need to display PDF documents on their sites.

What it does well

  • Integrates with Gutenberg and Elementor
  • Supports customizable buttons and document outline
  • Includes search functionality and loading bar
  • Responsive design for mobile devices
  • Translation support for Spanish and French

Where it falls short

  • Limited information on advanced features or support for additional languages

Verdict

PDF.js Viewer offers a straightforward solution for embedding PDFs in WordPress, with a range of useful features for both site owners and visitors.

From the developer

Ben Lawson's own description of PDF.js Viewer, lightly tidied.

Incorporate Mozilla’s PDF.js viewer into your pages and posts via a Gutenberg block or a simple shortcode. PDF.js is a javascript library for displaying pdf pages within browsers.

Features:

  • Gutenberg Block and Shortcode
  • Elementor Widget (auto-detects when Elementor is active)
  • Translation Support (plugin only): Spanish and French included, ready for more languages
  • Elegant Theme that adapts to dark and light mode (if browser supports dynamic CSS)
  • Customizable buttons
  • Page navigation drawer
  • Search functionality
  • Protected PDF password entry
  • Loading bar & displays partially loaded PDF (great for huge PDFs!)
  • Document outline
  • Classic Editor: Easy to use editor media button that generates the shortcode for you
  • Support for mobile devices
  • Responsive design with mobile support

Shortcode Syntax:

[pdfjs-viewer attachment_id=123 viewer_width=600px viewer_height=700px fullscreen=true download=true print=true]

Or use a direct URL:

[pdfjs-viewer url=http://www.website.com/test.pdf viewer_width=600px viewer_height=700px fullscreen=true download=true print=true]

Shortcode Parameters:

  • attachment_id (recommended): ID of the media file in WordPress media library
  • url (alternative): Direct URL to PDF file. Use attachment_id when possible for better security.
  • viewer_width (optional): Width of the viewer (default: 100%)
  • viewer_height (optional): Height of the viewer (default: 800px)
  • fullscreen (optional): true/false, displays fullscreen link above viewer (default: true)
  • fullscreen_text (optional): Text for the fullscreen link (default: View Fullscreen)
    • Spaces not allowed. Use %20 in place of spaces.

    Elementor Widget

    If you’re using Elementor, the PDF.js Viewer Elementor widget is automatically available in the Page Builder.

    Admin Notice After Updates / Invalid Block

    When you update the plugin, editors may see an admin banner explaining that Gutenberg could show an “Attempt Block Recovery” prompt when editing older posts with PDFs. Clicking it updates the block format; it does not affect what visitors see. You can dismiss the banner, and it won’t reappear until a future release enables it again.

    License

    This WordPress plugin is licensed under GPLv2 or later.

    PDF.js (included in this plugin) is developed by Mozilla and licensed under the Apache License 2.0. See the PDF.js repository for details.

    Read the full description on the official page →

Tagged as

Alternatives

Other plugins for extending a page builder.

Essential Addons for Elementor

Elementor addon offering 120+ widgets and templates — Elementor Gallery, Slider, Form, Post Grid, Menu, Accord...

Free 1M+ installs 4.9★ (4,111)
ElementsKit Elementor Addons

Join millions who empower their websites with ElementsKit Elementor Addons. Get templates, & 100+ widgets...

Free 1M+ installs 4.9★ (2,036)
Ultimate Addons for Elementor

Elementor addons with 18+ free widgets, Header & Footer Builder, WooCommerce widgets & templates. Trus...

Free 2M+ installs 4.9★ (2,525)
Premium Addons for Elementor

Elementor Carousel, Mega Menu, Posts List/Slider, WooCommerce Widgets, Display Conditions, AI Abilities, Prema...

Free 600k+ installs 4.9★ (1,677)
Royal Addons for Elementor

Elementor templates, Header footer builder, Elementor Post Grid, Woocommerce Grid builder, Slider, Forms, Gall...

Free 600k+ installs 4.8★ (611)
Disable Gutenberg

Disable Gutenberg Block Editor and restore the Classic Editor and original Edit Post screen (TinyMCE, meta box...

Free 500k+ installs 5★ (733)