Closed Bug 1524640 Opened 5 years ago Closed 5 years ago

PDF on ChinesePrintables.com displays glyphs instead of text

Categories

(Firefox :: PDF Viewer, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
Firefox 67
Tracking Status
firefox66 --- verified
firefox67 --- verified

People

(Reporter: mcomella, Assigned: bdahl)

References

Details

Attachments

(2 files)

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.

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

See Also: → 1522281, 1523991, 1518473

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

Assignee: nobody → bdahl
Pushed by bdahl@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ba40138a6d39
Fix font loading during mozPrintCallback. r=smaug
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 67

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

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

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

Flags: needinfo?(bdahl)

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?

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

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]

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

Will get back to check on Beta.

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+

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

(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]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: