PDF on ChinesePrintables.com displays glyphs instead of text

VERIFIED FIXED in Firefox 66

Status

()

defect
VERIFIED FIXED
5 months ago
3 months ago

People

(Reporter: mcomella, Assigned: bdahl)

Tracking

unspecified
Firefox 67
Points:
---

Firefox Tracking Flags

(firefox66 verified, firefox67 verified)

Details

Attachments

(2 attachments)

Expected: page prints as expected

Actual: "ChinesePrintables.com" and chinese characters on first line appears as glyphs: see attached

This works fine in Preview. I'm running FF 66.0a1 2019-01-27 on macOS 10.13.6.

Assignee

Comment 1

5 months ago

I wasn't able to reproduce at first, but then went back after being distracted by some other stuff and was able to reproduce the issue. This lead me to realize it's time based and I can now reproduce consistently...

After 30s[1] pdf.js runs a cleanup method that removes any font faces that it added to the document to save memory. When you go to print Firefox creates a static clone of document and it's fonts, but at that time all the fonts have been removed from the document. As Firefox goes through and then prints each PDF page, pdf.js does try to reload the fonts, but they are unfortunately loaded into the original document, not the static clone.

To fix this we'll need to expose a way for pdf.js to load a font into the static clone during a mozPrintCallback.

[1] https://searchfox.org/mozilla-central/rev/e62b311b2e0e02633afda2004ba4056b09fbcaa4/browser/extensions/pdfjs/content/web/viewer.js#3360

Assignee

Updated

5 months ago
See Also: → 1522281, 1523991, 1518473
Assignee

Comment 2

4 months ago

Copy fonts loaded during a mozPrintCallback into the cloned document,
so they are available during printing.

Assignee

Updated

4 months ago
Assignee: nobody → bdahl

Comment 3

4 months ago
Pushed by bdahl@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ba40138a6d39
Fix font loading during mozPrintCallback. r=smaug

Comment 4

4 months ago
bugherder
Status: NEW → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 67
Duplicate of this bug: 1523667

Comment 7

4 months ago

hello,

can you please also check bug 1524825,
maybe this has the same reason?

some chars look simular when i print the sample of 1524825 (with 65)

mfg johannes

Duplicate of this bug: 1518473

Comment 9

4 months ago

do you think you can fix in 65.0.1 and/or 66?
this a really bad bug and my collegues are ready very unhappy with this and some are printing very often pdf with FF...

johannes

Duplicate of this bug: 1524924
Duplicate of this bug: 1524367
Duplicate of this bug: 1108922
Duplicate of this bug: 1480653
Duplicate of this bug: 1196991
Duplicate of this bug: 1457324
Duplicate of this bug: 1439821
Duplicate of this bug: 1335712
Duplicate of this bug: 1357157
Duplicate of this bug: 1389677
Duplicate of this bug: 1308643
Duplicate of this bug: 1158391
Duplicate of this bug: 880181
Duplicate of this bug: 923804

Brendan, should this be considered for (at least) Beta uplift?

Flags: needinfo?(bdahl)
Assignee

Updated

4 months ago
Duplicate of this bug: 1522281
Assignee

Updated

4 months ago
Duplicate of this bug: 1523991
Assignee

Comment 27

4 months ago

Comment on attachment 9041312 [details]
Bug 1524640 - Fix font loading during mozPrintCallback. r=smaug

Beta/Release Uplift Approval Request

Feature/Bug causing the regression

Bug 1489996

User impact if declined

If a user wants to print a PDF and the PDF is not printed within 30 seconds of loading, the text will not print correctly. Given that tax season has started in the US, it'd be nice to have to fixed sooner rather than later.

Is this code covered by automated tests?

Yes

Has the fix been verified in Nightly?

Yes

Needs manual test from QE?

Yes

If yes, steps to reproduce

Follow steps in initial report, but wait more than 30s after the PDF loads to print the file. (You can print to a PDF file to test)

List of other uplifts needed

None

Risk to taking this patch

Medium

Why is the change risky/not risky? (and alternatives if risky)

There are some platform printing changes, but the new code path is only allowed for PDF.js.

String changes made/needed

Flags: needinfo?(bdahl)
Attachment #9041312 - Flags: approval-mozilla-beta?
Assignee

Comment 28

4 months ago

Also, patch applies cleanly to beta and is looking good on try run:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=dea73a6d47533b93e78080ac523bc2e1ebbaf4ff

Flags: qe-verify+

Comment on attachment 9041312 [details]
Bug 1524640 - Fix font loading during mozPrintCallback. r=smaug

Seems worth a try, especially considering the point about tax season.
It would still be nice to have QE verify on nightly.

Attachment #9041312 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Whiteboard: [qa-triaged]

Comment 31

4 months ago

Verified as fixed on the latest Nightly 67.0a1 (2019-02-25)

Will get back to check on Beta.

Comment 32

4 months ago

Hi,

I've verified this issue on Windows 10 / Mac OS 10.13 / Ubuntu 18.04.1 using Firefox Beta 66b11(20190225143245) as well and it is fixed.

Status: RESOLVED → VERIFIED
Flags: qe-verify+

Comment 33

4 months ago

However bugs which are marked at dups still don't work, eg 1523991, 1523667, 1524367.

67.0a1 (2019-02-25) (64 bits) Macos 10.13.3

I am reporter of 880181, similar issues. total corruption of printed documents

Assignee

Comment 34

4 months ago

(In reply to AM from comment #33)

However bugs which are marked at dups still don't work, eg 1523991, 1523667, 1524367.

67.0a1 (2019-02-25) (64 bits) Macos 10.13.3

I am reporter of 880181, similar issues. total corruption of printed documents

Thanks for bringing this up. Those bugs were mistakenly lumped into this bug fix. I've opened a new bug to address those as well (bug 1530881).

QA Whiteboard: [qa-triaged]
Whiteboard: [qa-triaged]
Duplicate of this bug: 1534067
You need to log in before you can comment on or make changes to this bug.