I get a very strange behaviour in Dolphin when dealing some PDF files (I do not yet know why just some of them). The preview shows an image that is larger than the actual page, with a big white area. I tried to split the PDF (pdftk burst) and the thumbnails of some of them have the same problem. When opening the PDF with Okular, Gimp or other programs everything works perfectly. The attached URL shows 2 examples of this behaviour. In the first one the image is also surrounded by a white border which is invisible in Gimp or Okular. I found kdegraphics-thumbnailers.git and tried the gs cmdline directly in bash. The problem is probably there since the resulting PNG contains the white area. Since the PDF is copyrighted I cannot post it but I got plenty of PDFs, mostly commercial ones, that behave this way. Reproducible: Always Steps to Reproduce: 1. Open Dolphin with PDF thumbnails active 2. Browse the PDF file directory Actual Results: PDF thumbnail contains white areas Expected Results: PDF thumbnail shall be the same as shown by Okular I'm available to send the PDFs with this problem.
Thanks for the bug report. I guess that means that you did not find any useful info in the thumbnailer code (see [1]) ? Since the thumbnailer is not part of Dolphin, this is most likely not a Dolphin bug (unless the thumbnails in FolderView and the file dialog in, e.g., KWrite look different), so I'll reassign. [1] http://lists.kde.org/?t=140361031200001&r=1&w=2
(In reply to comment #0) > I found kdegraphics-thumbnailers.git and tried the gs cmdline directly in > bash. The problem is probably there since the resulting PNG contains the > white area. In that case, it would be awesome if you could either find better command line arguments for gs, or propose another method that can be used to create better PDF thumbnails. Please note that kdegraphics-thumbnailers.git has not seen any real commits in years, so it seems that it's basically unmaintained, and thus, it seems unlikely that anyone will read this report and fix it :-(
Ok, I'll try to check the code and the gs command line. It's a pity that such a component is left there unmaintained...
It turn out that the problem is in the way the PDF boxes are managed by the thumbnailer. The "wrong" PDFs have a MediaBox which is larger that the TrimBox, as it may happen since MediaBox is used to specify the whole page size, to issue cropping inaccuracies etc. Many PDFs just specify MediaBox and TrimBox the same size (when not intended for printing, probably) and everything works perfectly in that case. How does oKular deal with PDF boxes? Does it show the content of the TrimBox? The "gs" command used in the thumbnailer may be corrected with "-dUseTrimBox", which in my case returns a perfect preview. May someone help me in fixing the bug? I mean testing, reviewing, committing, etc? I never did a fix on the KDE codebase ;)
Thanks for investigating the problem! (In reply to comment #4) > How does oKular deal with PDF boxes? Does it show the content of the TrimBox? I don't know, sorry. You would have to ask on the Okular mailing list https://mail.kde.org/mailman/listinfo/okular-devel > May someone help me in fixing the bug? I mean testing, reviewing, > committing, etc? I never did a fix on the KDE codebase ;) Yes, sure! Patch review usually takes place at https://git.reviewboard.kde.org/ Probably the 'kdegraphics' group should be added to any review request concerning the thumbnailers. For testing, it would be best if a PDF with which the problem can be reproduces was available publicly.
TrimBox is the wrong box to use, cropbox is what you want when showing a pdf in screen as http://www.prepressure.com/pdf/basics/page-boxes says
This works for me using the latest version of kdegraphics-thumbnailers, and by browsing the code, I see why: it is indeed using CropBox now.