WordPress OSINT, maintenance or security needs? Reach out!
TLDWP

Plugin: pdfjs-viewer-shortcode (Used by 2,649 domains)

PDF.js Viewer

πŸ‘€ Ben Lawson πŸ“¦ v3.0.4 πŸ”— Plugin Homepage

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
  • 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

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.
  • fullscreen_target (optional): true/false, open the fullscreen link in a new tab (default: false)
  • download (optional): true/false, enables or disables download button (default: true)
  • print (optional): true/false, enables or disables print button (default: true)
  • openfile (optional): true/false, show open file button (default: false)
  • zoom (optional): Initial zoom level – auto, page-actual, page-fit, page-width, or percentage like 75, 100, 150 (default: auto)

Want to help develop the plugin? Found a bug? Find us on GitHub. For build instructions and contribution guidelines see the developer guide in DEVELOPER.md.

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.

3.0.4

  • Cache busting for PDF.js files to prevent caching issues after updates

3.0.3.1

  • URL Encoding fix

3.0.3

  • PDFjs 5.5.207
  • Improved URL encoding for PDF files with special characters in filenames/URLs
  • Enhanced security with better sanitization of file parameters

3.0.2

  • Added cache busing to PDFjs files to prevent caching issues after updates

3.0.1

  • Fixed an issue with mjs files on servers that don’t support the mime type

3.0.0

  • Now requires WordPress 5.0 and PHP 7.4
  • Upgraded PDFjs to PDF.js 5.4.456
  • Added PDF preview in Gutenberg block
  • Admin notice for block recovery after updates
  • Accessibility improvements.
  • Reworked the block editor PDF embed code
  • Options Page improvements.
  • Added message so if the user is trying to load external PDFs, they’ll get a warning
  • Translation Support: Added internationalization support
    • Included Spanish (es_ES) and French (fr_FR) translations
    • Added translation template (POT file) for additional languages
    • Added load_plugin_textdomain() for automatic translation loading
    • Created translation guide in languages/README.md
  • Fixed window.pdfjs_options undefined errors in block editor
  • Added safe fallback to prevent JavaScript errors when options not loaded
  • Improved attribute default handling in Gutenberg block
  • Added PDF preview in Gutenberg block editor
  • Consolidated rendering logic with new pdfjs_render_viewer() function
  • Created pdfjs_get_options() helper for consistent option retrieval
  • Added proper input sanitization with pdfjs_sanitize_option()
  • Fixed pdfjs_viewer_scale default from 0 to auto
  • Updated build toolchain (Sass, webpack, Node 18+ requirement)
  • Removed unused code and improved code organization
  • Added .nvmrc for Node version management
  • Fixed PHP Warning: Undefined array key β€œeditButtons” thanks to retroflexer
  • Fixed issue where iFrames could break the layout on smaller screens

2.2.3

  • Updated PDFjs to PDF.js 5.3.93
  • Merged β€˜Add toggle to disable editing buttons’ PR
  • Merged β€˜Fix PHP Warnings: Undefined array key’ PR
  • Package security updates / rebuild

2.2.2

  • PDFjs with legacy browser support

2.2.1

  • .mjs workaround
  • Updated to PDFjs 4.5.136

2.2

  • Updated to PDFjs 4.3.136
  • Renamed β€˜Download’ to β€˜Save’ based on PDFjs change.
  • Removed the zoom feature to hopefully fix Edge issues.
  • Disabling the Alternative PDF Loading version

2.1.8

  • Preventing users from adding JS to shortcodes.
  • Bumping version numbers

2.1.7

  • Fixed the fullscreen settings for new PDFs
  • Fixing a bug where, on fresh installs, the fullscreen text would be β€˜on’
  • Tested with WordPress 6.0-beta3-53297

2.1.6

  • Added testing up to WordPress 5.9.
  • Added a few more variables into the Alternative PDF Loading version.
  • Moved the Alternative PDF Loading to beta.

2.1.5

  • Detect ACF before running ACF code.
  • Beta: Added a feature flag to load the PDF in full screen view differently.

2.1.4

  • Decoding PDF urls when other plugins encode them in the classic editor.

2.1.3

  • Adding a version number to some JS files to break caches
  • Fixing an issue where the fullscreen text didn’t have spaces
  • Updating the shortcode in the read me

2.1.2

  • Reverting to the file in the URL

