[dolphin] [Bug 445641] New: PDF preview does not take CropBox into account

geisserml bugzilla_noreply at kde.org
Wed Nov 17 10:39:06 GMT 2021


https://bugs.kde.org/show_bug.cgi?id=445641

            Bug ID: 445641
           Summary: PDF preview does not take CropBox into account
           Product: dolphin
           Version: 21.08.3
          Platform: Neon Packages
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: panels: information
          Assignee: dolphin-bugs-null at kde.org
          Reporter: geisserml at gmail.com
                CC: kfm-devel at kde.org
  Target Milestone: ---

Created attachment 143659
  --> https://bugs.kde.org/attachment.cgi?id=143659&action=edit
PDF with CropBox

SUMMARY
The preview for PDF documents on the information panel of Dolphin misses to
take the /CropBox parameter of PDF documents into account. A CropBox can be
used to cut off borders from a PDF page. It is widely used and part of the core
PDF standard since the very beginning (cf. PDF RM 1.7, p. 77). While Okular and
Gewnview correctly apply CropBox as view area, the Dolphin preview renderer
does not.

STEPS TO REPRODUCE
1. Go to a folder that contains a PDF where the first page has a CropBox. (You
might want to use the attached document.)
2. Focus the file so the first page appears in the preview
3. Open the file with Okular or Gwenview
4. Compare the images

OBSERVED RESULT
In Dolphin, the PDF is displayed with a border that is not shown in
Okular/Gwenview.

EXPECTED RESULT
The PDF should look the same in Dolphin preview as it does in PDF viewers, i.
e. the Dolphin preview should take CropBox into account.

SOFTWARE/OS VERSIONS
Operating System: KDE neon 5.23
KDE Plasma Version: 5.23.3
KDE Frameworks Version: 5.88.0
Qt Version: 5.15.3
Kernel Version: 5.11.0-40-generic (64-bit)
Graphics Platform: Wayland
Graphics Processor: Mesa DRI IntelĀ® HD Graphics 4000

ADDITIONAL INFORMATION
Assuming you are using something Poppler-like to render the PDF, you might have
to set a "use cropbox" parameter to true. For pdftoppm, this would be the
`-cropbox` flag, for example.
I'm not sure how the PDF preview is currently implemented, but maybe you could
just use a classical QImage like Gwenview does, instead of an external
renderer. The Qt PDF Plugin seems to correctly take CropBox into account. This
will require the `qt5-image-formats-plugin-pdf` package to be installed,
though.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the kfm-devel mailing list