Scale PDF to fit iFrame

Luuxter picture Luuxter · Feb 19, 2017 · Viewed 22.7k times · Source

I need to scale a PDF file to fit the iFrame. It needs to be responsive, so the PDF should scale with the device width so that the PDF document displays a complete page.

If there is a free plugin or a function in Bootstrap to make this happen, I would be happy to hear about it.

Thanks in advance!

Answer

user7582130 picture user7582130 · Feb 19, 2017

If you are asking how you can resize the PDF to fit the Iframe.

This following code may help:

<iframe src="name.pdf#zoom=50" height="100%" width="100%"></iframe>

By adding the #zoom=50 it will show the PDF with zoom in the iframe as default. (This can be edited to any number you want)