Issue 1208 in pdfium: Printing a PDF in Chrome on a PDF printer does not produce a PDF with correct text information

43 views
Skip to first unread message

t… via monorail

unread,
Dec 20, 2018, 8:41:01 AM12/20/18
to pdfiu...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 1208 by t...@pdf24.org: Printing a PDF in Chrome on a PDF printer does not produce a PDF with correct text information
https://bugs.chromium.org/p/pdfium/issues/detail?id=1208

Printing a PDF with Chrome on a PDF printer like PDF24, produces a PDF with garbled text information.

How to reproduce:

1. Install a PDF printer like the PDF24 Creator (https://en.pdf24.org/)
2. Open a PDF in Chrome like the attached one.
3. Print the PDF on the PDF printer
4. Save the printed file as a PDF.
5. Open this created PDF in a PDF reader, select and copy text and paste this text into an text editor. The copied text is wrong and garbled.

This is really bad. Not only the text is not copyable, you also can not search for text in the PDF. The whole text information is incorrect.

Attachments:
testfile.pdf 200 KB

--
You received this message because:
1. The project was configured to send all issue notifications to this address

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

thes… via monorail

unread,
Dec 21, 2018, 2:49:38 PM12/21/18
to pdfiu...@googlegroups.com

Comment #1 on issue 1208 by the...@chromium.org: Printing a PDF in Chrome on a PDF printer does not produce a PDF with correct text information
https://bugs.chromium.org/p/pdfium/issues/detail?id=1208#c1

For future references, when you have Chrome/Chromium printing issues, file them in the chromium project, not pdfium.

t… via monorail

unread,
Dec 21, 2018, 6:39:43 PM12/21/18
to pdfiu...@googlegroups.com

Comment #2 on issue 1208 by t...@pdf24.org: Printing a PDF in Chrome on a PDF printer does not produce a PDF with correct text information
https://bugs.chromium.org/p/pdfium/issues/detail?id=1208#c2

The is a pdfium issue and not a Chromium one. The problem sits in the pdfium library. Actually, I use the pdfium library as component in the PDF24 Reader and there we found this issue. Then I thought, that this could be a PDF24 specific bug, but I could reproduce it with Chrome. Therefore this is a bug in pdfium.

thes… via monorail

unread,
Jan 31, 2020, 7:42:54 PM1/31/20
to pdfiu...@googlegroups.com

Comment #3 on issue 1208 by the...@chromium.org: Printing a PDF in Chrome on a PDF printer does not produce a PDF with correct text information
https://bugs.chromium.org/p/pdfium/issues/detail?id=1208#c3

A similar issue came up today: https://groups.google.com/d/topic/pdfium/4FaQy6cEaUQ/discussion

To copy and paste:

Try turning on the "pdf_use_win32_gdi" GN build option, rebuild, and then call FPDF_SetPrintTextWithGDI(true) before rendering. The code probably does not work 100% correctly which is why it's been sitting in an experimental state.

km… via monorail

unread,
Mar 30, 2020, 1:46:54 PM3/30/20
to pdfiu...@googlegroups.com
Updates:
Labels: Needs-Feedback

Comment #4 on issue 1208 by km...@chromium.org: Printing a PDF in Chrome on a PDF printer does not produce a PDF with correct text information
https://bugs.chromium.org/p/pdfium/issues/detail?id=1208#c4

Have you had a chance to try the pdf_use_win32_gdi option?

thes… via monorail

unread,
Apr 30, 2020, 2:31:22 PM4/30/20
to pdfiu...@googlegroups.com

Comment #6 on issue 1208 by the...@chromium.org: Printing a PDF in Chrome on a PDF printer does not produce a PDF with correct text information
https://bugs.chromium.org/p/pdfium/issues/detail?id=1208#c6

Since the bug reporter didn't try yet, I tried flipping on the printing with GDI flag in Chrome. I get the same results either way, with garbled text.

Then again, printing from Acrobat Reader also results in (different) garbled text. Which raises the question, can any PDF viewer on Windows print to the PDF24 virtual printer and get non-garbled text?

t… via monorail

unread,
Apr 30, 2020, 5:44:43 PM4/30/20
to pdfiu...@googlegroups.com

Comment #7 on issue 1208 by t...@pdf24.org: Printing a PDF in Chrome on a PDF printer does not produce a PDF with correct text information
https://bugs.chromium.org/p/pdfium/issues/detail?id=1208#c7

I also played with FPDF_SetPrintTextWithGDI, but had no luck, text was garbled. My test with printing in Acrobat was good, text information was correct and the copied text was ok.
Reply all
Reply to author
Forward
0 new messages