WordPress PDF Light Viewer Plugin Documentation

What did you get?

About

Thank you for usign the WordPress PDF Light Viewer Plugin.

This plugin gives you an ability to embed PDF files to your Wordpress sites.

You could add unlimited amount of PDF of any size without performance issues.

Added PDF could be embedded as flipbooks on frontend.

Features

  • Unlimited PDF files.
  • Unlimited PDF file size without site performance issues.
  • Turn.js flipbook integrated.
  • Dashboard flipbook preview.
  • Slider thumbnails navigation integrated.
  • Lazy loading pages integrated.
  • s2member compatible.
  • Developer-friendly.
  • Well-documented.
  • Fully translatable to any language using .po files.

What next?

Check Installation section to know how to install the plugin.

Installation

How to install?

Installation steps

Regular installation

  1. Get the package Ok, you got the plugin package :)
  2. Upload plugin package with WordPress http://yoursite.com/wp-admin/plugin-install.php?tab=upload or WordPress Multisite http://yoursite.com/wp-admin/network/plugin-install.php?tab=upload
  3. Activate WordPress PDF Light Viewer Plugin on the WordPress Plugins page http://yoursite.com/wp-admin/plugins.php
  4. That's all! You can start from Quick start guide
  5. After plugin activation please go to plugin's settings on the page http://yoursite.com/wp-admin/options-general.php?page=pdf-light-viewer to Set Up the plugin.

cPanel installation

  1. Upload plugin package through the cPanel File Manager to the /wp-content/plugins/
  2. Extract plugin package contents to the /wp-content/plugins/ folder
  3. Activate WordPress PDF Light Viewer Plugin on the WordPress Plugins page http://yoursite.com/wp-admin/plugins.php
  4. That's all! You can start from Quick start guide
  5. After plugin activation please go to plugin's settings on the page http://yoursite.com/wp-admin/options-general.php?page=pdf-light-viewer to Set Up the plugin.

FTP installation

  1. Unpack the plugin package with any archiving tool, which supports ZIP file format
  2. Upload files folder to the /wp-content/plugins/ to the server with any FTP client application, for example FileZilla
  3. Activate WordPress PDF Light Viewer Plugin on the WordPress Plugins page http://yoursite.com/wp-admin/plugins.php
  4. That's all! You can start from Quick start guide
  5. After plugin activation please go to plugin's settings on the page http://yoursite.com/wp-admin/options-general.php?page=pdf-light-viewer to Set Up the plugin.
More about WordPress Plugins Management

Plugin file structure

