qzind / tray

Browser plugin for sending documents and raw commands to a printer or attached device.
https://qz.io
Other
824 stars 266 forks source link

Right side of PDF is slightly cut off #1171

Closed tresf closed 7 months ago

tresf commented 10 months ago

On MacOS (various versions), the right side of this PDF is slightly cut off when printing.

A workaround is to force rasterize: true, but this is not desired for performance and quality reasons.

Printing the PDF using PDFBOX command line does NOT reproduce the issue:

java -jar pdfbox-app-2.0.29.jar PrintPDF Public-Test-Label.pdf
tresf commented 8 months ago

Quoting @akberenz:

For the mac pdf cutoff - It looks like its something with the STROKE_CONTROL rendering hint we set it to _PURE but the side lines only show up if its set to _DEFAULT or _NORMALIZE [however] if i set that rendering hint it cuts off the top & bottom border lines instead

@tresf originally wrote:

Printing the PDF using PDFBOX command line does NOT reproduce the issue:

As @akberenz points out, this isn't true, quoting:

I tried pdfbox from the cmd line and it gave the same result..

I've emailed the pdfbox mailing list about this. It's also worth mentioning that this document was created using Apache FOP Version 2.3; modified using iText® 5.5.6 ©2000-2015 iText Group NV

tresf commented 8 months ago

Simplified sample with encryption removed:

pitney_bowes_simplified.pdf

Line example, zoomed:

image
tresf commented 7 months ago

Preliminary patch: https://github.com/apache/pdfbox/compare/2.0...AlexanderScherbatiy:pdfbox:PDFBOX-5715

tresf commented 2 months ago

Preliminary patch: apache/pdfbox@2.0...AlexanderScherbatiy:pdfbox:PDFBOX-5715

Patch merged to PDFBOX here: https://github.com/apache/pdfbox/commit/73f2fff550ada9db999f7f22dca781782c5fb5bc; available since PDFBOX 2.0.31, 3.0.2, 4.0.0