mozilla / pdf.js

PDF Reader in JavaScript
https://mozilla.github.io/pdf.js/
Apache License 2.0
48.35k stars 9.97k forks source link

PDF viewer (still) adding margins to print preview and printout. #11226

Closed TomatoJoe closed 3 years ago

TomatoJoe commented 5 years ago

58606988-dd604280-82dc-11e9-8639-854f68681f3f 58606990-e05b3300-82dc-11e9-8159-60a29877a129

Since the previous report of this issue was closed, marked as fixed, but it clearly is not fixed, I post this report. This issue is still causing us grief.

We print labels , 4 per sheet this adding anything to the margins of the final print is a critical fault/bug. Now forced to go with the latest version of FF due to continuous addon issues. Here's the problem: FF v52.2.1esr Win 7 : Added ~0.5" to Left, Right, Top and Bottom margins. FF v67.0 (latest) Win 7 : Added ~0.5" to Top and Bottom margins FF v67.0 MX Linux : No added margins, however cannot use due to another bug with the Linux version of PDF.js . I have tried/checked:

Set in about:config , all margins for the printer to 0 (print.printer_4100DN_USB.print_margin_top etc)
Ensure there are no additional Gutter or Margins added by the Printer properties.
Ensure the Application adds no add'l margin
Symptoms:
Preview in Firefox - No margins added and looks as it should.
Paper printout and Print Preview - Added extra Margin.

We are forced to use the FF Preview in FF because there is no Adobe Acrobat Reader plugin support since v57. With the old v52.2.1 FF with Acrobat Plugin everything works perfectly.

timvandermeij commented 5 years ago

Could you provide a sample PDF file for which this happens?

TomatoJoe commented 5 years ago

Well, its not a stand-alone file as such, its from a Print-Labels function of Australia Post eParcel portal. I'll try to grab the page code.

fdesforges commented 5 years ago

EDIT : not a bug.

Firefox simply use the default settings of the printer for the preview and the print out (where my IT just do not configure to print to A4 format ... but an exotic format). Note that chrome/acrobat reader override those default settings to ouput to A4. Maybe @TomatoJoe you should test that your printer is configure to outpute A4

For reference if someone got the same issue :

Same problems here in Firefox 69/ win10 (using pdf.js as pdf reader).

Sample where I reproduce : https://www.maths.ed.ac.uk/~dmarsh/files/printer-testcard-colour.pdf

when opening it in firefox it's ok, when i print it or print to pdf it i get an extra margin and truncated document like here : pdfprint

It's also reproductable with the same document using the firefox print preview : image

it can also be reproduced with this document : http://www.africau.edu/images/default/sample.pdf

First note that i don't reproduce with this document : https://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/pdf_open_parameters.pdf

Second problem (I don't know if it can be related) : Every pdf sent to print to my differents office printers (differents models) ask for a manual papers addition instead of using the default one. I don't have any issue using chrome or acrobat reader.

timvandermeij commented 3 years ago

Closing since we recently merged quite a few fixes for page positioning when printing. If this is still an issue, it's most likely related to the printer settings which we cannot control from JavaScript, thus it's not something that can be fixed here.