Closed Bug 1335712 Opened 7 years ago Closed 4 years ago

pdfjs printing in Hebrew/Arabic is messed up

Categories

(Firefox :: PDF Viewer, defect)

52 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
81 Branch
Tracking Status
firefox52 --- wontfix
firefox54 --- affected

People

(Reporter: sh.yaron, Unassigned)

References

Details

Attachments

(11 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:52.0) Gecko/20100101 Firefox/52.0
Build ID: 20170130065342

Steps to reproduce:

I opened a pdf file using Firefox, then I clicked the printing button and I got a completely messed up page.


Actual results:

The letters were in the correct oreder but completely misaligned for their designated space.


Expected results:

The printing should have looked like the pdf exactly.
Attached file The original document
Attached image The printed document
I can reproduce this issue on my side. (Nightly on Linux)

Please note that there is clear indication about potential issues when viewing the file, but while it is displayed well on screen, printing the file to a real printer (as Yaron did) or a PDF writer caused this behavior.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Component: Untriaged → PDF Viewer
Comment on attachment 8832434 [details]
The PDF printed from withing pdfjs (instead of printing)

Please note that the original document and the printed one are using different fonts.
Attachment #8832434 - Attachment description: The PDF saved from withing pdfjs (instead of printing) → The PDF printed from withing pdfjs (instead of printing)
I am attaching another document from different authority. This one is document form 501 [1] from Israeli National Insurance (ביטוח לאומי). The printed result is on the next attachment. 

1: https://www.btl.gov.il/%D7%98%D7%A4%D7%A1%D7%99%D7%9D%20%D7%95%D7%90%D7%99%D7%A9%D7%95%D7%A8%D7%99%D7%9D/Documents/t501.pdf
Steps to reproduce:
a. I've taken the attachment 722960 [details] from bug 849404 which is text/plain and printed it directly from within the browser. The produced PDF is accurate with the text/plain content displayed in the browser. (attached)
b. Then I've opened the produced PDF file directly in the browser, which displayed well, and printed the file again. 
c. The produced file from pdfjs is not accurate with the previous produced PDF file.
I've created an animation to demonstrate how it affect multiple re-prints. The first frame is the original documents, from there you can see how the characters are misaligned. It looks like a rendering issue to me.
Too late for firefox 52, mass-wontfix.
Testing with Firefox 58 and printing to PDF it looks good to me. There were some fixes in Firefox 53 (bug 1311512), could you retry?
Flags: needinfo?(sh.yaron)
Tested again with 57b6, same results, thank you.

Can you please post your results so I can see what is your definition of a well formed document :) ?
Flags: needinfo?(sh.yaron)
Your results seem surprisingly good, I'm wondering what might cause this.

In the meanwhile I conducted the same checks on Arabic and the text is completely unreadable.
Attached file Arabic printed PDF
Summary: pdfjs printing in Hebrew is messed up → pdfjs printing in Hebrew/Arabic is messed up
(In reply to Yaron Shahrabani from comment #14)
> Your results seem surprisingly good, I'm wondering what might cause this.
> 

Maybe an extension or config setting? Could you try with a clean profile? https://support.mozilla.org/en-US/kb/profile-manager-create-and-remove-firefox-profiles
Flags: needinfo?(sh.yaron)
I just tried with Linux and it's working fine, I only encounter this problem on mac.
Tried again with Mac OS Sierra 10.12.6 and Firefox 58.0a1 (Nightly), Still happens.

Earlier I did the exact same process on Linux (Without creating a new profile or changing anything) and the document came out of PDF printing as expected.
Flags: needinfo?(sh.yaron)
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE

Still an issue. Bug 1524640 did not fix this.

Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---

I noticed this was only tested on Linux and Mac, so I wanted to add that I see the same problem on Windows. At home I have Windows 8.1, and at work I have Windows 10. In both of them characters overlap in the print output. I can provide printer driver info if needed.

(In reply to Tsahi Asher from comment #22)

I noticed this was only tested on Linux and Mac, so I wanted to add that I see the same problem on Windows. At home I have Windows 8.1, and at work I have Windows 10. In both of them characters overlap in the print output. I can provide printer driver info if needed.

I'm not sure the driver is necessary because we are seeing this behavior throughout different operating systems and various printers so I'm not sure it's relevant to the case.

Furthermore, you can see those glitches even when exporting to PDF and that has nothing to do with the printer itself.

Thank you!

FWIW, I took a look with Itiel, and turns out that this is somehow dependent on the nightly language. As in, if I use an en-US nightly, then stuff works fine. If I download a Nightly in hebrew, then I can see the metrics getting messed up.

Brendan, I wonder if the computed language in pdf.js vs. in the print document is different, which I guess could cause us to choose different fonts... Does that sound plausible? I only have superficial knowledge of how pdf.js prints :)

Flags: needinfo?(bdahl)

A potential fix landed in bug 1658934, so it would be most helpful if those affected by this bug could test in the latest Nightly and report if this is fixed now.

Both the original reporter and I can confirm the issue is fixed, by testing the attached documents.

(In reply to Itiel from comment #26)

Both the original reporter and I can confirm the issue is fixed, by testing the attached documents.

Thank you!

Status: REOPENED → RESOLVED
Closed: 5 years ago4 years ago
Depends on: 1658934
Resolution: --- → FIXED
Target Milestone: --- → 81 Branch
Flags: needinfo?(bdahl)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: