2

Short story: some programs, including Okular, display blank some of the pages in a specific (1000+ pages) pdf, but other programs, including some internet browsers, display all pages without blanks.

After extracting all pages as pdf, the same happens for the same problematic pages. I have uploaded one of them on DocDroid for testing. (Please download this page and see if your Okular can see its content as seen in Firefox or Vivaldi.)

Even Android viewers handle just fine those pages/files.


Longer story:

I have a pdf of an old scanned dictionary of almost 1500 page. Okular shows me that many pages are blank. See here in overview:

enter image description here

The same in PDF Arranger:

enter image description here

That hasn't been a big surprise to me, but I thought that I could clean this dictionary by removing the blank pages either with PDF Arranger, or even simpler by extracting the pages as pdf or png, deleting the blanks (more easily to identify, select and remove than with the aforementioned tool - because of their tiny size) and then re-creating a pdf out of the remaining pages.

The extracted png files were as expected and I could easily identify the blanks: they were under 2 KiB in size. Dolphin thumbnails also showed the blank pngs, close to the images seen above.

But because I have also extracted the pages as pdf I was surprised to see that Dolphin thumbnail-view of the separate pdf pages were now without any blanks! Also, there was no noticeable difference in size between the 1-page pdfs.

Opening these 1-page suspected pdf files in Okular, they were still displayed as blank, and the same happened in Qpdfviewer and PDF Aranger, but not in WPS Pdf, Master PDF, LibreOffice-Draw and Firefox: there, the content was seen, the page was not blank.

Maybe an important detail:

the extracted blank png files (which are also tiny) are fully blank, while the problematic PDF pages (with undiminished size if extracted as PDF) when seen as blank are not fully so: A FOOTER line at the bottom is still seen, and just the rest is blank.

enter image description here

The same command was used to extract the pages as pdf and png: pdftoppm.

Now I have identified the problematic pages and can easily test.

Printing to PDF one of these files in one of the Chromium-family browsers like Vivaldi and Opera, the resulted PDF was still a blank (to Okular and the others already affected) unless the option "print as image" was selected in their settings. - If that option is selected or if print to pdf is done in Firefox, this gives as output a pdf file that is seen normally in Okular!

Testing with other programs and summing up:

  • all pages are seen by WPS PDF, Master PDF, Firefox, Vivaldi browser, LibreOffice Draw, ImageMagick, mupdf, PDF Studio Viewer

  • blanks (with that footer) are displayed in Okular, Qpdfviewer, PDF Aranger, Falkon (!), Inskape, Krita

  • Evince (Document Viewer) installed as snap in Kubuntu cannot open thelarge file, nor any of the separate pdf pages, but gives an error: Error opening file the.pdf: Permission denied (it opens other pdf files)


  • What could the problem be?

  • Can I fix this at system-level?

    Okular and Qpdfviewer are the only PDF viewers that seem affected by this (no matter the problem the files themselves might have).

I prefer to use Okular for all my pdfs.

6
  • 1
    I downloaded your example, same observation, good in firefox but blank in okular. I printed to pdf from firefox and this one is displayed correctly in okular. Interesting output from file-command, original is PDF document, version 1.7, 1 pages (zip deflate encoded) while the printed one gives PDF document, version 1.5. Cannot really help with that, but hopefully this is useful info for you.
    – mook765
    Nov 25, 2022 at 17:56
  • @mook765 - Thanks. I had already found that Firefox can fix it, I just have to print in chunks of 50-100 pages, otherwise it crashes. I have posted mostly out of curiosity, in order to learn a bit more about this stuff, I use PDF a lot. - My main concern is: why is Okular more limited than mupdf in this respect? Also: only printing to pdf in Firefox worked, not in Vivaldi for example.
    – cipricus
    Nov 25, 2022 at 23:34
  • @mook765 - not all browser can see those "blanks": Falkon can't. This seems related to KDE-specific applications.
    – cipricus
    Nov 25, 2022 at 23:44
  • @mook765 - Do you know of another tool that could give details on files like this? file gave me the same results you mention on the Firefox-printed files (1.5), but on the ones fixed because printed with Opera and Vivaldi ('as image') it gives the same as for the tricky original (1.7, zip deflate encoded)
    – cipricus
    Nov 26, 2022 at 10:09
  • No sorry. but one difference I found between okular and mupdf is, that okular uses libpoppler (rendering library) while mupdf doesn't. My guess is that all pdf-viewer which use libpoppler will have the same symptom as okular, but I didn't test it.
    – mook765
    Nov 26, 2022 at 10:43

1 Answer 1

0
  • This is a bug with poppler, posted here, initially here, Evince and Atril (Mint PDF viewer) are also affected.

  • To fix the pages I have printed them "as pdf" in Firefox (or Chrome, Vivaldi, Opera - with these 'print as image' must be selected too). Depending on RAM capacity, one shouldn't "print to pdf" more than 200-300 pages at once in order to avoid freezes/crashes.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .