EditablePdfDocument


public abstract class EditablePdfDocument implements PdfDocument


Represents a PDF document that allows for editing.

Summary

Public constructors

Public methods

abstract void

Applies the changes specified by record to the form.

abstract @NonNull PdfWriteHandle

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

Inherited methods

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

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

abstract int

The type of form present in the document.

abstract @NonNull List<@NonNull FormWidgetInfo>
getFormWidgetInfos(int pageNum, long types)

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

abstract @NonNull PdfDocument.BitmapSource
getPageBitmapSource(int pageNumber)

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

abstract PdfDocument.PdfPageContent
getPageContent(int pageNumber)

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

abstract int

The total number of pages in the document.

abstract @NonNull PdfDocument.PageInfo
getPageInfo(int pageNumber)

Asynchronously retrieves information about the specified page.

abstract @NonNull PdfDocument.PageInfo
getPageInfo(int pageNumber, long pageInfoFlags)

Asynchronously retrieves information about the specified page.

abstract @NonNull List<@NonNull PdfDocument.PageInfo>

Asynchronously retrieves information about a range of pages.

abstract @NonNull List<@NonNull PdfDocument.PageInfo>
getPageInfos(@NonNull IntRange pageRange, long pageInfoFlags)

Asynchronously retrieves information about a range of pages.

abstract @NonNull PdfDocument.PdfPageLinks
getPageLinks(int pageNumber)

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

abstract @NonNull RenderParams

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

abstract PageSelection
getSelectionBounds(
    int pageNumber,
    @NonNull PointF start,
    @NonNull PointF stop
)

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

abstract @NonNull Uri

The URI of the document represented by this object

abstract boolean

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

abstract void

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

abstract @NonNull SparseArray<@NonNull List<@NonNull PageMatchBounds>>

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

Public constructors

EditablePdfDocument

Added in 1.0.0-alpha13
public EditablePdfDocument()

Public methods

applyEdit

Added in 1.0.0-alpha13
public abstract void applyEdit(@NonNull FormEditInfo record)

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
@NonNull FormEditInfo record

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
public abstract @NonNull PdfWriteHandle createWriteHandle()

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