How to Make the PDF Page Fit the Entire Lightbox Width When Opening a PDF File

Plugin:

Wonder Lightbox

Tutorial:

You can easily open a PDF file in a lightbox popup using the Wonder Lightbox plugin. By default, the PDF file will open with the "Automatic Zoom" option enabled.

To define a different zoom option, add an additional parameter to the end of the PDF file URL. The available options are: #zoom=page-width, #zoom=page-height, and #zoom=page-fit.

To make the PDF page fit the entire lightbox width, you can add #zoom=page-width to the end of the PDF URL. For example:

https://www.wonderplugin.com/wp-content/uploads/2017/02/how-to-create-a-wordpress-post-carousel.pdf#zoom=page-width

The lightbox code will be as follows:

<a href="https://www.wonderplugin.com/wp-content/uploads/2017/02/how-to-create-a-wordpress-post-carousel.pdf#zoom=page-width" class="wplightbox" data-barheight="0" data-width="1200" data-height="1200" data-showsocial="false">Open PDF in Lightbox</a>

An online demo is as follows: Open PDF in Lightbox