How to set fit width when embedding pdf in Chrome? How to set fit width when embedding pdf in Chrome? google-chrome google-chrome

How to set fit width when embedding pdf in Chrome?


I had the exact same problem and found after quite a lot of digging that the problem is with the Chrome pdf viewer. It does not accept url open parameters like adobe does, see https://code.google.com/p/chromium/issues/detail?id=64309.

In order to test this I typed in "about:plugins" in Chrome, disabled Chrome pdf viewer and enabled the adobe viewer. Once I did this the following code worked for me:

<object type="application/pdf" data="2010%20AHS%20XC%20Results.pdf" width="1500" height="1200"><parm name="view" value="FitH" /></object>

I understand this is not a real fix as you can't control whether the visitors to your site have this plugin or not, but wanted to leave this answer here so that others who see this post know that the issue is with Chrome Pdf viewer not accepting URL open parameters as of 11/21/14 and so will not waste their time looking for issues in their code.


I know this is old question but I came through the same problem. I am having same issue with chrome v43 (but not in 40/41).

Solution:Instead using <embed> tag to display PDF. Use <iframe> with src attribute with PDF rendering URL. If you don't want to disclose your PDF path then give your script path, which will print PDF content with header application/pdf.