-
- All Implemented Interfaces:
-
java.io.Closeable,java.lang.AutoCloseable
public final class PdfPage implements Closeable
Represents a page in a PDF document.
Create instances using PdfDocument.openPage. Always call close when done to release native resources.
-
-
Method Summary
Modifier and Type Method Description final DoublegetWidth()Page width in points (1/72 inch). final DoublegetHeight()Page height in points (1/72 inch). final IntegergetIndex()final Unitrender(Bitmap bitmap, Integer startX, Integer startY, Integer drawWidth, Integer drawHeight, Boolean renderAnnot)Render the page to an Android Bitmap. final BooleanisClosed()Check if the page has been closed. final PdfTextPageopenTextPage()final List<PdfAnnotation>getAnnotations()Get all annotations on the page. final List<PdfLink>getLinks()Get all links on the page. final PdfLinkgetLinkAt(Double x, Double y)Get a link at the specified coordinates. Unitclose()Close the page and release native resources. final RectFmapRectToDevice(Integer startX, Integer startY, Integer sizeX, Integer sizeY, RectF rect)Map a rectangle from page coordinates to device coordinates. final DoubleArraymapDeviceToPage(Integer startX, Integer startY, Integer sizeX, Integer sizeY, Integer deviceX, Integer deviceY)Map device (screen) coordinates to page (PDF) coordinates. -
-
Method Detail
-
render
final Unit render(Bitmap bitmap, Integer startX, Integer startY, Integer drawWidth, Integer drawHeight, Boolean renderAnnot)
Render the page to an Android Bitmap.
- Parameters:
bitmap- The target bitmap.startX- X-coordinate of the upper-left corner of the drawing area.startY- Y-coordinate of the upper-left corner of the drawing area.drawWidth- Width of the drawing area.drawHeight- Height of the drawing area.renderAnnot- Whether to render annotations.
-
openTextPage
final PdfTextPage openTextPage()
-
getAnnotations
final List<PdfAnnotation> getAnnotations()
Get all annotations on the page.
-
mapRectToDevice
final RectF mapRectToDevice(Integer startX, Integer startY, Integer sizeX, Integer sizeY, RectF rect)
Map a rectangle from page coordinates to device coordinates.
-
mapDeviceToPage
final DoubleArray mapDeviceToPage(Integer startX, Integer startY, Integer sizeX, Integer sizeY, Integer deviceX, Integer deviceY)
Map device (screen) coordinates to page (PDF) coordinates.
-
-
-
-