Closed Bug 1698414 Opened 3 years ago Closed 2 years ago

error on print base64 pdf with images with thermal printer

Categories

(Firefox :: PDF Viewer, defect)

Firefox 86
defect

Tracking

()

RESOLVED WORKSFORME
Tracking Status
firefox-esr78 --- unaffected
firefox86 --- unaffected
firefox87 --- unaffected
firefox88 + fixed
firefox89 + fixed

People

(Reporter: ivan.altamirano, Assigned: emilio)

References

(Regressed 1 open bug, Regression)

Details

(Keywords: regression, Whiteboard: [pdfjs-printing])

Attachments

(7 files)

Attached video 2021-03-14 22-15-37.mkv

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:86.0) Gecko/20100101 Firefox/86.0

Steps to reproduce:

Load a PDF from the server. The server provides the file in Base64 format.
Firefox displays the PDF file; however, when you try to print, the printer prints just a part of the images.

Actual results:

Print paper displays just a part of the images. If you download the file and print it from Adobe Acrobat Reader, the printer prints the file in the right way.

Expected results:

PDF.js should print the file in a right manner.

The Bugbug bot thinks this bug should belong to the 'Core::Printing: Output' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → Printing: Output
Product: Firefox → Core
Attached file Example Document

This file was generated by the recorded process (into the other attached file). Please, try to print directly from the Firefox, Adobe Acrobat reader, and Chrome Browser. The last two will print in the right manner the file; however, Firefox will print the images (logo and barcode) split.

What is the output paper size of your printer so that we can try to reproduce it?

Flags: needinfo?(ivan.altamirano)

Also, if you could check if this reproduces on a build from https://nightly.mozilla.org, that'd be super-helpful.

Attached file GitHub Pull Request
Assignee: nobody → emilio
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

So I took a closer look and I think I see what's going on. The attached PR should fix it.

Component: Printing: Output → PDF Viewer
Product: Core → Firefox

[Tracking Requested - why for this release]: Bug 1699313 improved similar cases for under-sized pages, see bug 1693989, bug 1698136, but it regressed this (arguably way less common) case. It'd be nice to not ship that regression.