├── assets
│   ├── bower_components
│   │   ├── bxslider-4
│   │   │   ├── bower.json
│   │   │   ├── images
│   │   │   │   ├── bx_loader.gif
│   │   │   │   └── controls.png
│   │   │   ├── jquery.bxslider.css
│   │   │   ├── jquery.bxslider.js
│   │   │   ├── jquery.bxslider.min.js
│   │   │   └── plugins
│   │   │       ├── jquery.easing.1.3.js
│   │   │       └── jquery.fitvids.js
│   │   ├── fontawesome
│   │   │   ├── bower.json
│   │   │   ├── css
│   │   │   │   ├── font-awesome.css
│   │   │   │   └── font-awesome.min.css
│   │   │   ├── fonts
│   │   │   │   ├── FontAwesome.otf
│   │   │   │   ├── fontawesome-webfont.eot
│   │   │   │   ├── fontawesome-webfont.svg
│   │   │   │   ├── fontawesome-webfont.ttf
│   │   │   │   └── fontawesome-webfont.woff
│   │   │   ├── less
│   │   │   │   ├── bordered-pulled.less
│   │   │   │   ├── core.less
│   │   │   │   ├── extras.less
│   │   │   │   ├── fixed-width.less
│   │   │   │   ├── font-awesome.less
│   │   │   │   ├── icons.less
│   │   │   │   ├── larger.less
│   │   │   │   ├── list.less
│   │   │   │   ├── mixins.less
│   │   │   │   ├── path.less
│   │   │   │   ├── rotated-flipped.less
│   │   │   │   ├── spinning.less
│   │   │   │   ├── stacked.less
│   │   │   │   └── variables.less
│   │   │   └── scss
│   │   │       ├── _bordered-pulled.scss
│   │   │       ├── _core.scss
│   │   │       ├── _extras.scss
│   │   │       ├── _fixed-width.scss
│   │   │       ├── font-awesome.scss
│   │   │       ├── _icons.scss
│   │   │       ├── _larger.scss
│   │   │       ├── _list.scss
│   │   │       ├── _mixins.scss
│   │   │       ├── _path.scss
│   │   │       ├── _rotated-flipped.scss
│   │   │       ├── _spinning.scss
│   │   │       ├── _stacked.scss
│   │   │       └── _variables.scss
│   │   ├── jquery
│   │   │   ├── bower.json
│   │   │   ├── dist
│   │   │   │   ├── jquery.js
│   │   │   │   ├── jquery.min.js
│   │   │   │   └── jquery.min.map
│   │   │   ├── MIT-LICENSE.txt
│   │   │   └── src
│   │   │       ├── ajax
│   │   │       │   ├── jsonp.js
│   │   │       │   ├── load.js
│   │   │       │   ├── parseJSON.js
│   │   │       │   ├── parseXML.js
│   │   │       │   ├── script.js
│   │   │       │   ├── var
│   │   │       │   │   ├── nonce.js
│   │   │       │   │   └── rquery.js
│   │   │       │   └── xhr.js
│   │   │       ├── ajax.js
│   │   │       ├── attributes
│   │   │       │   ├── attr.js
│   │   │       │   ├── classes.js
│   │   │       │   ├── prop.js
│   │   │       │   ├── support.js
│   │   │       │   └── val.js
│   │   │       ├── attributes.js
│   │   │       ├── callbacks.js
│   │   │       ├── core
│   │   │       │   ├── access.js
│   │   │       │   ├── init.js
│   │   │       │   ├── parseHTML.js
│   │   │       │   ├── ready.js
│   │   │       │   └── var
│   │   │       │       └── rsingleTag.js
│   │   │       ├── core.js
│   │   │       ├── css
│   │   │       │   ├── addGetHookIf.js
│   │   │       │   ├── curCSS.js
│   │   │       │   ├── defaultDisplay.js
│   │   │       │   ├── hiddenVisibleSelectors.js
│   │   │       │   ├── support.js
│   │   │       │   ├── swap.js
│   │   │       │   └── var
│   │   │       │       ├── cssExpand.js
│   │   │       │       ├── getStyles.js
│   │   │       │       ├── isHidden.js
│   │   │       │       ├── rmargin.js
│   │   │       │       └── rnumnonpx.js
│   │   │       ├── css.js
│   │   │       ├── data
│   │   │       │   ├── accepts.js
│   │   │       │   ├── Data.js
│   │   │       │   └── var
│   │   │       │       ├── data_priv.js
│   │   │       │       └── data_user.js
│   │   │       ├── data.js
│   │   │       ├── deferred.js
│   │   │       ├── deprecated.js
│   │   │       ├── dimensions.js
│   │   │       ├── effects
│   │   │       │   ├── animatedSelector.js
│   │   │       │   └── Tween.js
│   │   │       ├── effects.js
│   │   │       ├── event
│   │   │       │   ├── alias.js
│   │   │       │   └── support.js
│   │   │       ├── event.js
│   │   │       ├── exports
│   │   │       │   ├── amd.js
│   │   │       │   └── global.js
│   │   │       ├── intro.js
│   │   │       ├── jquery.js
│   │   │       ├── manipulation
│   │   │       │   ├── _evalUrl.js
│   │   │       │   ├── support.js
│   │   │       │   └── var
│   │   │       │       └── rcheckableType.js
│   │   │       ├── manipulation.js
│   │   │       ├── offset.js
│   │   │       ├── outro.js
│   │   │       ├── queue
│   │   │       │   └── delay.js
│   │   │       ├── queue.js
│   │   │       ├── selector.js
│   │   │       ├── selector-native.js
│   │   │       ├── selector-sizzle.js
│   │   │       ├── serialize.js
│   │   │       ├── sizzle
│   │   │       │   └── dist
│   │   │       │       ├── sizzle.js
│   │   │       │       ├── sizzle.min.js
│   │   │       │       └── sizzle.min.map
│   │   │       ├── traversing
│   │   │       │   ├── findFilter.js
│   │   │       │   └── var
│   │   │       │       └── rneedsContext.js
│   │   │       ├── traversing.js
│   │   │       ├── var
│   │   │       │   ├── arr.js
│   │   │       │   ├── class2type.js
│   │   │       │   ├── concat.js
│   │   │       │   ├── hasOwn.js
│   │   │       │   ├── indexOf.js
│   │   │       │   ├── pnum.js
│   │   │       │   ├── push.js
│   │   │       │   ├── rnotwhite.js
│   │   │       │   ├── slice.js
│   │   │       │   ├── strundefined.js
│   │   │       │   ├── support.js
│   │   │       │   └── toString.js
│   │   │       └── wrap.js
│   │   ├── jquery.lazyload
│   │   │   ├── bower.json
│   │   │   ├── img
│   │   │   │   ├── bmw_m1_hood.jpg
│   │   │   │   ├── bmw_m1_side.jpg
│   │   │   │   ├── bmw_m3_gt.jpg
│   │   │   │   ├── corvette_pitstop.jpg
│   │   │   │   ├── grey.gif
│   │   │   │   ├── transparent.gif
│   │   │   │   ├── viper_1.jpg
│   │   │   │   ├── viper_corner.jpg
│   │   │   │   └── white.gif
│   │   │   ├── jquery.lazyload.js
│   │   │   ├── jquery.lazyload.min.js
│   │   │   ├── jquery.scrollstop.js
│   │   │   └── jquery.scrollstop.min.js
│   │   ├── jquery-zoom
│   │   │   ├── bower.json
│   │   │   ├── daisy.jpg
│   │   │   ├── demo.html
│   │   │   ├── grabbed.cur
│   │   │   ├── grab.cur
│   │   │   ├── icon.png
│   │   │   ├── jquery.zoom.js
│   │   │   ├── jquery.zoom.min.js
│   │   │   ├── readme.md
│   │   │   ├── roxy.jpg
│   │   │   └── zoom.jquery.json
│   │   ├── kayahr-jquery-fullscreen-plugin
│   │   │   ├── build.xml
│   │   │   ├── demo
│   │   │   │   ├── iframe.html
│   │   │   │   └── index.html
│   │   │   ├── externs
│   │   │   │   ├── jquery.fullscreen.js
│   │   │   │   └── jquery.js
│   │   │   ├── fullscreen.jquery.json
│   │   │   ├── jquery.fullscreen.js
│   │   │   ├── jquery.fullscreen-min.js
│   │   │   ├── lib
│   │   │   │   └── compiler.jar
│   │   │   ├── LICENSE.txt
│   │   │   └── README.md
│   │   └── pure
│   │       ├── base-context.css
│   │       ├── base-context-min.css
│   │       ├── base.css
│   │       ├── base-min.css
│   │       ├── bower.json
│   │       ├── buttons-core.css
│   │       ├── buttons-core-min.css
│   │       ├── buttons.css
│   │       ├── buttons-min.css
│   │       ├── forms.css
│   │       ├── forms-min.css
│   │       ├── forms-nr.css
│   │       ├── forms-nr-min.css
│   │       ├── grids-core.css
│   │       ├── grids-core-min.css
│   │       ├── grids.css
│   │       ├── grids-min.css
│   │       ├── grids-responsive.css
│   │       ├── grids-responsive-min.css
│   │       ├── grids-responsive-old-ie.css
│   │       ├── grids-responsive-old-ie-min.css
│   │       ├── grids-units.css
│   │       ├── grids-units-min.css
│   │       ├── HISTORY.md
│   │       ├── LICENSE.md
│   │       ├── menus-core.css
│   │       ├── menus-core-min.css
│   │       ├── menus.css
│   │       ├── menus-min.css
│   │       ├── menus-nr.css
│   │       ├── menus-nr-min.css
│   │       ├── menus-paginator.css
│   │       ├── menus-paginator-min.css
│   │       ├── pure.css
│   │       ├── pure-min.css
│   │       ├── pure-nr.css
│   │       ├── pure-nr-min.css
│   │       ├── README.md
│   │       ├── tables.css
│   │       └── tables-min.css
│   ├── bower.json
│   ├── css
│   │   ├── admin.css
│   │   ├── frontend.css
│   │   └── magazine.css
│   ├── img
│   │   ├── arrows.png
│   │   ├── binding_light_@2X.png
│   │   ├── binding_light.png
│   │   ├── fabric_of_squares_gray_@2X.png
│   │   ├── fabric_of_squares_gray.png
│   │   ├── lightpaperfibers.png
│   │   ├── loader.gif
│   │   ├── logo100.png
│   │   ├── logo.png
│   │   ├── pdf.png
│   │   ├── zoom-icons-editable.png
│   │   ├── zoom-icons.png
│   │   └── zoom.png
│   └── js
│       ├── admin.js
│       ├── frontend.js
│       ├── magazine.js
│       └── turn.js
│           ├── hash.js
│           ├── scissor.min.js
│           ├── turn.html4.min.js
│           ├── turn.min.js
│           ├── zoom.js
│           └── zoom.min.js
├── composer.json
├── composer.lock
├── controllers
│   ├── AdminController.php
│   ├── AssetsController.php
│   ├── FrontController.php
│   ├── PdfController.php
│   └── Plugin.php
├── documentation
│   ├── css
│   │   ├── prism.css
│   │   ├── pure.css
│   │   └── style.css
│   ├── img
│   │   ├── fabric_of_squares_gray_@2X.png
│   │   ├── fabric_of_squares_gray.png
│   │   ├── logo100.png
│   │   ├── logo.png
│   │   └── screenshots
│   │       ├── activation-error-notification.jpeg
│   │       ├── activation-notifications.jpeg
│   │       ├── importing-pdf.jpeg
│   │       ├── import-progress.jpeg
│   │       ├── import-scheduled.jpeg
│   │       ├── pdf-files-in-menu.jpeg
│   │       ├── pdf-list-page.jpeg
│   │       ├── pdf-preview.jpeg
│   │       └── settings-requirements-are-not-met.jpeg
│   ├── index.html
│   └── js
│       ├── jquery.js
│       ├── jquery-scrollspy.js
│       ├── prism.js
│       └── scripts.js
├── languages
│   ├── en_US
│   │   ├── pdf-light-viewer-en_US.mo
│   │   └── pdf-light-viewer-en_US.po
│   └── ru_RU
│       ├── pdf-light-viewer-ru_RU.mo
│       └── pdf-light-viewer-ru_RU.po
├── libraries
│   └── directory_helper.php
├── LICENSE
├── models
│   └── Model.php
├── pdf-light-viewer.php
├── templates
│   └── shortcode-pdf-light-viewer.php
├── vendor
│   ├── autoload.php
│   ├── composer
│   │   ├── autoload_classmap.php
│   │   ├── autoload_namespaces.php
│   │   ├── autoload_psr4.php
│   │   ├── autoload_real.php
│   │   ├── ClassLoader.php
│   │   └── installed.json
│   └── WebDevStudios
│       └── Custom-Metaboxes-and-Fields-for-WordPress
│           ├── CONTRIBUTING.md
│           ├── example-functions.php
│           ├── Gruntfile.js
│           ├── helpers
│           │   ├── cmb_Meta_Box_ajax.php
│           │   ├── cmb_Meta_Box_field.php
│           │   ├── cmb_Meta_Box_Sanitize.php
│           │   ├── cmb_Meta_Box_Show_Filters.php
│           │   └── cmb_Meta_Box_types.php
│           ├── images
│           │   ├── ico-delete.png
│           │   ├── ui-bg_flat_0_aaaaaa_40x100.png
│           │   ├── ui-bg_flat_75_ffffff_40x100.png
│           │   ├── ui-bg_glass_55_fbf9ee_1x400.png
│           │   ├── ui-bg_glass_65_ffffff_1x400.png
│           │   ├── ui-bg_glass_75_dadada_1x400.png
│           │   ├── ui-bg_glass_75_e6e6e6_1x400.png
│           │   ├── ui-bg_glass_95_fef1ec_1x400.png
│           │   ├── ui-bg_highlight-soft_75_cccccc_1x100.png
│           │   ├── ui-icons_222222_256x240.png
│           │   ├── ui-icons_2e83ff_256x240.png
│           │   ├── ui-icons_454545_256x240.png
│           │   ├── ui-icons_888888_256x240.png
│           │   └── ui-icons_cd0a0a_256x240.png
│           ├── init.php
│           ├── js
│           │   ├── cmb.js
│           │   ├── cmb.min.js
│           │   ├── jquery.datePicker.min.js
│           │   └── jquery.timePicker.min.js
│           ├── package.json
│           ├── phpunit.xml
│           ├── readme.md
│           ├── style.css
│           ├── style.min.css
│           └── tests
│               ├── bin
│               │   └── install-wp-tests.sh
│               ├── phpunit
│               │   ├── includes
│               │   │   └── bootstrap.php
│               │   └── tests
│               │       └── CMB_Core_Test.php
│               └── README.md
└── views
    └── settings.php
				

