Embed PDF in WordPress

How to embed PDFs in WordPress

Lots of WordPress Download Manager Pro users ask us how they can preview PDF files to the site visitors as well as provide an option to download the file. As the visitor might like to know what’s inside the PDF file before downloading or just want to read it online.

That’s where comes the WordPress PDF Viewer add-on. You can easily setup PDF preview using this Download Manager Add-on.

The default document viewer with WordPress Download Manager Pro uses Google doc viewer which only works for public ( Accessible by all visitors, this is a WPDM access setting) PDF documents. But you can use  WordPress PDF Viewer add-on to show protected/members-only documents.

So, how do you embed the PDF on your site? Just follow these 4 simple steps:

1 ) Create a Download Manager package and attach your PDF file there.

2 ) Create a link/page template with [doc_preview] template tag. Or you can use existing Doc Preview page template (Single Column with Doc Preview).

3 ) Set this template as link/page template in package settings. Now package details page will show the preview of the attached PDF file.

4 )  Use the custom link template with [doc_preview]  template tag when you are using package shortcode to show the PDF somewhere else.

WordPress PDF Viewer


Comments [ 3 ]

  • Susie Michels

    Is there a way to open the PDF viewer with the Quick Page Preview open by default?

    • Shahriar

      Sorry, not sure what you meant by quick page preview. Could you please explain little more? PDF Viewer is rendered by [doc_preview] template tag. So, if you use this tag in a link or page template PDF Viewer will be shown.

  • Lucy Sestak

    Please write me what the code should look like, which after clicking on the link or button will display the PDF in a pop-up window (see: https://wpdmpro.w3eden.com/download/pdf-file/ , as you state on your page. I tried the code: View PDF , unfortunately this one only downloads the PDF again. The code View PDF displays the PDF in a new window (not pop-up), but the PDF does not load, reporting an error. I think this is the primary problem for all users of this plugin, because the Download manager does not offer document viewing by default.

Leave a Reply