2.1.1

  • Updating how we call the WordPress plugin directory.
  • Updating function names.
  • More sanitization.

2.1.0

  • Added the file ID to the URL.
  • Hooked WordPress into the viewer to pull the URL in. Should fix some possible security concerns.
  • Removed the file URL from the URL.
  • Removed the pdfjs_set_custom_edits filter.
  • Removed the pdfjs_set_custom_domain filter.
  • Sanitizing inputs
  • Removing search term.

2.0.2

  • Preventing XSS with the search term

2.0.1

  • Now works with ACF fields! Thanks @imj13

2.0.0

  • Major PDFjs Upgrade to version 2.6.347
  • Changing the insert PDF button to fire on a class not ID.
  • Updated the minimum version of WordPress supported.
  • Maybe Edge is happy now?

1.5.9

  • Fixing the issue that made Edge unhappy. fingers crossed

1.5.8

  • Starting to hook up options page to the shortcode.
  • Fixing a potential code injection problem
  • Fix for WordPress 2021 Theme

1.5.7

  • Fix for those not running WordPress 5+ where a fatal error would show because a function I called didn’t exist.

1.5.6

  • New options page to set the default settings.
  • Only showing the β€˜Add PDF’ media button to posts using the classic editor as it only works in the classic editor.
  • Added a filter to pass in a custom domain if URLs are proxied. pdfjs_set_custom_domain
  • Added a filter if you want to edit the PDF URL. pdfjs_set_custom_edits
  • Ability to hide Search via setting on options page.
  • Ability to show Sidebar via setting on options page.
  • Ability to highlight a search term on PDF load.

v1.5.5

  • High Five πŸ–

v1.5.4

  • Reworking way we make the PDF url relative.

v1.5.3

  • Remove only the first instance of the domain name from the URL. Leave it if it’s in a directory or file name.

v1.5.2

  • Making the PDF URL relative so that maybe Microsoft Defender won’t complain.
  • Allowing the viewer to be called directly.
  • Hiding the Open button.
  • Checking for register_block_type function before calling it to better support WordPress 4.x. Thanks @Now-Italy-Demo @octoxan
  • Made the PDF URL relative to hopefully fix Windows Defender security issues.
  • Adding option to open the fullscreen link in a new tab.

v1.5.1

  • Reverting the update to Mozilla PDF.JS library as it broke older browsers and some other setups.

v1.5

  • Updated Plugin Name
  • Updated Plugin Icon
  • Gutenberg Block
  • Updating Mozilla PDF.JS library.
  • Adding a class to the fullscreen link.
  • Ability to customize fullscreen link text.
  • Ability to customize default zoom level.
  • Classes so you can style things easier.
  • Shorter default height.

v1.4.6

  • Renaming URL variables to prevent a possible Edge security message.

v1.4.5

  • Fixes a version number issue that was introduced in the last version.

v1.4.4

  • Brings back the ability to hide print and download.
  • Adds version numbers to URLs to hopefully break caches and prevent weirdness.

v1.4.3

  • Fixes an issue where PDFs wouldn’t load on production sites due to a setLanguage error.

v1.4.2

  • Added title to iFrame for accessibility.
  • Cleaning up code per WordPress standards.

v1.4.1

  • Updating the Readme

v1.4

  • Updating to PDF.JS version v2.3.200
  • Updating the Readme
  • Adding Gutenberg Callout

v1.0 – 1.3

  • The birth of the plugin and first few versions.
