New issue
Advanced search Search tips

Issue 832485 link

Starred by 1 user

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 3
Type: Bug



Sign in to add a comment

Printing to PDF results in no selectable text for some fonts

Reported by dan...@nuix.com, Apr 13 2018

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36

Steps to reproduce the problem:
1. Install the provided font
2. Open the provided HTML file
3. File>Print...
4. Click "Open PDF in Preview"
5. Select the text, "Hi there, apparently I'm a bad font."
6. Try to copy the text to the clipboard and paste into a text editor

What is the expected behavior?
The text should be stored in the PDF, so copying the selection should put the text on the clipboard.

What went wrong?
No text ends up in the PDF other than the headers and footers.
(Attached a sample result)

Also, you can see visually from how it's being selected - it's like it's being rendered as graphics without marking the original text.

Did this work before? N/A 

Chrome version: 65.0.3325.181  Channel: stable
OS Version: OS X 10.13.4
Flash Version: 

If you do the same series of steps using Safari instead, you can select the text in the PDF and it copies out correctly.
 
eir-example.html
198 bytes View Download
eir-regular-web.ttf
55.9 KB Download
eir-example.pdf
31.1 KB Download
Components: Internals>Plugins>PDF
Labels: Triaged-ET M-67 Target-67 FoundIn-67 Needs-Triage-M65
Status: Untriaged (was: Unconfirmed)
Able to reproduce the issue on Mac 10.13.3 using chrome reported version #65.0.3325.181 and latest canary #67.0.3396.0. Issue is not applicable to OS-win and OS-linux.
This is a non-regression issue as it is observed from M60 old builds. 

Hence, marking it as untriaged to get more inputs from dev team.

Thanks...!!
Components: -Internals>Plugins>PDF Internals>Printing Internals>Skia>PDF
Labels: OS-Chrome OS-Linux OS-Windows
The text is not selectable in Chrome PDF Viewer, Preview or Evince, so the issue is with the PDF generation, rather than display.

Likely still applicable in other platforms, as it can be reproduced with viewers that are not OSX's Preview.
Cc: halcanary@chromium.org
The attached PDF was not produced bu Skia: /Producer (Mac OS X 10.13.4 Quartz PDFContext).

Let's see what Skia produces... It embeds that font as a type-3 font. And it's selectable.

https://github.com/HalCanary/howto-save-as-pdf
eir-example.html.pdf
7.2 KB Download
eir-example.html
74.9 KB View Download
Labels: -Pri-2 -M-67 -Target-67 Pri-3
What the bug reporter is probably doing is: (a) Printing with the system dialog, or choosing "Open PDF in Preview" from Chrome Print Preview. This produces unselectable fonts.

What Hal described is: (b) Using Chrome Print Preview with the "Save As PDF" destination. This produces selectable fonts.

With Safari, (c) printing with the system dialog works correctly and produces selectable fonts.

One interesting thing is, one can take the output of (c), open it in Preview.app, and (d) print it to PDF again. This produces selectable fonts.

If instead, one takes the output of (b), open it in Preview.app, and (e) print it to PDF again. This produces unselectable fonts. Just like (a).


This may be a bug in Quartz. Safari somehow knows how to avoid it, whereas Chromium does not. Hal, WDYT?
I don't understand what happens to the PDF when it leaves SkPDF.
Sure, but we can treat Quartz as a black box, and see how it reacts to the Safari output vs SkPDF output.

Sign in to add a comment