Make embedded PDF scrollable in iPad

后端 未结 8 1812
刺人心
刺人心 2021-02-01 22:24

For some reason the iPad safari browser does not handle embedded PDFs well. PDFs view fine on their own when launched standalone, but not with the object tag. The problem is t

相关标签:
8条回答
  • 2021-02-01 23:08

    Another solution (without coding) is to use Google if you only want to use embeddings selectively.

    1. Store your pdf in your Google Drive
    2. Open it with preview.
    3. Select "Open in new window" from the submenu of the three items.
    4. In the new window select "Embed item" in the submenu of the three items.
    5. Copy the iframe code and paste it into your page.

    Here you can also find detailed instructions and under point 12 you can see the iframe code.

    0 讨论(0)
  • 2021-02-01 23:12
    static downloadPdfChromeApp(linkSource: string) {
            // Crea un div y dentro un object para luego destruirlo y abrir una nueva ventana enviando la data
            const divpdf = document.createElement('div');
            divpdf.innerHTML = '<div style="display:none;position:absolute">' +
                '<object  style="display:none;" id="docuFrame" type="application/pdf" width="1px" height="1px" data="' +
                linkSource + '"></object></div>';
            document.firstElementChild.appendChild(divpdf);
            const frame = document.getElementById('docuFrame') as HTMLObjectElement;
            window.open(frame.data);
            divpdf.remove();
        }
    
    0 讨论(0)
提交回复
热议问题