[ https://issues.apache.org/jira/browse/PDFBOX-1288?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14488216#comment-14488216 ]
John Hewson edited comment on PDFBOX-1288 at 4/9/15 8:33 PM: ------------------------------------------------------------- As mentioned in PDFBOX-2081, the issue is that Java2D does not anti-alias its clipping paths, so single-pixel accuracy is lost. It's possible for us to workaround this by integer-aligning the path ourselves, making sure to always _expand_ the path size (the PDF spec mentions this in "Scan Conversion"). For polygons this is computationally too much work, but for the common case of rectangular paths, it's easy. I've attached a path which attempts to solve the problem by doing this. was (Author: jahewson): As mentioned in PDFBOX-2081, the issue is that Java2D does not anti-alias its clipping paths, so single-pixel accuracy is lost. It's possible for us to workaround this by integer-aligning the path ourselves, making sure to always _expand_ the path size. For polygons this is computationally too much work, but for the common case of rectangular paths, it's easy. I've attached a path which attempts to solve the problem by doing this. > Lines will not be printed (correctly) in case they are part of a clipping mask > ------------------------------------------------------------------------------ > > Key: PDFBOX-1288 > URL: https://issues.apache.org/jira/browse/PDFBOX-1288 > Project: PDFBox > Issue Type: Bug > Components: Rendering > Affects Versions: 1.6.0 > Environment: Mac OS X 10.7.2, Java 1.6.0_31, FOP 1.0 > Reporter: Christoph Langheld > Fix For: 2.1.0 > > Attachments: 20140226_after_printing_with_pdf_box.pdf, > 20140226_after_printing_with_pdf_box.pdf-1.png, > 20140226_after_printing_with_pdf_box.pdf-2.png, 20140226_original.pdf, > 20140226_original.pdf-1.png, 20140226_original.pdf-2.png, > after_printing_with_pdfbox.pdf, better-clipping.patch, bitcoin.pdf, > original.pdf, pdfbox-1288.pdf-1.png, screenshot_borders_with_wrong_size.png, > test2.pdf > > > In case of a PDF file that was created with FOP 1.0 and was printed with > PDFBox, lines disappeared or lines appeared smaller. PDF files that were > created with Adobe InDesign (e.g.) will be printed correctly. > It has something to do with lines which are part of a clipping mask. FOP > seems to generate a clipping mask around all kind of borders. Lines of type > <fo:leader> appear correctly and are not part of an clipping mask. > When printing a FOP-PDF with PDFBox, PDFBox moves the clipping mask, so the > line is not visible anymore. Please see attached Screenshot. > The PDF file I created with FOP is named: original.pdf > The resulting PDF file after printing with PDFBox is named: > after_printing_with_pdfbox.pdf > Regards > Christoph -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org For additional commands, e-mail: dev-h...@pdfbox.apache.org