Bug 455650 - Garbage Printing for PDF with form data
Summary: Garbage Printing for PDF with form data
Status: RESOLVED UPSTREAM
Alias: None
Product: okular
Classification: Applications
Component: printing (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-20 12:06 UTC by MichaelOF
Modified: 2022-07-05 21:53 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
left okular with the original file, right okular with the printed to pdf file (347.62 KB, image/png)
2022-06-20 20:39 UTC, andreas.naumann
Details
left okular with original file, right print preview (214.58 KB, image/png)
2022-06-20 20:42 UTC, andreas.naumann
Details
SourcePdfFWithFormData (876.22 KB, application/pdf)
2022-06-20 22:18 UTC, MichaelOF
Details
SourcePdfFWithFormData_CUPS-PDF-Printed_from_Okular_GARBAGED (239.01 KB, application/pdf)
2022-06-20 22:19 UTC, MichaelOF
Details
SourcePdfFWithFormData_CUPS-PDF-Printed_from_Xreader_GARBAGED (142.99 KB, application/pdf)
2022-06-20 22:19 UTC, MichaelOF
Details
Okular via flatpak (86.56 KB, image/png)
2022-06-20 22:40 UTC, MichaelOF
Details
left okular with original file, right print preview (285.38 KB, image/png)
2022-06-21 17:49 UTC, andreas.naumann
Details
left okular with original file, right print preview (314.21 KB, image/png)
2022-06-23 06:01 UTC, andreas.naumann
Details
Screenshots as requested, commented inline (477.31 KB, application/pdf)
2022-06-23 14:50 UTC, MichaelOF
Details

Note You need to log in before you can comment on or make changes to this bug.
Description MichaelOF 2022-06-20 12:06:19 UTC
Okular 20.04.2 (current OpenSUSE leap 15.3 rpm version)

STEPS TO REPRODUCE
1. Have a PDF with form data entered and saved
2. print this PDF with form date

OBSERVED RESULT

- pdf is shown in Okular correctly, with form data or without
- base pdf, without form data, is printed fine
- form data on top garbaged (form fields are printed stacked, unreadable = wrong positions)
- printed from Okular to 2 different printers (old HP Laserjet 2200d, new Xerox WorkCentre), both different print drivers: same garbaged output
- printed from same Linux/KDE Plasma box via CHROMIUM's internal PDF viewer: prints FINE
- printed same PDF with same data on same HP and Xerox printers, but with Adobe Reader on WIN10 laptop: prints FINE.

--> IMHO bug in Okular 

EXPECTED RESULT
should print correctly, WYSIWYG ;)

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: openSUSE Leap 15.3
(available in About System)
KDE Plasma Version: Plasma 5.18.6
KDE Frameworks Version: 5.76.0
Qt Version: 5.12.7

