New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slow rendering pdf #9810
Comments
Do you have any images in your source PDF file?? I am also facing the same slow loading of PDF file in web page.. Please share if you got something on it.. |
No. I don't. It's text only. However, while unrelated to this, I do recall seeing some slowness in rendering if the image is of high quality (scanned at a high dpi for instance). Not sure if that's your case |
We've noticed that PDF documents that don't have everything embedded are causing performance issues on the ipad. Possibly an issue with the @font-face loading completion detection. Taking a PDF and converting it to a PDFA(rchive) has seemed to improve performance to acceptable levels. I'm going to dig into the PDFjs code to see if there's anything we can do to improve these scenarios but any pointers as to where I may want to start would be helpful. |
We have similar issues with rendering a PDF on iOS (11.4.1). |
This issue is quite old, but given that it appears to only affect a particular platform (iOS) it seems very unlikely to be actionable/valid in the PDF.js project. More likely, there are/were problems either with font loading and/or canvas rendering in iOS, which we however cannot really do anything about. Given that this renders more-or-less instantly in e.g. Firefox, I'd suggest closing this issue since it doesn't seem actionable here. |
I'm now seeing this error when trying to render the attached PDF on Firefox through hugo (via https://github.com/anvithks/hugo-embed-pdf-shortcode) on a mac. I realize the tech stack may be a bit esoteric, but I've never seen such a slow render. From what I can read of his code, he's just straight loading the mozilla pdf.js code to display the pdf. |
Attach (recommended) or Link to PDF file here:
pdfExample10.pdf
Configuration:
Steps to reproduce the problem:
What is the expected behavior? (add screenshot)
Pdf loads in a reasonable amount of time
What went wrong? (add screenshot)
Pdf loads very slowly, one line at a time, taking up to 45 seconds at times.
Some background
I've tried going through the pdf.js code to see what might be causing the slow rendering, and the only thing I can guess is the font that this particular pdf uses. File size and the amount of text doesn't seem to affect the rendering speeds (I have other, larger pdfs that load fine). This pdf was made using MS Word and the font type is TrueType, if that helps.
I'm primarily hoping for a reason why this pdf might be loading slowly and possibly a fix that I can do on my side (I've tried changing preferences listed in your preferences_schema and that doesn't seem to help. If there are code changes that might be needed on your side, if you can guide me in the direction of what code might need the change, I would really appreciate that
Link to a viewer (if hosted on a site other than mozilla.github.io/pdf.js or as Firefox/Chrome extension):
https://mozilla.github.io/pdf.js/web/viewer.html
The text was updated successfully, but these errors were encountered: