FranckFreiburger / vue-pdf

vue.js pdf viewer
MIT License
2.24k stars 525 forks source link

PDF - Blank pages - Landscape mode - iOS higher resolution #254

Open shikha-desai opened 4 years ago

shikha-desai commented 4 years ago

I am trying to display a Base64 PDF using vue-pdf and it displays perfectly good on certain browsers while for some of the scenarios, it doesn't print all the pages, some pages show as blank.

I have tested the PDF in both portrait and landscape mode from iPhone XS on "http://mozilla.github.io/pdf.js/web/viewer.html?file=" and it works fine. So, the issue is with vue-pdf and not with pdf.js. From my analysis of the issue, the problem occurs in iOS devices when the canvas size reaches a higher value and it malfunctions. I wanted to try to set the maximum canvas size or something similar for the pdf rendering, but vue-pdf doesn't expose the canvas element outside the library.

When I changed the canvas width/height to 50% from 100% in the following line, the PDF rendered fine in landscape mode across all devices, so it is mostly the issue with some max canvas size only: https://github.com/FranckFreiburger/vue-pdf/blob/master/src/componentFactory.js#L18

shikha-desai commented 4 years ago

Tried with the following public PDF and found the same issue with landscape mode on iOS: https://www2.deloitte.com/content/dam/Deloitte/cz/Documents/financial-services/cz-open-banking-and-psd2.pdf

It occurs for bigger pdf, for around 25 pages or more.