What next?

Check Quick start guide section to see quick examples of plugin's usage.

Quick start guide

How to hit the ground running?

First of all you need to check plugin requirements.

Requirements

  • PHP is 5.2 or higher
  • Imagick support
  • Writable upload folder wp-content/uploads/pdf-light-viewer

After activation plugin will create new post type for PDF files. You'll see pointer notification near it's menu item.

Activation notifications

Also right after activation, plugin will check requirements and will notify you about checking results. If requirements are met, notification will show up and disappear.

But if some requirements are not met, you'll see constant error notification. Follow the link in the notification to see details on the settings page.

Error notification

You can find WordPress PDF Light Viewer Plugin settings page by following url address like this one http://yoursite.com/wp-admin/options-general.php?page=pdf-light-viewer

If some requirement is not met, you will see it on settings page:

Requirements are not met

What next?

Check Set Up section to know more about plugin global settings.

Set up

Where to start?

You can find WordPress PDF Light Viewer Plugin settings, requirements and documentation on the page http://yoursite.com/wp-admin/options-general.php?page=pdf-light-viewer

In settings you can hide the new PDF post type from the admin menu. This is useful, when you uploaded PDF files not often and do not want to unnecessary item to take the space of the screen.

Settings

You can turn it on again at any moment.

What next?

