[okular] [Bug 442280] New: Okular does not take /UserUnit into account (page size incorrect)

Manuel Geißer bugzilla_noreply at kde.org
Fri Sep 10 20:52:45 BST 2021


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

            Bug ID: 442280
           Summary: Okular does not take /UserUnit into account (page size
                    incorrect)
           Product: okular
           Version: 21.08.1
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: PDF backend
          Assignee: okular-devel at kde.org
          Reporter: geisserml at gmail.com
  Target Milestone: ---

Created attachment 141453
  --> https://bugs.kde.org/attachment.cgi?id=141453&action=edit
userunit_10.pdf

SUMMARY
[PDF background]
In the PDF format, coordinates are given in PDF points, where by default 1
point is equivalent to 1/72 of an inch (1in -> 2.54cm). However, PDFs can
define custom units on a per-page basis, using the /UserUnit key.
/UserUnit is a float or decimal that scales the default conversion fraction of
1/72, so for a /UserUnit of 10, 1pt would mean 10/72in.

[What Okular does]
It seems that Okular (like many other open-source PDF software) does not take
/UserUnit into account for the displayed page size.
The attached test document `userunit_10.pdf` defines a /UserUnit of 10.
The document's /MediaBox looks like this:
```python3
[ Decimal('0.0'), Decimal('0.0'), Decimal('1785.6'), Decimal('1785.6')
```
Now the default conversion with 1pt -> 1/72in returns 630x630mm, which is what
Okular displays. However, this is incorrect. In reality, the size is 6300mm, 10
times larger!
(In particular, /UserUnit is used by Adobe Illustrator and possibly other PDF
software to circumvent the maximum number of 14400pt imposed by Adobe Reader
and some other PDF renderers.)

STEPS TO REPRODUCE
1. Open the attached file in Okular
2. Go to File -> Properties
3. See the displayed page size
4. Inspect the document with the pikepdf python library, or and other PDF
library of your choice
5. Print the /MediaBox and /UserUnit of page 0

OBSERVED RESULT
Displayed page size is too small by factor 10.

EXPECTED RESULT
Displayed page size should always reflect the real page size and take /UserUnit
into account.

Operating System: KDE neon 5.22
KDE Plasma Version: 5.22.5
KDE Frameworks Version: 5.85.0
Qt Version: 5.15.3
Kernel Version: 5.11.0-34-generic (64-bit)
Graphics Platform: Wayland

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Okular-devel mailing list