DomainExposuresHeadersLast Checked
3*y*a*a*o*s*o*.gr (WP 7.0) βœ… F 2026-06-20 21:05:58
s*a*h*n*b*l*.de (WP 7.0) βœ… F 2026-06-20 20:57:41
d*m*n*s*l*r*.com (WP 7.0) βœ… F 2026-06-20 12:15:04
e*t*c*o*i*i*a*m*d*c*.c*m.br βœ… F 2026-06-20 11:12:42
m*t*m*r*c*r*i*g*d*i*i*g.org (WP 6.9.4) πŸ‘€ F 2026-06-20 03:55:04
t*2*s*i*a.se (WP 6.8.5) βœ… F 2026-06-20 03:43:47
f*d*o*o.org (WP 7.0) βœ… F 2026-06-20 03:38:19
n*v*m*o*o*h*c*m*n*o.o*g.br βœ… F 2026-06-19 23:17:54
l*i*-*o*o*a.org βœ… F 2026-06-19 18:46:56
c*p*a*m*.c*i*.es πŸ”“ πŸ‘€ F 2026-06-19 16:02:56
h*l*y*p*i*g*b*n*.com (WP 7.0) βœ… F 2026-06-19 14:25:14
s*m*r*.e*q.q*.ca (WP 7.0) βœ… F 2026-06-19 13:38:19
a*p*n.ru (WP 7.0) πŸ‘€ F 2026-06-19 12:13:41
i*s*a*e*r*.cat πŸ”“ πŸ‘€ F 2026-06-19 12:08:20
i*s*l*a*b.es πŸ”“ πŸ‘€ F 2026-06-19 12:08:20
i*e*.i*e*o.mx βœ… F 2026-06-19 09:44:48
a*c.i*u.dk (WP 7.0) πŸ‘€ F 2026-06-19 07:24:07
z*i*o*n*a*n*w*u*.pl (WP 6.8.3) βœ… F 2026-06-19 00:22:00
s*w*l*e*s*o*e*.de (WP 6.8.5) πŸ‘€ F 2026-06-18 22:01:25
a*b*t*o*t*r*i*o*r*s.eu (WP 5.9.13) ⚠️ F 2026-06-18 21:22:10
j*s*l*k*.m*-*n*r*d*s*e.cz πŸ‘€ F 2026-06-18 12:13:22
m*r*v*.m*-*n*r*d*s*e.cz πŸ”“ πŸ‘€ F 2026-06-18 12:13:22
g*n*n.s*w*b*.com (WP 5.4.2) ⚠️ F 2026-06-18 11:51:47
k*a*a*t*e*o*k*.de (WP 6.8.2) βœ… F 2026-06-18 11:51:25
k*.k*u*n*.a*.th (WP 7.0) βœ… F 2026-06-18 11:12:56
j*u*e*i*a*.org πŸ”“ πŸ‘€ F 2026-06-18 10:15:36
w*w*.c*s.f*u.edu βœ… F 2026-06-18 09:18:33
w*.u*t.e*u.ar (WP 6.8.5) βœ… F 2026-06-18 03:09:33
a*l*t*s*o*a*a*.com (WP 7.0) βœ… F 2026-06-17 23:09:12
p*t*c.m*c.es βœ… F 2026-06-17 23:00:43
j*k*a*a*u*i*n*p*a*i.cz (WP 6.6.4) πŸ‘€ F 2026-06-17 21:33:53
i*r*m*.c*r*s*s*o*e.nl (WP 6.8.2) βœ… C 2026-06-17 20:58:06
t*o*k*.solutions (WP 6.8.5) βœ… F 2026-06-17 20:12:50
h*w*l*o*a*m*n.w*c*m*t*g*n*.com βœ… D 2026-06-17 17:26:50
a*i*e*2.org βœ… D 2026-06-17 17:05:35
v*l*a*e*o.org (WP 6.9.4) βœ… D 2026-06-17 15:37:25
t.l*t*l*h*l*.o*g.uk (WP 6.8.5) βœ… F 2026-06-17 12:04:00
f*r*r.it (WP 5.9.13) ⚠️ F 2026-06-17 11:22:56
h*b*t*t*r*a*.ro (WP 6.9.4) βœ… F 2026-06-17 09:28:26
n*h*.o*g.au (WP 7.0) πŸ‘€ D 2026-06-17 08:24:09
s*g*a*-*r*u*.org βœ… F 2026-06-17 07:58:29
e*d*r*c*p*o*b*r*i*.it (WP 5.3.21) πŸ’€ ⚠️ F 2026-06-17 06:36:33
r*i*a*u*0.s*k*r*.n*.jp πŸ‘€ F 2026-06-17 04:52:17
y*d*m.o*g.my (WP 7.0) βœ… D 2026-06-17 04:00:37
k*a*o*i*-*e*e*.ru (WP 6.1.10) ⚠️ C 2026-06-17 03:05:06
s*m*r*.c*s*e*.ru βœ… F 2026-06-17 01:53:38
p*r*.c*s*e*.ru βœ… F 2026-06-17 01:53:38
n*o*g*r*d.c*s*e*.ru βœ… F 2026-06-17 01:53:38
e*a*e*i*b*r*.c*s*e*.ru βœ… F 2026-06-17 01:53:38
s*e*e*b*r*.c*s*e*.ru βœ… F 2026-06-17 01:53:38
m*s*o*.c*s*e*.ru βœ… F 2026-06-17 01:53:38
v*r*n*z*.c*s*e*.ru βœ… F 2026-06-17 01:53:38
s*a*r*p*l.c*s*e*.ru βœ… F 2026-06-17 01:53:38
k*a*n*d*r.c*s*e*.ru βœ… F 2026-06-17 01:53:38
k*y*.c*s*e*.ru βœ… F 2026-06-17 01:53:38
r*s*o*.c*s*e*.ru βœ… F 2026-06-17 01:53:38
a*s*l*.a*o*k.pl (WP 5.8.10) ⚠️ πŸ‘€ F 2026-06-17 01:08:06
e*w*n*o*o.d*w*.g*v.ph (WP 6.6.2) βœ… F 2026-06-17 00:17:44
h*n*m*d*s*l*e*j*w*l*e*y.net (WP 6.8.1) πŸ‘€ F 2026-06-17 00:01:41
t*e*o*d*.c*m.au βœ… F 2026-06-16 21:06:05
f*r*.mx (WP 6.9.4) πŸ‘€ F 2026-06-16 20:31:27
e*m.o*g.br βœ… F 2026-06-16 17:45:26
a*c*i*i*s*o*i*o.c*m*n*.s*s*a*i.it (WP 7.0) βœ… F 2026-06-16 16:13:40
c*.m*u.a*.th (WP 6.8.2) βœ… F 2026-06-16 15:43:39
s*u*i*-*i*l*e.pl (WP 6.1.10) ⚠️ F 2026-06-16 15:13:47
s*w*i*l*e.e*u.pl (WP 6.7.5) βœ… F 2026-06-16 15:13:46
m*g*a*h.info (WP 6.1.10) ⚠️ F 2026-06-16 12:29:11
o*d*r*o*k.g*z*n*l*v*n*e*k*n*e*.nl (WP 7.0) βœ… F 2026-06-16 12:01:46
k*l*b*g*o*c*.info (WP 6.8) βœ… F 2026-06-16 11:43:07
i*t*r*o*.l*r*s.r*u*p.a*.th (WP 6.6.5) βœ… F 2026-06-16 10:55:22
h*t*l.l*r*s.r*u*p.a*.th (WP 7.0) βœ… F 2026-06-16 10:55:22
b*o*e*h*r*p*.c*.uk (WP 6.8.5) πŸ‘€ D 2026-06-16 09:43:29
t*e*o*d*a*t*o*e*.c*m.au (WP 6.8.5) πŸ‘€ F 2026-06-16 09:38:16
i*w*s*o*.w*e*u*z*w.pl (WP 6.8.5) βœ… F 2026-06-16 08:10:08
c*s*e*l*.v*l*w*b.cat βœ… F 2026-06-16 07:33:08
c*n*o*z*o*s*l.it (WP 6.0.12) ⚠️ F 2026-06-16 07:14:00
s*a*i*g.r*t*a*m*i*t*r.ch (WP 6.5.8) βœ… F 2026-06-16 06:33:58
r*p*b*i*a*f*u*d*t*o*.pl (WP 5.7.15) ⚠️ πŸ”“ F 2026-06-16 05:04:05
l*a*n*n*.l*f*e*t*e*u*p*e*t.com (WP 6.6.5) βœ… F 2026-06-16 05:02:08
r*i*e*.p*t*i*o*i*m*d*l*i*.g*v.co (WP 6.2.9) ⚠️ πŸ‘€ F 2026-06-16 04:25:24
s*e*d*v.p*.e*u.np (WP 6.8.5) πŸ‘€ D 2026-06-16 03:25:03
k*r*m*a*d*r.fr (WP 6.2.9) ⚠️ πŸ‘€ D 2026-06-16 02:19:47
a*i*.pt (WP 6.7.5) βœ… F 2026-06-16 01:24:12
f*r*m*e*d*d*.u*p*.br βœ… D 2026-06-16 01:22:42
d*o*a*.u*d.u*n.vn πŸ‘€ F 2026-06-16 00:05:51
t*o*.k*z*u*.kz (WP 6.5.5) βœ… F 2026-06-15 23:59:02
i*p*c*p*r*a*.eu βœ… F 2026-06-15 22:56:36
c*m*r*n*o*c*n*d*.ca βœ… D 2026-06-15 21:26:21
s*l*t*e.p*t*o*a*o*u*t*r*a*c*z*r.org (WP 7.0) πŸ‘€ F 2026-06-15 18:47:24
e*l*c*o*.eu (WP 6.2.9) ⚠️ πŸ‘€ F 2026-06-15 18:34:59
j*e*a*p*a*a*s.com βœ… F 2026-06-15 18:02:25
e*c*r*s*m*t*l*c*s.i*d.br (WP 6.9.4) βœ… F 2026-06-15 15:30:37
s*a*y*p*z*n*c.c*t*u*g*a*e.cz (WP 6.4.8) ⚠️ πŸ‘€ F 2026-06-15 13:58:43
g*p.f*h.k*b*-*.a*.jp βœ… F 2026-06-15 12:47:12
d*f*n*o*i*.u*s.e*u.sv βœ… F 2026-06-15 11:21:41
b*s*c*n*i*a*.e*u.ph βœ… D 2026-06-15 08:42:21
m*-*n*r*d*s*e.cz πŸ‘€ F 2026-06-15 08:20:06
h*d.k*u*n*.a*.th (WP 7.0) βœ… F 2026-06-15 06:54:55
l*b*a*y.s*m*c*l*e*e.org (WP 6.7.1) βœ… F 2026-06-15 06:18:04
c*l*e*i*t*i*p*c*.org (WP 6.7.5) πŸ‘€ D 2026-06-15 01:28:30