Check Usage section to know more about use cases.

Usage

How to use?

Importing PDF file

You can go to PDFs menu item to see the list of imported PDF files.

PDF Files in menu

If you just installed the plugin the list will be empty. Go ahead and import first PDF document by clicking Import PDF button.

Importing of PDF is similar to the creating regular WordPress post or page but there are some differences.

Importing PDF

You can specify the title for the PDF. It's for internal use only, it wouldn't be shown on the site automatically.

You're available to change some importing options such as:

  • JPEG compression quality
  • JPEG resolution

Changing these options will affect importing process.

To import PDF file choose the file from the Media Library and check the checkbox Enable import

Click Publish to start the import.

Import scheduled

We moved the import process to the background, so you could continue to do other things on the site if needed.

The import process doesn't use the WP Cron functionality. It's triggered by browser's background (AJAX) call. We could not rely on WP Cron functionality because some servers (we faced that problem with Hostgator) doesn't allow loopback requests.

The import process will work from any admin interface page.

It will work until you leave the admin interface and will continue when you come back.

Anyway, please note, that import of large PDF files (50 pages and more) will take some time.

Also, please note, that import of large PDF files will take some server resources (memory usage, CPU time, etc.). Usage of these resources depends on PDF file size, number of pages, initial PDF resolution, etc.

