Tip for slow PDF view render in Zotero 6 and 7

I recently tried the Z7 Beta hoping that the new pdf.js would improve rendering speed for large color pdfs. I was quite disappointed, as the performance is essentially identical to Z6. That got me searching for a a different workaround and I stumbled across this solution.

So I recently tested some different approaches on books from Archive.org which are scanned in color and have OCR. Some are very slow to render when scrolling to a new page in Zotero 6 and 7 Beta and any browser using pdf.js. Very typical to take 20-30 seconds to render a new page when scrolling. Jumping pages by entering a page #, however, takes only 2-3 seconds.

What I discovered is that saving as a PDF/A (any version) compliant file fixes it. Instead of 20-30 seconds, pages appear and render in 2 seconds or less, and it does not matter whether the pdf is color, black and white, 30mb file size or 400mb file.

However, on the larger files, I do see that Z6 is actually faster than the latest Z7 beta 39.
  • Could you provide a link to the file that is faster on Z6 than Z7?

    Also try the latest beta to see if there is any difference.
  • I have come to learn a few more things that can affect display performance of PDF.js in Zotero.

    First, pdf's using JPEG2000 compression (common in Archive.org and other sources) can be very slow in Zotero. PDF.js renders far faster with JPEG image compression than JPEG2000. In my tests, converting from JPEG2000 to JPEG compression can speed up rendering of big color files in Zotero as much as 5-8x.
    JPEG can increase the file size can by several times, so there is no free lunch there.

    Also, many Adobe generated pdf's use multiple images per page, including a mask layer. This also slows PDF.js down as well. Thus, a 300mb pdf with a single image per page and OCR can render 10x+ faster than the same multi-image and masked pdf of 25mb, especially if it uses JPEG2000 and JBIG2 compression.

    Here is a pic of Preflight in Acrobat showing the various images and compression
    https://drive.google.com/file/d/1XeaTakAl_EBCdPUR8GjH0hWovRUuNv37/view?usp=sharing

    If you are using Acrobat, you can optimize a pdf and choose the compression types there. I now run most of my pdf's through ABBYY 15 and get OCR and JPEG compressed output which performs well in Zotero, even for very large docs. Only drawback is file size. Though greyscale can reduce size and ABBYY can even output B/W, which also dramatically reduces file size and gives the best performance.

    Now that I have isolated these issues, I am finding the performance of Z6 and Z7 beta to be equal.

    Here is a helpful guide for some of PDF.js limits and quirks: https://apryse.com/blog/pdf-js/guide-to-pdf-js-rendering
Sign In or Register to comment.