I can´t show PDFs correctly in Microsoft Edge ussing iframe

Viewed 190

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.

2 Answers

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.

enter image description here

Related