Performance issue while retrieving images from PDFium at higher zoom levels

29 views
Skip to first unread message

CHINNAMUNIA KARTHIK C

unread,
Jul 21, 2026, 10:49:27 AM (4 days ago) Jul 21
to pdfium

We render PDF pages using PDFium and retrieve images based on the current zoom level to maintain image quality. However, at higher zoom levels (200%, 300%, 400%, and above), PDFium takes a considerable amount of time to generate and return the image data.

We would like to understand whether this is expected behavior and whether there are any recommended approaches for improving rendering performance.

Reproduction Steps
1. Run the attached sample. Performance.zip
2. Load the PDF document by clicking the Choose File Option. jp2-scan-1page.pdf
3. Click "Render Page - 100% Zoom" and observe the rendering time in the browser console.
4. Repeat the test for:
○ 200% Zoom
○ 300% Zoom
○ 400% Zoom
5. Compare the image retrieval/rendering times for each zoom level.

Questions
1. Does PDFium provide any recommended approach for improving image retrieval performance?
2. Is there a more efficient way to generate high-resolution images while maintaining image quality?

Lei Zhang

unread,
Jul 23, 2026, 1:56:54 AM (2 days ago) Jul 23
to CHINNAMUNIA KARTHIK C, pdfium
Reply to questions:
1. Is this a general question or a question about this particular PDF?
2. ^

Just as yet another kind reminder, this mailing list generally isn't
going to deal with WASM blobs.
> --
> You received this message because you are subscribed to the Google Groups "pdfium" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pdfium+un...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/pdfium/f23aaf80-d032-4563-b089-d2afa30880f9n%40googlegroups.com.

geisserml

unread,
Jul 23, 2026, 5:50:59 AM (2 days ago) Jul 23
to pdfium
This seems to me to be virtually the same as [1], oversized pages again.
With a usual scale like 3, the output dimensions I get with jp2-scan-1page.pdf is 15,750 × 20,250px (~13MiB jpeg).
It is really not surprising that processing this takes longer than a usual A4 page, e.g. ~1,800 × 2,500px (250KiB jpeg).

Also, in [1] it was mentioned that there is some caller-side base64 encoding going on.
Perhaps the OP can provide some numbers how much time is spent on rendering and encoding each, to check how the encoding may or may not affect overall performance.
Reply all
Reply to author
Forward
0 new messages