EditablePdfDocument


abstract class EditablePdfDocument : PdfDocument


Represents a PDF document that allows for editing.

Summary

Public constructors

Public functions

abstract suspend Unit

Applies the changes specified by record to the form.

abstract PdfWriteHandle

Creates a PdfWriteHandle which can be used to save the document to a ParcelFileDescriptor.

Inherited functions

From java.io.Closeable
abstract Unit
From androidx.pdf.PdfDocument
abstract Unit

Adds a listener to receive notifications when some regions of the PDF content are invalidated.

abstract suspend List<FormWidgetInfo>
getFormWidgetInfos(pageNum: Int, types: Long)

Returns the list of FormWidgetInfo on pageNum, optionally filtered by widget type.

abstract PdfDocument.BitmapSource
getPageBitmapSource(pageNumber: Int)

Gets a BitmapSource for retrieving bitmap representations of the specified page.

abstract suspend PdfDocument.PdfPageContent?
getPageContent(pageNumber: Int)

Asynchronously retrieves the content (text and images) of the specified page.

abstract suspend PdfDocument.PageInfo
getPageInfo(pageNumber: Int)

Asynchronously retrieves information about the specified page.

abstract suspend PdfDocument.PageInfo
getPageInfo(pageNumber: Int, pageInfoFlags: Long)

Asynchronously retrieves information about the specified page.

abstract suspend List<PdfDocument.PageInfo>
getPageInfos(pageRange: IntRange)

Asynchronously retrieves information about a range of pages.

abstract suspend List<PdfDocument.PageInfo>
getPageInfos(pageRange: IntRange, pageInfoFlags: Long)

Asynchronously retrieves information about a range of pages.

abstract suspend PdfDocument.PdfPageLinks
getPageLinks(pageNumber: Int)

Asynchronously retrieves the links (Go To and external) present on the specified page.

abstract suspend PageSelection?
getSelectionBounds(pageNumber: Int, start: PointF, stop: PointF)

Asynchronously retrieves the selection bounds (in PDF coordinates) for the specified text selection.

abstract Unit

Removes the listener from the list of listeners which are notified when some regions of the PDF content are invalidated.

abstract suspend SparseArray<List<PageMatchBounds>>
searchDocument(query: String, pageRange: IntRange)

Asynchronously searches the document for the specified query within a range of pages.

Inherited properties

From androidx.pdf.PdfDocument
abstract Int

The type of form present in the document.

abstract Boolean

Indicates whether the document is linearized (optimized for fast web viewing).

abstract Int

The total number of pages in the document.

abstract RenderParams

The render params used to determine the contents that will be rendered on the bitmap.

abstract Uri

The URI of the document represented by this object

Public constructors

EditablePdfDocument

Added in 1.0.0-alpha13
EditablePdfDocument()

Public functions

applyEdit

Added in 1.0.0-alpha13
abstract suspend fun applyEdit(record: FormEditInfo): Unit

Applies the changes specified by record to the form.

Any areas which are invalidated due to this operation are notified via OnPdfContentInvalidatedListener callback.

It is recommended to maintain a list of androidx.pdf.models.FormEditInfo applied to the document so they can be saved and restored across destructive events like low memory kills or configuration changes.

Parameters
record: FormEditInfo

The androidx.pdf.models.FormEditInfo to apply to the form.

Throws
IllegalArgumentException

if the provided record cannot be applied to the widget indicated by the index, or if the index does not correspond to a widget on the page.

createWriteHandle

Added in 1.0.0-alpha13
abstract fun createWriteHandle(): PdfWriteHandle

Creates a PdfWriteHandle which can be used to save the document to a ParcelFileDescriptor.