ADDITIONAL INFORMATION
This is the downloadable form: https://www.energienetze-offenbach.de/fileadmin/user_upload_eno/Dokumente/Service/220302_ENO_Ladeinfastruktur_02.03.2022.pdf
In chapter 3 there are several rows like this:
"Davon .... Ladepunkte: <numvalue1>, je <numvalue2> kW  Gesamtleistung:  <numvalue3>    kW", these "numvalues" form data are garbaged when printed
Comment 1 Albert Astals Cid 2022-06-20 18:49:24 UTC
Can you attach a screenshot of the print preview screen so I can see what you mean?
Comment 2 andreas.naumann 2022-06-20 20:39:31 UTC
Created attachment 149967 [details]
left okular with the original file, right okular with the printed to pdf file
Comment 3 andreas.naumann 2022-06-20 20:42:32 UTC
Created attachment 149970 [details]
left okular with original file, right print preview
Comment 4 andreas.naumann 2022-06-20 20:45:56 UTC
(In reply to Albert Astals Cid from comment #1)
> Can you attach a screenshot of the print preview screen so I can see what
> you mean?

Those attachments (https://bugs.kde.org/attachment.cgi?id=149967 and https://bugs.kde.org/attachment.cgi?id=149970) show a different behavior between the preview and the to-pdf-printed file. In addition, the preview is also different to the view in okular.

I have okular 20.12.3 using debian bullseye. Which backend is responsible for the printing and the preview?
Comment 5 Albert Astals Cid 2022-06-20 22:11:18 UTC
You're probably using some mega old poppler, can you try running okular from flathub and see if that helps?

https://flathub.org/apps/details/org.kde.okular
Comment 6 MichaelOF 2022-06-20 22:18:52 UTC
Created attachment 149976 [details]
SourcePdfFWithFormData
Comment 7 MichaelOF 2022-06-20 22:19:15 UTC
Created attachment 149977 [details]
SourcePdfFWithFormData_CUPS-PDF-Printed_from_Okular_GARBAGED
Comment 8 MichaelOF 2022-06-20 22:19:47 UTC
Created attachment 149978 [details]
SourcePdfFWithFormData_CUPS-PDF-Printed_from_Xreader_GARBAGED
Comment 9 MichaelOF 2022-06-20 22:21:48 UTC
(In reply to Albert Astals Cid from comment #5)
> You're probably using some mega old poppler

$ zypper se -iv poppler
Repository-Daten werden geladen...
Installierte Pakete werden gelesen...

S | Name                   | Type  | Version          | Arch   | Repository
--+------------------------+-------+------------------+--------+-------------------------------------------------------------
i | libpoppler-cpp0        | Paket | 0.79.0-3.5.1     | x86_64 | Update repository with updates from SUSE Linux Enterprise 15
    name: libpoppler-cpp0
i | libpoppler-glib8       | Paket | 0.79.0-3.5.1     | x86_64 | Update repository with updates from SUSE Linux Enterprise 15
    name: libpoppler-glib8
i | libpoppler-glib8-32bit | Paket | 0.79.0-3.5.1     | x86_64 | Update repository with updates from SUSE Linux Enterprise 15
    name: libpoppler-glib8-32bit
i | libpoppler-qt5-1       | Paket | 0.79.0-3.5.1     | x86_64 | Update repository with updates from SUSE Linux Enterprise 15
    name: libpoppler-qt5-1
i | libpoppler89           | Paket | 0.79.0-3.5.1     | x86_64 | Update repository with updates from SUSE Linux Enterprise 15
    name: libpoppler89
i | libpoppler89-32bit     | Paket | 0.79.0-3.5.1     | x86_64 | Update repository with updates from SUSE Linux Enterprise 15
    name: libpoppler89-32bit
i | poppler-data           | Paket | 0.4.9-bp153.1.14 | noarch | openSUSE OSS
    name: poppler-data
i | poppler-tools          | Paket | 0.79.0-3.5.1     | x86_64 | Update repository with updates from SUSE Linux Enterprise 15
    name: poppler-tools


Will try flatpak version next
Comment 10 MichaelOF 2022-06-20 22:40:27 UTC
Created attachment 149979 [details]
Okular via flatpak

Tried with flatpak. No base PDF doc anymore visible, only form data left. Maybe because of Wayland?
Comment 11 andreas.naumann 2022-06-21 17:49:31 UTC
Created attachment 150023 [details]
left okular with original file, right print preview

this time I used flatpack, okular version 22.04.2.

The form data in section 3 ("Ladeeinrichtungen") are at different positions compared between original (left) and print preview (right)
Comment 12 Albert Astals Cid 2022-06-22 22:31:14 UTC
I'm super confused, you both say to be using the same flatpak version but your two screenshots look totally different. that makes no sense.

MichaelOF did you *fill* the PDF in the new version or open the already filled/broken one?

 andreas.naumann@kdemail.net  i don't really see what's wrong in your last screenshot, can you put some red arrows to help me look at the correct place?
Comment 13 andreas.naumann 2022-06-23 06:01:38 UTC
Created attachment 150082 [details]
left okular with original file, right print preview

I open the original file, but show the print preview of page 1 without filling the forms.

The red areas show two examples of the differences. the text ", je" and the unit "KW" are at different positions. In the left it is right to the underline, in the right on top of the underline. The underline represents the fill form.
Comment 14 MichaelOF 2022-06-23 14:50:11 UTC
Created attachment 150096 [details]
Screenshots as requested, commented inline
Comment 15 MichaelOF 2022-06-23 14:55:11 UTC
@andreas.naumann@kdemail.net: THANKS for helping!

@aacid@kde.org: Didn't want to confuse you :) 

Colorized/marked screenshots added.

Regarding flatpal question: Both Andreas and I used the same flatpak version. But as shown in screenshot https://bugs.kde.org/attachment.cgi?id=149979, flatpak's Okular doesn't even work on my machine. I guess maybe because of Wayland, no idea, as no error msg.
Comment 16 Albert Astals Cid 2022-07-05 21:53:13 UTC
Ok, i can see the issue now.

This is not an okular issue, Okular uses poppler to handle PDF files, and specifically to convert PDF files to ps so they can be printed (yes, this is archaic and we probably shouldn't do it anymore).

If you "print" your saved pdf with pdftops and then you open the resulting ps with gs (or okular) you'll see the same issue happens.

Please open a bug upstream in poppler https://gitlab.freedesktop.org/poppler/poppler/-/issues/new?issue