Evince: Unable to zoom in 40 MB PDF page

I have enough RAM (32 GB) and a powerful laptop (Intel 12th gen), but I am unable to zoom into PDF file (of 40 MB), evince won’t let me. What can I do?

Nothing much is running on my laptop, just Fedora 41 and most of the RAM is not utilized!

This is the URL to PDF (hosted on the Governement of India Website):

You don’t say what steps you are taking to zoom in on the pdf.
I’m using Firefox with Debian 12 with the following spec to open your link:


and using the zoom tool in the centre of the pdf window top bar I was able to select a zoom of 400%

and it performs perfectly well as you can see.

@graham It is mentioned in the original post that this is about Evince and not about Firefox, so your solution is not applicable.

OK so I opened it in Evince directly and it went as high as 46.3% resolution with the PC specs I listed.

You still haven’t said what your machine specs are as that may be significant.

My first comment was indeed a solution, the second an observation.
It seems you can’t accept possible alternatives which can only lead to a belief that you original post was nothing more than just a rant and you weren’t expecting other members of this forum to give their time trying to address your issue.
:angry:

You can try increasing the default evince cache size (50 MB) using the following command.

To set cache size of 500 MB, run:

$ gsettings set org.gnome.Evince page-cache-size 500

For more details, refer the following issue:

1 Like

FWIW, you can also try the 'Papers' app (which is fork of 'Evince' with upgrades and new features). 'Papers' is still in development, but I guess should be fine for common use cases.

You can install the app from Flathub.

Now I am able to zoom to 146.4% but not beyond that.

Increasing the page cache size should allow more zoom.

Do we need more than 500 MB of RAM to display 40 MB of PDF file? I am confused as it is the same amount of data that needs to be displayed and the contents of file don’t change. Why even 10 times of the RAM not sufficient to display the file?

Do other PDF readers also have same constraints?

I’m not sure about the internals as I’m not an 'Evince' developer, but I’ve noticed that opening a 20 MB JPEG XL file in GIMP uses lot more memory (much > 20 MB). One might argue that 'gimp' is an editor (which might need more data structures to handle editing), while 'Evince' is just a viewer.

Tiled rendering is the recommended solution to the 'Evince' memory issue as mentioned here.

Do other PDF readers also have same constraints?

You can try and let us know.

1 Like

It depends on the PDF, but text and image data will occupy more memory than the plain PDF. A PDF file is just a list of directives that tell a viewer application how to render its contents; by necessity, the end result is going to be more complex than its description.

It contains only vector graphics of 1 page, no other images

$ wget  https://surveyofindia.gov.in/webroot/UserFiles/files/Rlwmap_Eng_04-07-2024.pdf
Saving 'Rlwmap_Eng_04-07-2024.pdf'
HTTP response 200 OK [https://surveyofindia.gov.in/webroot/UserFiles/files/Rlwmap_Eng_04-07-2024.pdf]
Rlwmap_Eng_04-07-202 100% [==================================================================================================================================================================================>]   39.10M    1.43MB/s
                          [Files: 1  Bytes: 39.10M [1.26MB/s] Redirects: 0  Todo: 0  Errors: 0                                                                                                                ]
$ pdfimages -list ./Rlwmap_Eng_04-07-2024.pdf 
page   num  type   width height color comp bpc  enc interp  object ID x-ppi y-ppi size ratio
--------------------------------------------------------------------------------------------

KDE Okular was able to go all the way upto 2500% effortlessly and quite fast, without any change!

1 Like

Evince renders the pages into a pixmap, which is kept in memory together with some other pages (previous and next ones) in order to make the transition between pages smoother.

Evince does not know how the PDF file is, it could try to gather them, but it is orthogonal to the problem here. Adding tiling support it was correctly pointed it out in Evince: Unable to zoom in 40 MB PDF file - #5 by Sid is the proper solution.

Perhaps, 50MB of cache size per page is too conservative for today’s standards. Although it is doable to to increase it, it would be only a bandaid.

2 Likes

The hint has already been provided: tile rendering in the links in previous comments (like the one accepted as solution)

Okular has support for tile rendering.

If you feel inclined in working in a patch, you can start with the drafts linked in the issues Implement tiled rendering in Evince (#394) · Issues · GNOME / evince · GitLab and Implement partial rendering of pages to decrease memory usage. (#175) · Issues · GNOME / evince · GitLab, paying attention to the comments there. You can find more inspiration in how the initial implementation in Okular works which was reported in Tiled rendering manual (albeit the code bases are different).

1 Like

As mentioned above, I ncreased the memory to 500 MB but the MB maximum zoom was 146%

This pdf has a single page with no image but only vector graphics.

I accepted the answer as you quoted. Just wanted to share with the community, that 500 MB is not enough to zoom into a 40 MB pdf file without any images but only vector graphics, it seems a bit excessive.

[…] Just wanted to share with the community, that 500 MB is not enough to zoom into a 40 MB pdf file without any images but only vector graphics, it seems a bit excessive.

First at all, it is not a 40Mb file, it is a 40Mb page. Evince renders pages, a document of 40Mb with 100 pages is different than a document with one single page of 40Mb. In the former, Evince will render some pages whereas in the latter it has to render everything.

As I said before, what matters is the rendered output. That is an image.

Last, pdfs are likely compressed documents. Hence, the page in your document is bigger than 40Mb. See for example:

% pdftk Rlwmap_Eng_04-07-2024.pdf output Rlwmap_Eng_04-07-2024-uncompressed.pdf uncompress
% ls -lh
total 164M
-rw-rw-r-- 1 gpoo gpoo 125M Dec 30 10:15 Rlwmap_Eng_04-07-2024-uncompressed.pdf
-rw-rw-r-- 1 gpoo gpoo  40M Jul  4 01:34 Rlwmap_Eng_04-07-2024.pdf

The document with one page is actually a 125Mb of vectorial data that must be rendered as an image.

In summary, the proper topic is “Evince: Unable to zoom a 40Mb page”. Otherwise, it is misleading as not all 40Mb pdfs are equal.

3 Likes

Updated title as it conveys the wrong meaning.

1 Like