You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (JIRA)" <ji...@apache.org> on 2014/10/08 20:39:33 UTC

[jira] [Closed] (PDFBOX-2410) if (page != null && page.getRotation() != null)

     [ https://issues.apache.org/jira/browse/PDFBOX-2410?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tilman Hausherr closed PDFBOX-2410.
-----------------------------------
    Resolution: Invalid
      Assignee: Tilman Hausherr

This is because getRotation returns an Integer object, not an int. The javadoc tells this:
{quote}
A value representing the rotation. This will be null if not set at this level 

The number of degrees by which the page should be rotated clockwise when displayed or printed. The value must be a multiple of 90. This will get the rotation at this page and not look up the hierarchy. This attribute is inheritable, and findRotation() should probably used. This will return null if no rotation is available at this level.
{quote}

So set the rotation yourself :-)

> if (page != null && page.getRotation() != null)
> -----------------------------------------------
>
>                 Key: PDFBOX-2410
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2410
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>         Environment: Java 7, Windows
>            Reporter: Daniel Brownell
>            Assignee: Tilman Hausherr
>            Priority: Minor
>
>     static PDRectangle[] pageSizes = new PDRectangle[5];
>     
>     static
>     {
>     	pageSizes[0] = PDPage.PAGE_SIZE_A0;
>     	pageSizes[1] = PDPage.PAGE_SIZE_A1;
>     	pageSizes[2] = PDPage.PAGE_SIZE_A2;
>     	pageSizes[3] = PDPage.PAGE_SIZE_A3;
>     	pageSizes[4] = PDPage.PAGE_SIZE_A4;
>     }
> page = new PDPage(pageSizes[size]);
> ...
> if (page != null && page.getRotation() == 90) //NPE THROWN
> {   
> }



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)