That's why we separated the import process by pages.

Please, use carefully.

The importing time depends on the server. Anyway, you can check import progress in notification at the top of the page, or on the PDF list page.

PDF List Page

After import, the first page will be set as featured image of the PDF file post.

Re-importing PDF file

To re-import PDF file, choose the new file from the Media Library and check the checkbox Enable import

Click Update to start the import.

Please note, that all previously imported pages of this document will be deleted from the disk. This operation cannot be undone.

Updating PDF file

If you just need to change the name of the PDF file, you leave the option Enable import unchecked. Without checking this checkbox import wouldn't be triggered.

Deleting PDF file

If you will permanently delete PDF file post, all previews will be also deleted.

Please note, that this operation cannot be undone.

Changing permissions

In the Permissions section you can add limits for different user roles for this file.

If you'll choose Anonymous user role and set limit to 3, then on the Front of the site anonymous users will see only first 3 pages of the PDF file.

Preview

After importing file you could preview your file exactly how it will be shown with help of shortcode on the frontend.

PDF List Page

Shortcodes

After importing you can add PDF files with shortcodes anywhere in your post or page. You can copy shortcodes from PDFs list page or compose them manually.

PDF List Page

What next?

Check Advanced Usage section to get full control on the plugin functionality and look and feel.

Advanced Usage

