Erik Erik - 3 months ago 21
CSS Question

Size of opened PDF file by HTML

on my page http://brigadatest.8u.cz/webovky/vzhled.php (I am still developing it) I have a link which opens a PDF file saved on server. The problem is, that web browsers open it minimized (80%). Is there some way, how to "say" to the browsers they have to open it maximized (cca 200%)?? You can see how it works on that page, just click on the green button with name "cenĂ­k".

Answer

If you want to open a new window with the zoom set, then the solution I propose would only work for Firefox but not for Chrome nor IE.

All you have to do is to append the #zoom=100 or #view=fit to the end of the url and that would do the trick.

I researched about Chrome and IE not being able to interpret the zoom and view attributes, but only found this OP that mentions Chrome.

If you want to support the major browsers, I suggest you use an iframe, object or embed and manipulate their zoom or view attribute.

I created this working example that makes use of iframe and set its zoom to 20% and 100%.

Hope this helps.

Comments