PdfiumSdk

class PdfiumSdk

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val currentDpi: Int = 72
Link copied to clipboard

Get metadata for given document

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Get total number of pages in document

Link copied to clipboard

Get table of contents (bookmarks) for given document

Functions

Link copied to clipboard

Release native resources and opened file

Link copied to clipboard
fun getPageHeight(index: Int): Int

Get page height in pixels.

This method requires page to be opened.

Link copied to clipboard

Get page height in PostScript points (1/72th of an inch).

This method requires page to be opened.

Link copied to clipboard
fun getPageLinks(pageIndex: Int): List<Link>

Get all links from given page

Link copied to clipboard
fun getPageRotation(index: Int): Int

Get the rotation of page

Link copied to clipboard
fun getPageSize(index: Int): Size

Get size of page in pixels.

This method does not require given page to be opened.

Link copied to clipboard
fun getPageWidth(index: Int): Int

Get page width in pixels.

This method requires page to be opened.

Link copied to clipboard

Get page width in PostScript points (1/72th of an inch).

This method requires page to be opened.

Link copied to clipboard
fun mapPageCoordinateToDevice(pageIndex: Int, startX: Int, startY: Int, sizeX: Int, sizeY: Int, rotate: Int, coords: RectF): RectF
Link copied to clipboard
fun mapPageCoordsToDevice(pageIndex: Int, startX: Int, startY: Int, sizeX: Int, sizeY: Int, rotate: Int, pageX: Double, pageY: Double): Point

Map page coordinates to device screen coordinates

Link copied to clipboard
external fun nativeCloseDocument(docPtr: Long)
Link copied to clipboard
external fun nativeClosePage(pagePtr: Long)
Link copied to clipboard
external fun nativeClosePages(pagesPtr: LongArray)
Link copied to clipboard
external fun nativeGetBookmarkDestIndex(docPtr: Long, bookmarkPtr: Long): Long
Link copied to clipboard
external fun nativeGetBookmarkTitle(bookmarkPtr: Long): String?
Link copied to clipboard
external fun nativeGetDestPageIndex(docPtr: Long, linkPtr: Long): Int?
Link copied to clipboard
external fun nativeGetDocumentMetaText(docPtr: Long, tag: String): String?
Link copied to clipboard
external fun nativeGetFirstChildBookmark(docPtr: Long, bookmarkPtr: Long?): Long?
Link copied to clipboard
external fun nativeGetLinkRect(linkPtr: Long): RectF?
Link copied to clipboard
external fun nativeGetLinkURI(docPtr: Long, linkPtr: Long): String?
Link copied to clipboard
external fun nativeGetPageCount(docPtr: Long): Int
Link copied to clipboard
external fun nativeGetPageHeightPixel(pagePtr: Long, dpi: Int): Int
Link copied to clipboard
external fun nativeGetPageHeightPoint(pagePtr: Long): Int
Link copied to clipboard
external fun nativeGetPageLinks(pagePtr: Long): LongArray
Link copied to clipboard
external fun nativeGetPageRotation(pagePtr: Long): Int
Link copied to clipboard
external fun nativeGetPageSizeByIndex(docPtr: Long, pageIndex: Int, dpi: Int): Size
Link copied to clipboard
external fun nativeGetPageWidthPixel(pagePtr: Long, dpi: Int): Int
Link copied to clipboard
external fun nativeGetPageWidthPoint(pagePtr: Long): Int
Link copied to clipboard
external fun nativeGetSiblingBookmark(docPtr: Long, bookmarkPtr: Long): Long?
Link copied to clipboard
external fun nativeLoadPage(docPtr: Long, pageIndex: Int): Long
Link copied to clipboard
external fun nativeLoadPages(docPtr: Long, fromIndex: Int, toIndex: Int): LongArray
Link copied to clipboard
external fun nativeOpenDocument(fd: Int, password: String?): Long
Link copied to clipboard
external fun nativeOpenMemDocument(data: ByteArray, password: String): Long
Link copied to clipboard
external fun nativePageCoordinateToDevice(pagePtr: Long, startX: Int, startY: Int, sizeX: Int, sizeY: Int, rotate: Int, pageX: Double, pageY: Double): Point
Link copied to clipboard
external fun nativeRenderPage(pagePtr: Long, surface: Surface, dpi: Int, startX: Int, startY: Int, drawSizeHor: Int, drawSizeVer: Int, renderAnnot: Boolean)
Link copied to clipboard
external fun nativeRenderPageBitmap(pagePtr: Long, bitmap: Bitmap, dpi: Int, startX: Int, startY: Int, drawSizeHor: Int, drawSizeVer: Int, renderAnnot: Boolean, docPtr: Long)
Link copied to clipboard

Create new document from file

fun newDocument(fileDescriptor: ParcelFileDescriptor, password: String?)

Create new document from file with password

Link copied to clipboard
fun openPage(pageIndex: Int): Long

Open page and store native pointer

fun openPage(fromIndex: Int, toIndex: Int): LongArray

Open range of pages and store native pointers

Link copied to clipboard
fun recursiveGetBookmark(tree: ArrayList<Bookmark>, bookmarkPtr: Long)
Link copied to clipboard
fun renderPage(surface: Surface, pageIndex: Int, startX: Int, startY: Int, drawSizeX: Int, drawSizeY: Int, renderAnnot: Boolean = false)

Render page fragment on Surface.

Page must be opened before rendering.

Link copied to clipboard
fun renderPageBitmap(bitmap: Bitmap, pageIndex: Int, startX: Int, startY: Int, drawSizeX: Int, drawSizeY: Int, renderAnnot: Boolean = false)

Render page fragment on Bitmap. This method allows to render annotations.

Page must be opened before rendering.