WritableDataProvider

WritableDataProvider is an interface which should be implemented by any DataProvider that should support saving PDF documents. Classes implementing this interface must implement all methods from this interface and from DataProvider interface for document loading and saving to work properly.

Classes implementing this interface need to implement all methods correctly to allow PSPDFKit loading documents. Furthermore, if classes with this interface are meant to be used with PdfActivity, they must also implement android.os.Parcelable. If you plan to use the DataProvider only for PdfFragment parcelation code is not necessary.

All callbacks will be called on a background thread.

Inheritors

Types

Link copied to clipboard
Describes possible write modes for the output.

Functions

Link copied to clipboard
abstract fun canWrite(): Boolean
Indicates whether this data provider is writable.
Link copied to clipboard
abstract fun finishWrite(): Boolean
Called by PSPDFKit after all data has been written via write method.
Link copied to clipboard
Called before writing to the file begins so the provider can prepare file output.
Link copied to clipboard
abstract fun supportsAppending(): Boolean
Reports whether this provider supports appending to output file as opposed to always rewriting it.
Link copied to clipboard
abstract fun write(data: Array<Byte>): Boolean
Called by PSPDFKit to write data to the document.