Bug 451567 - Text annotations made in Okular are not correctly displayed when the resulting PDF file is opened with other PDF readers
Summary: Text annotations made in Okular are not correctly displayed when the resultin...
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: PDF backend (show other bugs)
Version: 21.12.3
Platform: Flatpak Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-16 11:31 UTC by Mikael
Modified: 2022-03-18 22:08 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Sample PDF annotations made/viewed in Okular and also viewed in pdf.online web-app (237.19 KB, image/png)
2022-03-16 11:31 UTC, Mikael
Details
sample PDF file (16.52 KB, application/pdf)
2022-03-17 13:29 UTC, Mikael
Details
sample PDF file annotated with Okular (36.53 KB, application/pdf)
2022-03-17 13:30 UTC, Mikael
Details
screen-shot from Okular when viewing the annotated sample pdf file (289.84 KB, image/png)
2022-03-17 13:31 UTC, Mikael
Details
screen-shot from pdf.online web-app when viewing the annotated sample pdf file (320.62 KB, image/png)
2022-03-17 13:31 UTC, Mikael
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mikael 2022-03-16 11:31:44 UTC
Created attachment 147525 [details]
Sample PDF annotations made/viewed in Okular and also viewed in pdf.online web-app

SUMMARY
Text annotations made in Okular are not correctly displayed when the resulting PDF file is opened with other PDF readers with support for annotations, such as the free (as in free beer) web-app at pdf.online (powered by PDFTRON) or Acrobat reader.

STEPS TO REPRODUCE
1. Open a PDF document with landscape format (such as A3 landscape).
2. Add text annotations with typewriter and inline note tools.
3. Save the annotated PDF file.
4. Open the resulting PDF file in another PDF reader with well functioning annotation tools, such as the free (as in free beer) web-app at pdf.online (powered by PDFTRON) or Acrobat reader.

OBSERVED RESULT
1. All text annotations are rotated as if Okular can only save annotations with portrait format rotation. But they will be correctly rotated if re-opened again in Okular, as if Okular rotates its own annotations internally in a non-stadard-compliant way.
2. Typewriter text have lost its defined color and be all-black colored. But the Typewriter text will have maintained its correct color if re-opened in Okular, as if Okular saves the Typewriter text color in a non-standard compliant way compared to how free text annotations are supposed to be saved.
3. Typewriter text will have lost its formatting so that some of the text will not be visible if the text is more than a few words or if it contains line breaks. But the Typewriter text will have maintained its correct formatting if re-opened in Okular, as if Okular saves the Typewriter text formatting in a non-standard compliant way compared to how free text annotations are supposed to be saved.

EXPECTED RESULT
Text annotations made in Okular should maintain its visual appearance when opened in other PDF readers with support for annotations.

SOFTWARE/OS VERSIONS
Linux/Debian Buster
Okular installed as Flatpak from Flathub.
Okular Version 21.12.3
KDE Frameworks Version 5.92.0
Qt Version 5.15.3 (built against 5.15.3)
Using Poppler 22.03.0
Comment 1 Albert Astals Cid 2022-03-16 22:53:27 UTC
Can you please attach the original pdf (without the annotation) and the one with the annotation?
Comment 2 Mikael 2022-03-17 13:28:57 UTC
@Albert Astals Cid: Thank you for looking into my bug repport!

My testing suggests rotation issues of Typewriter and Inline note annotations was resolved after upgrading my computer yesterday. I can not reproduce rotation issues anymore.
Maybe some of my testing was on Okular 21.08 in the morning and the Flatpak was then upgraded to 21.12.3 during the day, but I am not sure.

Issues that I can still reproduce are:
- Changing annotation text font face in Okular does not actually change the font face (only the font size can be changed).
- Changing the Typewriter annotation text font color in Okular only changes the color when viewing in Okular, but in other viewers the text color is always black.
- The top padding in text annotation objects is to small in Okular and the result is that non-english characters (with something above the actual character) are cropped on the first line.
  This seems to be a display-only issue in Okular because in other viewers (with decent padding) the same text annotations displays correctly on the first line.
- Okular generally creates to little padding around its text objects, because text annotations from Okular is often cropped at the end of the lines when viewed in another viewer. Multi line text annotations are often cropped at the bottom as well.
  This is possibly also triggered due to Okular failing to use the selected annotation font face (or to attach the annotation font with the PDF) because if the annotation text is made bigger in Okular, then it will still be shown with a (default?!) font size in other viewers (while the text containing box remains the same size) and the lines will not be cropped at the end anymore.

I will attach the original and the annotated PDF i used for testing today. I will also attach two screen-shots of the annotated pdf; one from viewing it in Okular and one from viewing it with the https://pdf.online/ web-app. Note that my testing shows that the display in the pdf.online web-app is very similar to the display in Adobe Acrobat reader. Exactly the same issues are present when viewing the annotated PDF from Okular in both these other viewers; the text objects are even cropped at exactly the same places.
Comment 3 Mikael 2022-03-17 13:29:44 UTC
Created attachment 147552 [details]
sample PDF file
Comment 4 Mikael 2022-03-17 13:30:03 UTC
Created attachment 147553 [details]
sample PDF file annotated with Okular
Comment 5 Mikael 2022-03-17 13:31:06 UTC
Created attachment 147554 [details]
screen-shot from Okular when viewing the annotated sample pdf file
Comment 6 Mikael 2022-03-17 13:31:29 UTC
Created attachment 147555 [details]
screen-shot from pdf.online web-app when viewing the annotated sample pdf file
Comment 7 Albert Astals Cid 2022-03-18 22:08:14 UTC
Good, so this is fixed, so i'm going to close this.

For the rest of the things you mention, please look in bugzilla if they exist already (i am almost sure they do) and if not, create one bug per issue, if you bundle more than one report in a bug it's impossible to manage.