Forcing an embedded PDF to display fully in a post?
-
Hello everyone,
Wondering if you all have any suggestions about making an embedded PDF fit fully in a post.
I’m using the most recent v. of the “Weaver” theme, and the most recent WP. I’m working on a site for someone and am trying to get a newsletter PDF embedded into a post.
I can embed it using this code in the html editor:
<embed src="http://mysite.com/document.pdf" width="700" height="575">The width and height I’ve chosen seem optimal for making most of the PDF show up in the post – but not all.
It still has to be scrolled side to side, and up and down (the side to side scrolling is the real problem).
Though, when hovering the mouse over the bottom right corner of the embedded PDF there is a series of icons to print, save, expand, etc. that come up, I’d like viewers of the site to be able to see the full width of the PDF (maybe the full length, too) without having to either scroll side to side or know to click the icon that expands the PDF so its width fits in the embedded window.
Is there any code I can add to the html I gave above to “force” the PDF to go edge-to-edge?
If it helps, here is the site.
Thanks kindly.
-
Update: I can get the entire length of the PDF to display by simply changing the html height to about 2200px; but no matter what I do to the width, I can’t seem to get the document to constrain itself so that it doesn’t need to be scrolled side to side, argh.
Any help would be fantastic; thank you!
You cannot use CSS or HTML to constrain (or otherwise style) a PDF document as it uses neither CSS nor HTML. If you do not allow a horizontal scroll (using something like
overflow:hidden;) part of the pdf will be permanently hidden.Hello esmi,
Long time, no type!
If I cannot use CSS or HTML, then how can I constrain the PDF document?
Cheers
I’m sorry but the short answer is that you can’t. Pdfs are not accessed by the web browser itself but via a browser plugin. One of the reasons for using pdf documents is that their layout remains completely unchanged from browser to browser and screen to screen because they do not use the web browser’s rendering engine. So you are going to be stuck with a horizontal scroll bar on any screen that is not wide enough to accommodate the pdf document and your theme’s layout (padding/margins/menu etc).
Argh. Well, coming from you, esmi, I’ll have to take that as a definite. It’s too bad, because yes, we’d love to have the format of the newsletter remain unchanged (as per the PDF).
(I did have success in displaying the full width of the PDF using a WP Google Docs viewer plugin, but it rendered the embedded PDF very small all around, while I’m trying to make it fully viewable AND full size. Guess there’s always going to be some kind of compromise.)
Thanks for your help!
The topic ‘Forcing an embedded PDF to display fully in a post?’ is closed to new replies.