[
https://issues.apache.org/jira/browse/PDFBOX-2021?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13964680#comment-13964680
]
Tilman Hausherr commented on PDFBOX-2021:
-----------------------------------------
I was able to reproduce it with the app and using the PDFReader parameter and
then print from the GUI. I get the effect both when printing to a printer
(there goes the toner...) and printing to a PDF driver.
(...)
I did some debugging. I found out that I also got the "mostly black" image by
doing a renderPageToGraphics() into the graphics context of a BufferedImage and
save that one. This means that it is not a printer problem.
The solution:
g.setBackground(Color.WHITE);
was missing in PDFPrintable, or in a later method. If I use this, I get a clean
image. And also a clean print. I fixed this in rev 1586149. I suspected the
line should rather go to the PDFRenderer but I'm going to sleep.
> PDFPrinter problem with landscape and rotated pages
> ----------------------------------------------------
>
> Key: PDFBOX-2021
> URL: https://issues.apache.org/jira/browse/PDFBOX-2021
> Project: PDFBox
> Issue Type: Bug
> Components: Rendering
> Affects Versions: 2.0.0
> Reporter: John Hewson
> Assignee: John Hewson
> Fix For: 2.0.0
>
> Attachments: usps.pdf
>
>
> PDFPrinter does not correctly print landscape or rotated pages, there is code
> which attempts to do both these things, however the results is wrong. There
> are three main issues:
> - the centering code does*not* center the image correctly because it assumes
> that imageableArea is the Graphics2D origin, but it is actually the page
> margin size and the Graphics2D origin remains the physical top-left edge of
> the paper.
> - auto portrait/landcape is actually sets the imageableArea, so it is
> actually setting the page margins, instead of the Graphics2D origin. This is
> actually overwriting the user's desired margins as well as placing the image
> incorrectly on the page.
> - the Page dictionary "Rotate" key is not taken into account, so rotated
> pages appear incorrectly.
--
This message was sent by Atlassian JIRA
(v6.2#6252)