[
https://issues.apache.org/jira/browse/PDFBOX-4789?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17053105#comment-17053105
]
Tilman Hausherr commented on PDFBOX-4789:
-----------------------------------------
I put some debug output into PDFPrintable:
{noformat}
graphics: class sun.print.PeekGraphics, pageIndex: 0
imageable: 468.0 x 648.0
cropBox: [0.0,0.0,595.0,842.0]
scale: 0.7695961995249406
transform: AffineTransform[[4.166666666666667, 0.0, -0.0], [0.0,
4.166666666666667, -0.0]]
transform: AffineTransform[[4.166666666666667, 0.0, 300.0], [0.0,
4.166666666666667, 300.0]]
transform: AffineTransform[[4.166666666666667, 0.0, 321.021377672209], [0.0,
4.166666666666667, 300.0]]
graphics: class sun.print.PSPathGraphics, pageIndex: 0
imageable: 468.0 x 648.0
cropBox: [0.0,0.0,595.0,842.0]
scale: 0.7695961995249406
transform: AffineTransform[[4.166666666666667, 0.0, -0.0], [0.0,
4.166666666666667, -0.0]]
transform: AffineTransform[[4.166666666666667, 0.0, 300.0], [0.0,
4.166666666666667, 300.0]]
transform: AffineTransform[[4.166666666666667, 0.0, 321.021377672209], [0.0,
4.166666666666667, 300.0]]
graphics: class sun.print.PeekGraphics, pageIndex: 1
imageable: 468.0 x 648.0
cropBox: [0.0,0.0,842.0,595.0]
scale: 0.5558194774346793
transform: AffineTransform[[4.166666666666667, 0.0, -0.0], [0.0,
4.166666666666667, -0.0]]
transform: AffineTransform[[4.166666666666667, 0.0, 300.0], [0.0,
4.166666666666667, 300.0]]
transform: AffineTransform[[4.166666666666667, 0.0, 300.0000000000001], [0.0,
4.166666666666667, 961.0154394299287]]
graphics: class sun.print.PSPathGraphics, pageIndex: 1
imageable: 468.0 x 648.0
cropBox: [0.0,0.0,842.0,595.0]
scale: 0.5558194774346793
transform: AffineTransform[[4.166666666666667, 0.0, -0.0], [0.0,
4.166666666666667, -0.0]]
transform: AffineTransform[[4.166666666666667, 0.0, 300.0], [0.0,
4.166666666666667, 300.0]]
transform: AffineTransform[[4.166666666666667, 0.0, 300.0000000000001], [0.0,
4.166666666666667, 961.0154394299287]]
{noformat}
then I printed on my printer:
{noformat}
graphics: class sun.print.PeekGraphics, pageIndex: 0
imageable: 595.0 x 842.0
cropBox: [0.0,0.0,595.0,842.0]
scale: 1.0
transform: AffineTransform[[16.666666666666668, 0.0, -200.0], [0.0,
16.666666666666668, -200.0]]
transform: AffineTransform[[16.666666666666668, 0.0, -200.0], [0.0,
16.666666666666668, -200.0]]
transform: AffineTransform[[16.666666666666668, 0.0, -200.0], [0.0,
16.666666666666668, -200.0]]
graphics: class sun.awt.windows.WPathGraphics, pageIndex: 0
imageable: 595.0 x 842.0
cropBox: [0.0,0.0,595.0,842.0]
scale: 1.0
transform: AffineTransform[[16.666666666666668, 0.0, -200.0], [0.0,
16.666666666666668, -200.0]]
transform: AffineTransform[[16.666666666666668, 0.0, -200.0], [0.0,
16.666666666666668, -200.0]]
transform: AffineTransform[[16.666666666666668, 0.0, -200.0], [0.0,
16.666666666666668, -200.0]]
graphics: class sun.print.PeekGraphics, pageIndex: 1
imageable: 842.0 x 595.0
cropBox: [0.0,0.0,842.0,595.0]
scale: 1.0
transform: AffineTransform[[0.0, 16.666666666666668, -200.0],
[-16.666666666666668, 0.0, 13833.333333333334]]
transform: AffineTransform[[0.0, 16.666666666666668, -200.0],
[-16.666666666666668, 0.0, 13833.333333333334]]
transform: AffineTransform[[0.0, 16.666666666666668, -200.0],
[-16.666666666666668, 0.0, 13833.333333333334]]
graphics: class sun.awt.windows.WPathGraphics, pageIndex: 1
imageable: 842.0 x 595.0
cropBox: [0.0,0.0,842.0,595.0]
scale: 1.0
transform: AffineTransform[[0.0, 16.666666666666668, -200.0],
[-16.666666666666668, 0.0, 13833.333333333334]]
transform: AffineTransform[[0.0, 16.666666666666668, -200.0],
[-16.666666666666668, 0.0, 13833.333333333334]]
transform: AffineTransform[[0.0, 16.666666666666668, -200.0],
[-16.666666666666668, 0.0, 13833.333333333334]]
{noformat}
However that one uses PDFPageable. If I change your code to use PDFPageable
then I get the attached PS. [^Pageable-PDFBox PS export bug.pdf.ps]
> PDFBox not honoring page orientation when printing PDFs with mixed
> orientation to PS
> ------------------------------------------------------------------------------------
>
> Key: PDFBOX-4789
> URL: https://issues.apache.org/jira/browse/PDFBOX-4789
> Project: PDFBox
> Issue Type: Bug
> Components: Rendering
> Affects Versions: 2.0.19
> Environment: Mac OS X, with Preview used as the PDF and PS viewer
> Reporter: Ulf Dittmer
> Priority: Minor
> Attachments: PDFBox PS export bug.pdf, PDFBox PS export bug.pdf.ps,
> PDFtoPS.java, Pageable-PDFBox PS export bug.pdf.ps
>
>
> When using PDFBox to print a PDF containing both portrait and landscape pages
> to PS, the output has only Portrait pages. It's not that the landscape pages
> have been rotated, just that the resulting page has portrait page dimensions.
> Attached is an example PDF, the Java code used for printing to PS, and the
> resulting output.
>
> The PS has a BeingSetup/EndSetup section specifying the orientation only
> ahead of the first page. If I manually add one ahead of the second page with
> appropriate page dimensions ("792.0 612.0" instead of "612.0 792.0"), it
> looks good.
>
> Is this a bug in PDFBox or a bug in the Java print system?
> https://issues.apache.org/jira/browse/PDFBOX-3453? leads me to believe it
> might actually be the latter.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]