Are you developer?

So you're developer. We take care about you, no matter, whether you get our plugin from the client or bought it for your purposes. You don't need to change anything inside the plugin (at least we hope so).

You will have full control on the plugin right from other plugin, or theme, or whatever you use in your wordpress.

Code control

You can override any of plugins classes somewhere before the after_setup_theme action:

  • PdfLightViewer_Plugin - some main functions
  • PdfLightViewer_AssetsController - css and js assets including
  • PdfLightViewer_AdminController - admin functions
  • PdfLightViewer_FrontController - frontend functions
  • PdfLightViewer_PdfController - custom PDF post type and related functions
Templates control

You can create shortcode-pdf-light-viewer.php in your theme or copy it from templates folder to your theme folder to override all default plugin template for frontend.

Plugin Output

Shortcode [pdf-light-viewer] as well as PdfLightViewer_FrontController::disaply_pdf_book($atts = array()) has following parameters:

  • id (required), this is ID of the PDF post, you can
  • template (optional), you can specify template name to override default. Template name can be any, that accepted by get_template_part() function.

You could call class method PdfLightViewer_FrontController::disaply_pdf_book($atts = array()) directly instead of using shortcode [pdf-light-viewer].

What next?

Check Support section to get in touch with our support team.

Support

Need support?

Once again, thank you so much for getting our plugin. We would be glad to help you in any questions related to this plugin.

We want to make your plugin usage as much easier as we could.

If you want, you can contact us, you can do it by email: support@teamlead.pw or through the support forum at http://support.wp.teamlead.pw (coming soon)

This plugin is free and we will appreciate any donations from you - Donate us.

Also please find us on CodeCanyon: http://codecanyon.net/user/antongorodezkiy/portfolio

Credits

Sources used

Changelog

Version 1.0

  • The plugin released