Last Comment Bug 847049 - Printing from pdf.js rescales/resizes/shrinks output, and very poor print quality
: Printing from pdf.js rescales/resizes/shrinks output, and very poor print qua...
Status: NEW
[pdfjs-c-feature][pdfjs-d-printing][w...
:
Product: Firefox
Classification: Client Software
Component: PDF Viewer (show other bugs)
: unspecified
: All All
: -- major with 9 votes (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
:
Mentors:
http://www.education.gov.yk.ca/pdf/pd...
: 864871 (view as bug list)
Depends on: 748935 932289 752390 811002
Blocks: 743252
  Show dependency treegraph
 
Reported: 2013-03-02 06:49 PST by Thomas D. (currently busy elsewhere; needinfo?me)
Modified: 2016-09-06 07:57 PDT (History)
20 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Testcase 1: pdf-test.pdf (see URL above) (20.11 KB, application/pdf)
2013-03-02 06:49 PST, Thomas D. (currently busy elsewhere; needinfo?me)
no flags Details
Printscan 1: Testcase 1 after printing with Adobe Reader (correctly scaled) (29.74 KB, image/png)
2013-03-02 07:32 PST, Thomas D. (currently busy elsewhere; needinfo?me)
no flags Details
Printscan 2: Testcase 1 after printing with FF 22.0a1_2013-03-01 (shrunk and too high on paper) (30.87 KB, image/png)
2013-03-02 07:46 PST, Thomas D. (currently busy elsewhere; needinfo?me)
no flags Details
Original PDF formatted for label printing (919.38 KB, application/pdf)
2013-05-07 09:47 PDT, Deanna Foster
no flags Details
Testcase X2: Original PDF file with stamps for precision printing on sheet of self-adhesive labels (919.36 KB, application/pdf)
2013-05-07 09:50 PDT, Deanna Foster
no flags Details
PrintScan X2: Testcase X2, after printing with FF (showing bogus printing accross labels, due to FF rescaling bug) (1.38 MB, application/pdf)
2013-05-07 09:52 PDT, Deanna Foster
no flags Details

Description Thomas D. (currently busy elsewhere; needinfo?me) 2013-03-02 06:49:05 PST
Created attachment 720284 [details]
Testcase 1: pdf-test.pdf (see URL above)

+++ This bug was initially created as a clone of Bug #752390 +++

seen on 22.0a1 (2013-03-01)

STR

1 view Testcase 1 (http://www.education.gov.yk.ca/pdf/pdf-test.pdf) with FF pdf.js
2 print it from FF
3 view same pdf-test.pdf with adobe reader
4 print it from AR

Actual result

3 printing from pdf.js reduces the size of the output compared to printing from adobe reader (this bug) and makes it blurry (Bug 811002)
4 printing same pdf from adobe reader produces crisp and assumedly correctly-sized (larger) output.

Expected result

3 FF should print the PDF at its original size if that matches the paper size, without adding margins of any sort. Which might help towards bug 811002, or vice versa.
Comment 1 Thomas D. (currently busy elsewhere; needinfo?me) 2013-03-02 07:23:35 PST
Reported against 22.0a1 (2013-03-01) on Windows XP
Comment 2 Thomas D. (currently busy elsewhere; needinfo?me) 2013-03-02 07:32:55 PST
Created attachment 720292 [details]
Printscan 1: Testcase 1 after printing with Adobe Reader (correctly scaled)

Here's a scan of testcase 1 (attachment 720284 [details], see URL) printed with Adobe Reader. I printed a ruler on top. Note:

- crisp print quality
- left margin around 2cm
- length of first text line (Congratulations...) = 14,5cm
- Yukon headline is horizontally adjacent to ruler (vertical offset=0mm)
Comment 3 Thomas D. (currently busy elsewhere; needinfo?me) 2013-03-02 07:40:24 PST
(In reply to Thomas D. from comment #2)
> Created attachment 720292 [details]
> Printscan 1: Tescase 1 after printing with Adobe Reader
> 
> Here's a scan of testcase 1 (attachment 720284 [details], see URL)
> printed with Adobe Reader. I printed a ruler on top. Note:
> 
> - crisp print quality
> - left margin around 2cm
> - length of first text line (Congratulations...) = 14,5cm
Sorry, typo! That line length was measured on FF printout.
On the original print from Adobe Reader, that's:
- length of first text line (Congratulations...) = 15,8cm
> - Yukon headline is horizontally adjacent to ruler (vertical offset=0mm)
- Yukon logo vertical offset: 3cm
Comment 4 Thomas D. (currently busy elsewhere; needinfo?me) 2013-03-02 07:46:18 PST
Created attachment 720294 [details]
Printscan 2: Testcase 1 after printing with FF 22.0a1_2013-03-01 (shrunk and too high on paper)

For comparison, this is the scan of testcase 1 (attachment 720284 [details] [©] [details], see URL) printed with *Firefox* 22.0a1 (2013-03-01). I printed a ruler on top, in same physical position as on attachment 720292 [details].
Firefox printout is shrinked in overall size, but vertically higher on the paper. Note:

- poor print quality
- left margin around 2,5 cm
- length of first text line (Congratulations...) = 14,5cm
- Yukon headline now floats 8mm above the ruler (vertical offset=-8mm)
- Yukon logo vertical offset = 2,3 cm
Comment 5 Thomas D. (currently busy elsewhere; needinfo?me) 2013-04-20 00:57:39 PDT
Rendering pdfs from FF in my favorite Browser is a nice feature, but it becomes pretty useless without decent printing - after all, pdfs are made for printing.
So essentially, each time I need to print pdfs, I have to go through the hassle of saving, opening & printing the pdf from Adobe Reader. Which constantly makes me wish to go back to having Adobe Reader Plugin in Firefox. Which I'm sure is somewhat against the intention of native PDF support in FF.

https://github.com/mozilla/pdf.js/issues/154 is closed.
https://github.com/mozilla/pdf.js/issues/2101 which reports total garbage print had last activity 6 months ago.

On https://github.com/mozilla/pdf.js/issues/1623, Julian acknoweldges:
> Printing support is very limited (aka. broken). I'm working on make it better
> but it requires to implement some new WebAPIs... See also #154.

But then, #154 is closed :(

Julian, can you provide a status update on pdf.js printing support, and possibly reference some tickets where such work is going on?
Comment 6 Julian Viereck 2013-04-22 00:51:46 PDT
(In reply to Thomas D. from comment #5)
>
> Julian, can you provide a status update on pdf.js printing support, and
> possibly reference some tickets where such work is going on?

I'm not involved closely with this project anymore. If you want to get overview of all the printing problems, please take a look at bug 811002 and all the bugs that it blocks/depends on.
Comment 7 Deanna Foster 2013-05-07 09:37:58 PDT
Merging bug 864871 into this bug.  Adding my sample PDF files showing the issue that now happens when attemtping to print on labels, which require precise output of the PDF.
Comment 8 Deanna Foster 2013-05-07 09:47:41 PDT
Created attachment 746474 [details]
Original PDF formatted for label printing

This PDF was printed onto labels directly form Mozilla.

Notice on this PDF, how the images on the PDF are slightly "shrunk", resulting in alignment issues.  The stamps do not align with the labels after the first row.
Comment 9 Deanna Foster 2013-05-07 09:50:55 PDT
Created attachment 746478 [details]
Testcase X2: Original PDF file with stamps for precision printing on sheet of self-adhesive labels

Labels printed from PDF which was saved first

This PDF was downloaded from the application, and then printed from Adobe.  Notice how the stamps line up exactly with the labels.
Comment 10 Deanna Foster 2013-05-07 09:52:42 PDT
Created attachment 746480 [details]
PrintScan X2: Testcase X2, after printing with FF (showing bogus printing accross labels, due to FF rescaling bug)

This PDF was printed onto labels directly form Mozilla.

Note:  as there was no way to create a PDF from a direct print, I printed this PDF onto the labels, and then scanned the resulting print-out.
Comment 11 Deanna Foster 2013-05-07 09:53:34 PDT
Transferring comment from bug 864871 (which I close as duplicate):
Note:  we have dozens of users in France who upgraded their Firefox versions and experienced the URL printing in the margins causing their stamps to "shrink to fit" the larger margins.  We were hoping with the removal of the URLs that the "shrink" problem would also go away, but apparently it hasn't.

We had out primary testers in France try your latest version as well, so we know it's not a problems specific to a particular browser installation or printer.

They are a very large organization, hence this is having a big impact on not only their users, but their first level support as well.  So, we're really hoping for a solution that doesn't involve the users having to reconfigure their browsers (they are not that technical).
Comment 12 Deanna Foster 2013-05-07 09:55:12 PDT
*** Bug 864871 has been marked as a duplicate of this bug. ***
Comment 13 Scoobidiver (away) 2013-05-07 11:27:40 PDT
(In reply to Deanna Foster from comment #11)
> They are a very large organization, hence this is having a big impact on not
> only their users, but their first level support as well.
As a workaround, they can use Firefox ESR (see http://www.mozilla.org/firefox/organizations/faq/) that doesn't have the embedded PDF viewer, hoping this bug is going to be fixed in Firefox 24 or sooner.
Comment 14 Thomas D. (currently busy elsewhere; needinfo?me) 2013-05-08 02:16:39 PDT
Comment on attachment 746474 [details]
Original PDF formatted for label printing

I'm working with Deanna to sort out a bit of confusion about the various versions of her otherwise excellent testcase. For the meantime, pls ignore comment 8 and comment 9 because the descriptions aren't right.

Both attachment 746474 [details] and attachment 746478 [details] present the unmodified, unprocessed original PDF file which has the correct layout for printing stamps correctly on a sheet of self-adhesive labels.

- when printed with Adobe reader, stamps end up nicely on the labels.
- when printed with Firefox, stamps are printed across labels, due to FF aggressive rescaling (this bug), hence spoiling the whole set.
Comment 15 Thomas D. (currently busy elsewhere; needinfo?me) 2013-05-08 02:21:32 PDT
Comment on attachment 746478 [details]
Testcase X2: Original PDF file with stamps for precision printing on sheet of self-adhesive labels

So this is the original file with correct layout (open in Adobe reader to ensure correct rendering).
Comment 16 Thomas D. (currently busy elsewhere; needinfo?me) 2013-05-08 02:31:06 PDT
Comment on attachment 746478 [details]
Testcase X2: Original PDF file with stamps for precision printing on sheet of self-adhesive labels

(In reply to Thomas D. from comment #15)
> Comment on attachment 746478 [details]
> This PDF was printed onto labels directly form Mozilla.
> 
> So this is the original file with correct layout (open in Adobe reader to
> ensure correct rendering).

...now with correct description :)

For details, see comment 14.
Comment 17 Thomas D. (currently busy elsewhere; needinfo?me) 2013-05-08 02:42:52 PDT
Comment on attachment 746480 [details]
PrintScan X2: Testcase X2, after printing with FF (showing bogus printing accross labels, due to FF rescaling bug)

...so this is the bogus print results after printing from Firefox: Due to incorrect rescaling (this bug), all labels messed up. Quelle malheur!
Comment 18 Scoobidiver (away) 2013-05-08 03:04:45 PDT
(In reply to Thomas D. from comment #17)
> Quelle malheur!
FWIW, it's "Quel malheur !".
Comment 19 Thomas D. (currently busy elsewhere; needinfo?me) 2013-05-08 03:22:18 PDT
(In reply to Scoobidiver from comment #18)
> (In reply to Thomas D. from comment #17)
> > Quelle malheur!
> FWIW, it's "Quel malheur !".

Sure. My bad, I took the first machine translation without checking... ;)
http://mymemory.translated.net/t/French/German/quelle%20malheur
I've added the correct version there, too.

Grammar aside, it's still a "grand malheur"... :|
Comment 20 Vestigal 2013-08-08 11:52:51 PDT
I'm seeing this on FF 23.0 on Windows 7.

For me, the issue only happens when the PDF is set to "Automatic Zoom." In this case, the PDF displays fine in the browser, but prints at a much smaller size. Zooming to 100% fixes the issue.

For the moment, I'm adding #page=1&zoom=100 to the URLs that our webpage is serving in order to fix the issue, but obviously this is less than ideal.
Comment 21 David Alan Hjelle 2013-11-20 14:04:52 PST
Just to confirm the page scaling issue in FF27 on Mac. Interestingly, I can manually tell FF not to perform any page scaling, but this is a step most users won't remember to do. The PDFs we generate have the print scaling viewer preference set to none in the PDF, and it'd be great if FF would respect that by default.

I have a sample file I can provide, but it looks like the test cases provided here cover the issue.
Comment 22 david 2014-10-29 07:31:10 PDT
 I can confirm this bug still exists in FF 33.0.2 on Windows 7.
Comment 23 jrhyne 2015-07-17 11:07:08 PDT
(In reply to David Alan Hjelle from comment #21)
> Just to confirm the page scaling issue in FF27 on Mac. Interestingly, I can
> manually tell FF not to perform any page scaling, but this is a step most
> users won't remember to do. The PDFs we generate have the print scaling
> viewer preference set to none in the PDF, and it'd be great if FF would
> respect that by default.
> 
> I have a sample file I can provide, but it looks like the test cases
> provided here cover the issue.

How can you tell Firefox not to perform page scaling? I couldn't find this option.
Comment 24 les 2016-01-08 11:10:02 PST
I'm having the same problem with the built in PDF viewer (pdf.js). Our company is attempting to standardize FF. We generate a ton of PDFs for print (labels, reports, etc).

With the exception of PDFs with embedded barcode fonts, the PDFs render on screen correctly.  However, printing is horribly broken.

When they do print, they are scaled down to 1/4 size on the printed page. In some cases the content is cut off all together (usually if the page setup orientation doesn't match the document's orientation).  

It doesn't seem to respect the page orientation from the pdf when printing. My guess is that this is related to the scale to fit not working when printing.

No amount of fiddling with the page orientation, scaling, margins, or headers resolves the problem.

I see this on FF 31 and FF 44 on Windows 7 (have not tested other Windows).  I do not have this occur on OS X.
Comment 25 pranalli 2016-02-02 10:22:01 PST
(In reply to les from comment #24)
> I'm having the same problem with the built in PDF viewer (pdf.js). Our
> company is attempting to standardize FF. We generate a ton of PDFs for print
> (labels, reports, etc).
> 
> With the exception of PDFs with embedded barcode fonts, the PDFs render on
> screen correctly.  However, printing is horribly broken.
> 
> When they do print, they are scaled down to 1/4 size on the printed page. In
> some cases the content is cut off all together (usually if the page setup
> orientation doesn't match the document's orientation).  
> 
> It doesn't seem to respect the page orientation from the pdf when printing.
> My guess is that this is related to the scale to fit not working when
> printing.
> 
> No amount of fiddling with the page orientation, scaling, margins, or
> headers resolves the problem.
> 
> I see this on FF 31 and FF 44 on Windows 7 (have not tested other Windows). 
> I do not have this occur on OS X.

I had the same issue and figured out a solution, hopefully this works for you as well:

Go to the hidden menu option in FireFox by typing "about:config" in the URL bar.  From there, search for "scaling" and look for print scaling options.  In my case, I had users who, for some reason, had this set to 0.8 and 0.25.  Set it to 1 (you may also want to double-check and make sure Shrink to Fit is set to true if applicably), close the tab then close the browser.  I would go back to about:config and make sure the setting stuck.  Once you've done that give it a try.  Worked perfectly for me.
Comment 26 johnvader 2016-09-06 07:57:49 PDT Comment hidden (spam)

Note You need to log in before you can comment on or make changes to this bug.