[ 
https://issues.apache.org/jira/browse/PDFBOX-2922?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14680905#comment-14680905
 ] 

John Hewson commented on PDFBOX-2922:
-------------------------------------

The behaviour which you were encountering was a bug. The orientation code for 
PDFPageable was working fine for portrait pages, or rotated portrait pages but 
it didn't work for landscape pages, i.e. pages where the MediaBox width > 
height. Java doesn't seem to like landscape paper and unhelpfully "corrects" 
the imageable area which PDFPageable provided by cropping it down to portrait 
size, even though the paper is sized as landscape. This happens regardless of 
whether the PageFormat's orientation is portrait or landscape, so I suspect it 
is a JDK bug.

I've come up with a workaround where we normalise the paper size to be 
portrait, then set the PageFormat's orientation flag to represent the original 
orientation. This produces the expected results.

> Make PDFPrintable and PDFPageable extandable
> --------------------------------------------
>
>                 Key: PDFBOX-2922
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2922
>             Project: PDFBox
>          Issue Type: Improvement
>          Components: Rendering
>    Affects Versions: 2.0.0
>            Reporter: Pei-Tang Huang
>            Assignee: John Hewson
>         Attachments: landscape.pdf, rotated_cropping_failed.jpg, success.jpg
>
>
> Would you please remove the {{final}} modifier from {{PDFPrintable}} and 
> {{PDFPageable}} so that one can extending those classes.



--
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

Reply via email to