How to embed: Use shortcode like this [pdfviewer width=”600px” height=”849px” beta=”true/false”]http://full-url/document.pdf[/pdfviewer]
PDF.js is an HTML5 technology experiment that explores building a faithful and efficient Portable Document Format (PDF) renderer without native code assistance. The goal is to create a general-purpose, web standards-based platform for parsing and rendering PDFs. PDF.js development is community-driven and supported by Mozilla Labs.
- Install from within WordPress plugin installer, or get from WordPress plugin repository
- Activate the plugin through the “Plugins” menu in WordPress.
- Go to Settings > PDF Viewer to set default values for the plugin.
- Create or edit any page (or post) and insert the shortcode [pdfviewer][/pdfviewer].
- Why there is a beta version?
Beta version contains latest updates but may need to be tested. You can try to use the beta version of the viewer if your document could not be rendered properly. You can also use the beta version on selected document only by using beta=”true” in the shortcode.
- Is this supported on WordPress Multisite?
In simple words, YES. But if you are using domain mapping plugin, this only works when your backend URL is the same as the frontend. Means you have to make sure the document URL use the website public-facing domain name instead of the multisite domain.
Very elegant and sophisticated
Easy to use and makes it much easier to view a pdf right on the post. It’s not mobile friendly, (if it’s only one page, there is a lot of gray space on mobile.) However, I was able to work around this with containers and css.
Just what I needed, work straight out of the box.
For a valid pdf url, the plugin shows “Invalid URL for PDF viewer”.
Great. Responsive pdf viewer.
This plugin was precisely what I needed. Thanks!
Only concerns are:
(1) This plugin leverages Mozilla PDF.JS framework. As of 2015-NOV, this plugin is significantly behind the present version of that framework:
Plugin Settings page states: PDF.js Version Date Stable 1.1.1 18 Mar 2015 Beta 1.1.114 7 May 2015
PDF.JS page states as of 2015-NOV: Stable 1.1.366 Beta 1.1.469 <a href="https://mozilla.github.io/pdf.js/getting_started/#download">
(2) The plugin apparently supports additional presentation options from the framework but such are not documented in the plugin literature.
* page: page number. Example: page=2 * zoom: zoom level. Example: zoom=200 (accepted formats: <code>[zoom],[left],[top]</code>, <code>page-width</code>, <code>page-height</code>, <code>page-fit</code>, <code>auto</code>) * nameddest: go to a named destination * pagemode: either "thumbs" or "bookmarks". Example: pagemode=thumbs <a href="https://github.com/mozilla/pdf.js/wiki/Viewer-options">
In use within WordPress:
[pdfviewer width="100%" height="600px" beta="false"]http://yourdomain/wp-content/uploads/2015/11/01-your.pdf#page=1&zoom=auto&pagemode=thumbs[/pdfviewer]
Contributors & Developers
“PDF Viewer” is open source software. The following people have contributed to this plugin.Contributors
- Initial release.