Package 

Class PdfPage

  • All Implemented Interfaces:
    java.io.Closeable , java.lang.AutoCloseable

    
    public final class PdfPage
     implements Closeable
                        

    Represents a single page in a PdfDocument.

    • Method Detail

      • getPageWidth

         final Integer getPageWidth(Integer screenDpi)

        Get page width in pixels.

        Parameters:
        screenDpi - screen DPI (Dots Per Inch)
      • getPageHeight

         final Integer getPageHeight(Integer screenDpi)

        Get page height in pixels.

        Parameters:
        screenDpi - screen DPI (Dots Per Inch)
      • getPageCropBox

         final RectF getPageCropBox()

        Get the page's crop box in PostScript points (1/72th of an inch)

      • getPageMediaBox

         final RectF getPageMediaBox()

        Get the page's media box in PostScript points (1/72th of an inch)

      • getPageBleedBox

         final RectF getPageBleedBox()

        Get the page's bleed box in PostScript points (1/72th of an inch)

      • getPageTrimBox

         final RectF getPageTrimBox()

        Get the page's trim box in PostScript points (1/72th of an inch)

      • getPageArtBox

         final RectF getPageArtBox()

        Get the page's art box in PostScript points (1/72th of an inch)

      • getPageBoundingBox

         final RectF getPageBoundingBox()

        Get the page's bounding box in PostScript points (1/72th of an inch)

      • renderPage

         final Unit renderPage(Surface surface, Integer startX, Integer startY, Integer drawSizeX, Integer drawSizeY, Boolean renderAnnot)

        Render page fragment on Surface.<br></br>

        Parameters:
        surface - Surface on which to render page
        startX - left position of the page in the surface
        startY - top position of the page in the surface
        drawSizeX - horizontal size of the page on the surface
        drawSizeY - vertical size of the page on the surface
        renderAnnot - whether render annotation
      • renderPageBitmap

         final Unit renderPageBitmap(Bitmap bitmap, Integer startX, Integer startY, Integer drawSizeX, Integer drawSizeY, Boolean renderAnnot, Boolean textMask)

        Render page fragment on Bitmap.<br></br>

        Parameters:
        bitmap - Bitmap on which to render page
        startX - left position of the page in the bitmap
        startY - top position of the page in the bitmap
        drawSizeX - horizontal size of the page on the bitmap
        drawSizeY - vertical size of the page on the bitmap
        renderAnnot - whether render annotation
        textMask - whether to render text as image mask
      • mapPageCoordsToDevice

         final Point mapPageCoordsToDevice(Integer startX, Integer startY, Integer sizeX, Integer sizeY, Integer rotate, Double pageX, Double pageY)

        Map page coordinates to device screen coordinates

        Parameters:
        startX - left pixel position of the display area in device coordinates
        startY - top pixel position of the display area in device coordinates
        sizeX - horizontal size (in pixels) for displaying the page
        sizeY - vertical size (in pixels) for displaying the page
        rotate - page orientation: 0 (normal), 1 (rotated 90 degrees clockwise), 2 (rotated 180 degrees), 3 (rotated 90 degrees counter-clockwise)
        pageX - X value in page coordinates
        pageY - Y value in page coordinate
      • mapDeviceCoordsToPage

         final PointF mapDeviceCoordsToPage(Integer startX, Integer startY, Integer sizeX, Integer sizeY, Integer rotate, Integer deviceX, Integer deviceY)

        Map device screen coordinates to page coordinates

        Parameters:
        startX - left pixel position of the display area in device coordinates
        startY - top pixel position of the display area in device coordinates
        sizeX - horizontal size (in pixels) for displaying the page
        sizeY - vertical size (in pixels) for displaying the page
        rotate - page orientation: 0 (normal), 1 (rotated 90 degrees clockwise), 2 (rotated 180 degrees), 3 (rotated 90 degrees counter-clockwise)
        deviceX - X value in page coordinates
        deviceY - Y value in page coordinate
      • mapRectToDevice

         final Rect mapRectToDevice(Integer startX, Integer startY, Integer sizeX, Integer sizeY, Integer rotate, RectF coords)

        maps a rectangle from page space to device space

        Parameters:
        startX - left pixel position of the display area in device coordinates
        startY - top pixel position of the display area in device coordinates
        sizeX - horizontal size (in pixels) for displaying the page
        sizeY - vertical size (in pixels) for displaying the page
        rotate - page orientation: 0 (normal), 1 (rotated 90 degrees clockwise), 2 (rotated 180 degrees), 3 (rotated 90 degrees counter-clockwise)
        coords - rectangle to map
      • mapRectToPage

         final RectF mapRectToPage(Integer startX, Integer startY, Integer sizeX, Integer sizeY, Integer rotate, Rect coords)

        Maps a rectangle from device space to page space

        Parameters:
        startX - left pixel position of the display area in device coordinates
        startY - top pixel position of the display area in device coordinates
        sizeX - horizontal size (in pixels) for displaying the page
        sizeY - vertical size (in pixels) for displaying the page
        rotate - page orientation: 0 (normal), 1 (rotated 90 degrees clockwise), 2 (rotated 180 degrees), 3 (rotated 90 degrees counter-clockwise)
        coords - rectangle to map
      • close

         Unit close()

        Close the page and release all resources