Shortcodes included with PDF Viewer for WordPress v10 and newer

PDF viewer for WordPress PDF viewer for WordPress / Shortcodes Last updated on Updated  Jul 01, 2021

We had a bunch of shortcodes included with older versions of PDF Viewer for WordPress. But we've streamlined the shortcodes and lowered the number of shortcodes to only 2 from version 10.

However, the previously generated shortcodes will still work, but there's no way to create those old shortcodes now.

Here are the new shortcodes that comes with PDF Viewer for WordPress version 10:

1. [pvfw-embed]

This shortcode allows you to embed already created PDF Viewers (Using PDF Viewer > Add New menu) on any post or page. It comes with a few parameters.

  1. viewer_id: This is the id of the viewer you want to embed.
  2. width: This is the width of the iframe that will be embedded on the page.
  3. height: This is the height of the iframe that will be embedded on the page.
  4. iframe_title: The title of the iframe.
  5. page: Page number to open on load.
  6. zoom: Default Zoom
  7. pagemode: Default pagemode.

an example of [pvfw-embed] shortcode:

[pvfw-embed viewer_id="6" width="100%" height="800" iframe_title="PDF Viewer" page="5"]

[pvfw-link] shortcode allows you to insert a link to an already created PDF Viewer (Using PDF Viewer > Add New menu). It comes with a few parameters.

  1. viewer_id: This is the id of the viewer you want to link to.
  2. text: The anchor text that will be used as link.
  3. target: defines the target of the link. put _blank if you want to open the the link in new tab or use _parent if you want to open the link on the same tab.
  4. class: you can add a css class here to the link.
  5. page: Page number to open on load
  6. zoom: Default Zoom
  7. pagemode: Default pagemode.

an example of [pvfw-link] shortcode:

[pvfw-link viewer_id="6" text="Open PDF" target="_blank" class="pdf-viewer-link" page="5"]