Chrome PDF Viewer Fit To Page - google-chrome

I have a user that open hundreds of PDFs per week through the PTO’s Electronic Filing System and need to review them in the browser. When Firefox isn’t working with the PTO (I was able to customize Firefox), I have to use Chrome. To manually have to click on every PDF so that I can then go through them page-by-page is not practical. Is there a way to not have to manually fix the page layout every single time I open a pdf. I want to set the default to fit page mode so that I don’t have to do that the hundreds of times I open PDFs in the browser.
Can change this with javascript or PS?

I answered this question here: How to set fit width when embedding pdf in Chrome?
It requires creating an iframe, so it may not be ideal, but my solution provides some reusable code that I use on my websites. HTH!

Related

Control the viewing of pdfs

I have some pdfs that should be viewable but not downloadable. Currently the pdfs are viewed and displayed in different browsers differently through various browser plugins that all permit pdf downloads. Is there a way to restrict these downloads if not in all plugins then just the google chrome pdf viewer specifically. Or is there a simple cross browser solution for viewing pdfs but not allowing them to be downloadable
By the time the PDF gets to the browser plugin, it's already been downloaded.
If you only want one page at a time, you'll need to implement a server-side mechanism to handle that. Like Amazon's "Peek Inside" feature

How do I get rid of the sidebar and toolbar when embedding a pdf in an html file?

Trying to embed a pdf on my website like so:
<iframe src="filename.pdf" type='application/pdf' frameborder="0"></iframe>
The website is a rails site, and currently I'm only running it on a local server.
The problem is that the pdfs render with a toolbar on top and a sidebar with my adobe creative cloud account information, as seen in the picture below (the actual content of the pdf displays in the white box under the toolbar and to the left of the sidebar)
How can I get the pdf to render alone, without the menu and sidebar?
If you allow the browser to choose how the PDF gets rendered, you're never going to be able to create a consistent experience for your users unless you are in a controlled desktop environment.
If you are looking for a consistent experience, use pdf.js to render the PDF in the browser.
If you are in a controlled environment and all of your users have a browser/viewer combination that will let the browser show PDF using the Adobe Reader plugin (as your screen shot shows) then you can use the "open parameters" at the end of the URL to control what gets shown. See the documentation at the link below.
http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/pdf_open_parameters.pdf
That said, don't count on that solution to work for very long. Most modern browsers are not allowing the viewer plugins to function anymore and the rest are moving in that direction.
Searching more into stack, try that:
https://stackoverflow.com/a/2105095/7741129
For more detailed informations:
http://blogs.adobe.com/pdfdevjunkie/web_designers_guide
I think it's better use some kind of JS stuff just in case of cross-browser issues, like related into first link. Solutions like https://pdfobject.com/ it's helpful to get the job done. Look:
PDFObject 2.0 detects browser support for inline/embedded PDFs. (In
case you were wondering, your browser supports embedded PDFs. You
lucky dog, you!)
If you're working with dynamic HTML, such as a single-page web app,
you may need to insert PDFs on-the-fly. However, PDF embedding is not
supported by certain browsers. If you insert markup without first
checking for PDF support, you could wind up with missing content or a
broken UI.
The PDFObject utility helps you avoid these situations by detecting
support for PDF embedding in the browser; if embedding is supported,
the PDF is embedded. If embedding is NOT supported by the browser, the
PDF will NOT be embedded.
By default, PDFObject 2.0 inserts a fallback link to the PDF when the
browser does not support inline PDFs. This ensures your users always
have access to your PDF, and is designed to help you write less code.
The fallback link can be customized, or the option can be disabled if
you prefer.
PDFObject 2.0 is npm-ready. Modern web apps use npm to manage packages
and dependencies. PDFObject 2.0 is registered with Node Package
Manager (npm) and can be loaded dynamically.
PDFObject also makes it easy to specify Adobe's proprietary "PDF Open
Parameters". (Be warned these parameters are only supported by Adobe
Reader, most PDF readers will ignore the parameters, including the
built-in PDF readers in Chrome, Internet Explorer, and Safari. Read
more below.)

Controlling the zoom width when a pdf is opened in a browser

