Google PDF Viewer default fit to width embed - html

When I embed a pdf using google's PDF viewer
<iframe src="https://drive.google.com/viewerng/viewer?embedded=true&url=http://jugglegood.com/out/scot-nery-resume-grand.pdf" ></iframe>
it defaults to displaying the pdf with a lot of space around it.
Then, I click the + magnify (zoom) button at the bottom of the viewer and it zooms to fit to width.
Is there a way to default using parameters or something to the fit to width zoom version of the embed? I couldn't find an answer, so i even tried using jquery to manually click the zoom button... no dice.

here are some ideas:
check your CSS to see if there are any settings for a class, id, iframe - your stylesheet could be telling the browser how to display the PDF on screen.
You can tell the iframe in the HTML to be 100% width. I run into this a lot for Google Maps hosted on a site.
<iframe src="https://drive.google.com/viewerng/viewer?embedded=true&url=http://jugglegood.com/out/scot-nery-resume-grand.pdf" width="100%" aria-hidden="false" tabindex="0"></iframe>
I keep the aria-hidden [this is for screen readers for people who are blind] and tabindex [keyboard navigation for people with disabilites]. Pleasee see my GitHub WAPS system for website code and design for people with diverse needs.

Related

I canĀ“t show PDFs correctly in Microsoft Edge ussing iframe

I have problem using Microsft Edge for view PDF files with HTML. In my webpage, i use iframe tags and the src attribute with file path.
The images are shown smoller than the iframe and with random size, and add a scrollbar. (Not happen when i use Chrome, Safari or Firefox).
Simplified code:
<div id="contenedor">
<div>
<iframe id="pdf1" src="pdfs\Prueba1.pdf#toolbar=0&navpanes=0&scrollbar=0&statusbar=0&messages=0&view=fitV" frameborder="0" class="frame"></iframe>
</div>
<div>
<iframe id="pdf2" src="pdfs\Prueba2.pdf#toolbar=0&navpanes=0&scrollbar=0&statusbar=0&messages=0&view=fitV" frameborder="0" class="frame"></iframe>
</div>
<div>
<iframe id="pdf3" src="pdfs\Prueba3.pdf#toolbar=0&navpanes=0&scrollbar=0&statusbar=0&messages=0&view=fitV" frameborder="0" class="frame"></iframe>
</div>
</div>
I attach image of the visualization examples.
smoller than the iframe and scrollbar
random size and scrollbar
My doubt are if the parameters that i add to the src are corret for obtain the fit of the iframe to have the same size for all and not have visible scrollbar.
I will be very grateful.
Disable the following flag: edge://flags/#edge-smooth-scrolling-enabled-pdf
Note: Make sure you update the latest version of Microsoft Edge.
The server cannot control the browser it can only offer "recommendations" such as "download" or "download and view", it is the client decides on preferences and media actions.
those Acrobat settings for scrollbars etc are only for Acrobat or PDF viewers that respect them.
So exactly same as a PDF reader does not have to respect NO COPY, simply adding Bad Arguments to an iFrame can be ignored.
Currently this is the best way to send recommendations to Edge.
You may wonder why the first two do not both FitV
and the answer is I as client chose my screen to be 66% thus the image is 66% of FitV.
So why then does the first one keep at FitV ?, its because there are more pages.
And why is the last one a Fit is because the frame is 25% of the page fit.

Flutter web in an iframe with dynamic height

I have embedded a flutter web app onto my Wordpress site. The flutter app is connected to an API and has a varying height. Is there a way to make the Iframe change its height depending on what's shown in it?
My code so far:
<iframe src="My-URL" height="600" width="100%"></iframe>
Side note, is there a way to turn off scrolling when I hover over the iframe (I still need to be able to click on it).
scrolling="no"
doesn't seem too be working.
Thankful for all answers :)

Display document in an iframe for all devices

I am developing a website use by PC, Tablet and smartphone and i am trying to display a document in an iframe. I read a lot of post but I'm stuck.
I have a component html with an iframe inside:
<iframe src="http//..myDoc.pdf"></iframe>
On computer it works fine and the iframe display the document.
But I have two problems:
1) On android (tablet Samsung and smartphone Samsung), the document is not display and it is downloading automatically instead.
What I need to do for avoid download the document and for only display it?
2) On iPhone (6s), the document is displayed but the document's size exceeds the ifame'size.
How can I do to fit all the document in the iframe?
Thank you
I have found an answer and It works on all devices.
<iframe src="http://docs.google.com/gview?url=http://..myDoc.pdf&embedded=true" style="width:100%; height:100%;" frameborder="0"></iframe>
I need to display sensitive data. Is it a secure way to use the docs.google.com/gview ?
If I need to do something to secure the iframe, can someone tell me please?
Thank you

Scale PDF page sizes with screen using <object> tag

I am currently doing so like this:
<div class='embed-responsive' style='padding-bottom:150%'>
<object data="../pdf/Invoice_file.pdf" type="application/pdf" width="95%" height="800px"
style="display: block; margin: 0 auto;" />
<p>Not supported by browser.</p>
</object>
</div>
I looked at the other solutions on here but none of them worked. If possible I'd like to scale the PDF page size as the screen gets smaller. Any ideas would be appreciated, thanks!
Unless your PDF of choice has a JS interface, you may find you can't achieve what you want. Why not - well I just opened a PDF file in Chrome and resides the browser window. The PDF page in view did not scale - so I conclude that Chrome's PDF viewer is coded to re-center the page on viewport dimension changes but not to scale the page.
I your PDF viewer of choice provides a JS interface, then you probably can do it.
Problems will no doubt occur if you cannot dictate the PDF viewer your users will choose.

Is there a way to programmatically scroll to a PDF page within a Ipad Safari?

I'm current trying to display a pdf inside an iframe
<iframe id="iFrame" height="583px" width="785px" src="pdf/test.pdf" scrolling="yes" ></iframe>
after i test on ipad, i found out that it cannot be scroll. is there any solution to this?
Thanks.
I would highly suggest using Scribd's service, it even let's you restrict user downloads if that is a concern.
If you place two fingers on the text in the pdf, you can scroll that text instead of the whole page.