Top 50 Plugins

Plugin Count
elementor 1,877,439
contact-form-7 1,849,026
elementor-pro 1,091,407
woocommerce 846,449
revslider 641,157
jetpack 480,356
js_composer 449,635
wp-rocket 349,342
gravityforms 320,939
essential-addons-for-elementor-lite 311,027
complianz-gdpr 270,750
cookie-law-info 243,202
instagram-feed 236,716
google-site-kit 230,394
sitepress-multilingual-cms 230,046
google-analytics-for-wordpress 221,265
elementskit-lite 220,182
header-footer-elementor 217,961
bluehost-wordpress-plugin 192,516
gutenberg 166,883
gutenberg-core 166,058
cookie-notice 161,346
litespeed-cache 142,170
the-events-calendar 138,765
wpforms-lite 133,656
gtranslate 133,288
astra-sites 122,709
popup-maker 120,489
tablepress 116,668
woocommerce-payments 115,841
coblocks 103,551
honeypot 102,134
astra-addon 98,706
duracelltomi-google-tag-manager 97,689
wp-smushit 97,158
all-in-one-seo-pack 96,668
layerslider 95,064
bb-plugin 93,172
megamenu 90,993
premium-addons-for-elementor 90,228
akismet 88,345
mailchimp-for-wp 86,753
cleantalk-spam-protect 86,107
woocommerce-gateway-stripe 85,748
ml-slider 85,046
borlabs-cookie 84,045
wp-pagenavi 83,312
fusion-builder 82,779
ewww-image-optimizer 81,960
smart-slider-3 81,282

Top 50 Themes

Theme Count
hello-elementor 641,790
Divi 531,393
astra 438,905
flatsome 149,454
generatepress 135,693
Avada 129,095
pub 114,395
twentytwentyfour 108,383
sydney 104,274
oceanwp 86,838
kadence 82,535
enfold 74,889
salient 68,979
twentyseventeen 58,890
h4 58,600
bb-theme 56,650
betheme 54,213
blocksy 53,376
cocoon-master 52,846
dt-the7 47,991
twentytwentyfive 46,323
neve 41,262
Avada-Child-Theme 38,994
woodmart 34,559
gox 34,477
bridge 34,022
twentytwentyone 33,372
lightning 32,514
twentytwenty 31,415
voxel 29,228
swell 29,174
Impreza 27,746
bricks 27,051
sinatra 25,829
twentytwentythree 24,972
Newspaper 24,936
kubio 22,351
twentytwentytwo 20,553
uncode 19,978
twentysixteen 19,337
epik-redesign 19,296
storefront 18,600
pro 18,247
Total 15,349
extendable 15,101
yith-wonder 14,141
hello-theme-child-master 13,988
yootheme 13,562
themify-ultra 13,538
hestia 13,507