I understand browsers open pdf files in different ways and can be controlled in different methods (chrome://plugins, option>applications for Firefox etc.). Is it possible to adjust the resolution at which they are displayed at?
Say I click on a link that opens a pdf file in a new tab. Through HTML5, CSS, Javascript or some other method, is it possible to make it so that the pdf file is displayed at 100% resolution across all browsers?
It depends. There are at least two ways that this could be achieved.
The individual PDFs could have an Open Action that defines how
the PDF should be displayed when opened (in Acrobat this is the
Initial View in the Document Properties dialog). Not all PDF viewing applications will support this though (including the
plugins/extensions for viewing PDF in a browser). This would be the most universal way though as you do not have control over where users will open the PDF.
Determine if the various plugins have support for specifying this is part of opening a PDF. Other questions on Stackoverflow indicate that this is not possible with Google Chrome, see this answer.

.png images display in IE8 alone but not inside a page

It's been a while since I did serious web development. Now I meet a host of brand new problems I'm no longer familiar with..
I have some .png images for various icons in my web page. What I find is that whenever I edit these images, they stop working inside a page in IE8. That is, they (usually) display OK when I first open the page, then are replaced by the placeholder icon on refresh. Sometimes, some of the icons display and others, with the same src, don't.
My image tags are nothing fancy, typically:
<img src="images/misc/smallreport.png" alt="Report" />
When I right-click an icon in the page and select "properties", protocol, type, address and size are shown as "Not Available", and dimensions are incorrect (size of the placeholder, I bet).
If I open the images directly in IE (ie. not within the page), they work just fine.
I have used Paint.NET to edit the images, but have also tried saving them with Paint.
Right now, I am working right off the hard disk (ie. not through a web server). And, oh yes, none of this happens in Google Chrome.
What's going on here?
check the path to the file is correct - can we see the tag please.
Well, we learn something new every day..
I mentioned that I'm running this directly off the harddisk? Now, it turns out the html page (which I had gotten off a coworker) was blocked "to help protect my computer", as Windows does.
This is no big surprise, lots of files I'm working with originate on other computers, and I usually don't worry much about it (except with executables, which won't run until unblocked).
It seems, however, that when IE8 loads such a blocked HTML file, its security settings adjust somehow, and - well, I can only guess at the details, but as soon as I right-clicked the HTML file, selected Properties and clicked the "unblock" button, the problem went away.
Something similar happened to me once, I tried hard to find what was wrong, then I realized I was saving (from Photoshop) the file as PSD but with extension .png. Make sure you're not doing the same.
Also:
Clear temporary Internet files
Verify that the Show Pictures option has not been turned off
Make sure that the Toggle Images.exe Web accessory is not present and disabling images
Make sure that a third-party Internet security, firewall, or cookie-blocking program is not causing the problem
Enable the Auto-Select encoding option
Source
It might be that the website you have browse has a lack of support
for an IE browser. IE is a nightmare for all web developers & Web designers.
It might be the developer of that website didn't care for an IE display because
of IE issues. Perhaps IE is trying to create a web standard to increase their
sales and marketing strategy. That's why don't care the modern Web development standard.
Why Chrome or Firefox or Safari, it's a free anyway.

Open a PDF in browser 2 page up view

Is there a way to embed a pdf in a page and when it opens, to show two pages at once, side by side?
I want to simulate what happens when you open a pdf in Adobe Acrobat, then check "Two page View" and "Show cover page in Two Page view" under View->Page Display
I don't want to use a pdf reader script in my page; I'm happy if this only covers the set of users using more advanced in browser pdf readers.
Cheers
What you are trying to do involves browsers from multiple vendors and multiple versions of it, there is no concise and succinct answer to your question.
When trying to present a PDF document to a user via the web browser, in a particular fashion, you could use the following Parameters for Opening PDF Files
However, the parameter that you are looking for "Book View", i.e, Two Pages in a single view is not supported as per the official documentation.
Chrome and Acrobat are no longer compatible.
Change in support for Acrobat and Reader plug-ins in modern web browsers
For, other browsers that still support PDF plugins, use the following guidlines to Display PDF in browser
(This is mostly on the user side)