(In reply to Emilio Cobos Álvarez (:emilio) from comment #3)

What is the output paper size of your printer so that we can try to reproduce it?

Hello Emilio,

Paper size 80mm like this printer:
https://www.aliexpress.com/item/2019658459.html

Flags: needinfo?(ivan.altamirano)

(In reply to Emilio Cobos Álvarez (:emilio) from comment #4)

Also, if you could check if this reproduces on a build from https://nightly.mozilla.org, that'd be super-helpful.

I've printed the same file as I attached, and I got the same error on Nightly Build (2021.03.26). Please, check the new attached file.

Flags: needinfo?(emilio)

(In reply to ivan.altamirano from comment #8)

Paper size 80mm like this printer:
https://www.aliexpress.com/item/2019658459.html

Thanks Ivan. Is it that specific printer model? I might be able to get that and reproduce the bug here.

Flags: needinfo?(emilio) → needinfo?(ivan.altamirano)

(In reply to Emilio Cobos Álvarez (:emilio) from comment #11)

(In reply to ivan.altamirano from comment #8)

Paper size 80mm like this printer:
https://www.aliexpress.com/item/2019658459.html

Thanks Ivan. Is it that specific printer model? I might be able to get that and reproduce the bug here.

You can find in Google:
dinon thermal receipt printer 9321

I could not find any site in English sorry, You should use a translator to find specs

Flags: needinfo?(ivan.altamirano)

NI was for a cherry-pick patch we can apply to 88.

We'll still need a new pdf.js update bug to pick up Emilio's fix for 89+, but attached is a cherry-pick patch for Beta anyway.

Depends on: 1702796

Comment on attachment 9213351 [details]
Bug 1698414 - Improve rendering of oversized pages. r=bdahl

Beta/Release Uplift Approval Request

  • User impact if declined: Some PDF pages that are too big for the target destination won't show up completely.
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: No
  • Needs manual test from QE?: Yes
  • If yes, steps to reproduce: print preview the attachment in this bug to A4 for example. May be worth checking also other prints from bug 1693989 to ensure we also don't change the undersized page case.
  • List of other uplifts needed: none
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Relatively straight-forward CSS change in pdf.js
  • String changes made/needed: none
Attachment #9213351 - Flags: approval-mozilla-beta?
Flags: qe-verify+

Comment on attachment 9213351 [details]
Bug 1698414 - Improve rendering of oversized pages. r=bdahl

Approved for 88.0b7.

Flags: needinfo?(bdahl)
Attachment #9213351 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED

Let's reopen because I still need to check the issue with the thermal printer, which may have a different root cause...

Status: RESOLVED → REOPENED
Resolution: FIXED → ---

Emilio,

I got the same error on this version of Firefox Nightly. (Updated today).

Flags: needinfo?(emilio)
QA Whiteboard: [qa-triaged]

(In reply to ivan.altamirano from comment #21)

I got the same error on this version of Firefox Nightly. (Updated today).

Hmm, that's too bad, that means I probably need to get my hands on one of those thermal printers... Will look into whether I can expense it or what not. Thanks for testing!

Flags: needinfo?(emilio)
Flags: needinfo?(emilio)

Jonathan, I've heard you have a thermal printer, is there any chance you could take a look and see if comment 0 reproduces in your printer? Any other info that could be useful? Thanks!

Flags: needinfo?(emilio) → needinfo?(jwatt)

Confirming that everything looks good using a regular printer (HP MFP M28a - A4 mode).
Tested on Windows 10 x64 using latest Nightly 89.0a1 (buildID 20210406152948) and 88.0b8 (buildID 20210406185740).

However, we don't have access to a thermal printer therefore we cannot tell for sure if this issue is completely fixed or not.

Flags: qe-verify+
Regressions: 1711659
Whiteboard: [pdfjs-c-printing]
Whiteboard: [pdfjs-c-printing] → [pdfjs-printing]
Summary: error on print base64 pdf with images → error on print base64 pdf with images with thermal printer

(In reply to Emilio Cobos Álvarez (:emilio) from comment #23)

Jonathan, I've heard you have a thermal printer, is there any chance you could take a look and see if comment 0 reproduces in your printer? Any other info that could be useful? Thanks!

Let's try to find someone else with a thermal printer, or maybe just buy one and expense it (should be pretty cheap).
Emilio, do you still want to work on this bug?

Severity: -- → S3
Flags: needinfo?(jwatt) → needinfo?(emilio)
Regressed by: 1699313

Ok, so I expensed a printer, and it just arrived. It's the one from comment 8. However I just printed from it from Windows and it seems to work fine, I don't see the chopped image. Is there something in your printer settings that could be affecting this?

Flags: needinfo?(emilio)
Flags: needinfo?(ivan.altamirano)

I tried to print the same file from Edge and the result was the same as in Firefox. Maybe this was a printer driver issue?

Hi there, I will try to install my printer in my RPI, wife's laptop, and any other laptop that I can find until the weekend. I will report to you this weekend (EDT)

Flags: needinfo?(ivan.altamirano)

(In reply to ivan.altamirano from comment #28)

Hi there, I will try to install my printer in my RPI, wife's laptop, and any other laptop that I can find until the weekend. I will report to you this weekend (EDT)

Hi Ivan -- just checking back, did you turn up any interesting results from this investigation that might help narrow down the possible source-of-badness or might help us reproduce?

Flags: needinfo?(ivan.altamirano)

Closing this bug as WORKSFORME for now given lack of response.

Status: REOPENED → RESOLVED
Closed: 3 years ago2 years ago
Flags: needinfo?(ivan.altamirano)
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: