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

Tilman Hausherr commented on PDFBOX-4410:
-----------------------------------------

You'll have to apply the rotation based on the result of 
{{page.getRotation()}}. The possible values are 0, 90, 180 or 270, although 
some PDFs may have values like -90. So add 360 and then do modulo 360 on the 
result.

If you were satisfied with the result when the rotation was 0, then for 90° you 
can use the method I mentioned (assuming it is correct).

If the cropbox has non 0,0 origins then you'll have to do whatever you do for 
unrotated pages after you've applied the rotation.

> Not getting location of Form-Field correct when page has landscape orientation
> ------------------------------------------------------------------------------
>
>                 Key: PDFBOX-4410
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4410
>             Project: PDFBox
>          Issue Type: Bug
>          Components: AcroForm
>    Affects Versions: 2.0.12
>            Reporter: Amit Maheshwari
>            Priority: Critical
>              Labels: how-to
>         Attachments: RPA_WTA_Extended (1).pdf
>
>
> In my client application, I need to know the location of form fields.
> *For getting the location, I am relaying on those widgets of field which has 
> non-negative page number.*
>  
> In attached Pdf File ( [^RPA_WTA_Extended (1).pdf] ). when it changes 
> orientation (page - 10), I could see widgets with non-negative page number 
> was giving me improper location.
>  
> For getting page I'm doing this:
> {code:java}
> int getPageOfWidget(PDAnnotationWidget widget, PDPageTree pages)
> {
>    return pages.indexOf(widget.getPage()); 
> }
> {code}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to