InstantPdfUiFragment

Experimental API - Might change in the future.

Instant version of [PdfUiFragment] that supports Instant PDF documents. This fragment provides the same UI as [InstantPdfActivity] but can be embedded in any view hierarchy.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open override fun getDocument(): InstantPdfDocument?

Returns the PdfDocument that is loaded into this pdf UI, or null if no document has been loaded yet.

Link copied to clipboard

Returns the coordinator responsible for displaying documents and switching between multiple loaded documents.

Link copied to clipboard
open override fun getPdfFragment(): InstantPdfFragment?

Returns the PdfFragment that is used to show the document.

Link copied to clipboard
open override fun onAuthenticationFailed(instantDocument: InstantPdfDocument, error: InstantException)

Called when authentication with Instant Server (Nutrient Document Engine) has failed.

Link copied to clipboard
open override fun onAuthenticationFinished(instantDocument: InstantPdfDocument, validJwt: String)

Called when authentication with Instant Server (Nutrient Document Engine) has successfully finished.

Link copied to clipboard
open override fun onDocumentCorrupted(instantDocument: InstantPdfDocument)

Called when InstantPdfDocument has detected data corruption.

Link copied to clipboard
open override fun onDocumentInvalidated(instantDocument: InstantPdfDocument)

Called when InstantPdfDocument becomes invalid. Any future instant operations on this document will fail.

Link copied to clipboard
open override fun onDocumentStateChanged(instantDocument: InstantPdfDocument, state: InstantDocumentState)

Called when the document changes its state.

Link copied to clipboard
open override fun onSyncError(instantDocument: InstantPdfDocument, error: InstantException)

Called when annotation sync has been finished with an error.

Link copied to clipboard
open override fun onSyncFinished(instantDocument: InstantPdfDocument)

Called when annotation sync has been finished successfully.

Link copied to clipboard
open override fun onSyncStarted(instantDocument: InstantPdfDocument)

Called when annotation sync has been started.

Link copied to clipboard

Returns the PdfFragment that is used to show the document. Throws an exception when PdfFragment is not yet initialized.

Link copied to clipboard
fun setDocument(serverUrl: String, jwt: String)

Loads a new Instant document in this activity and replaces the existing one. This method may only be called if PdfUiFragment.onSaveInstanceState has not been called or an exception will be thrown, since after that call state loss could occur.

Link copied to clipboard
open override fun setDocumentFromDataProvider(dataProvider: DataProvider, password: String?)

Loads a new document in this activity and replaces the existing one. This method may only be called if onSaveInstanceState has not been called or an exception will be thrown, since after that call state loss could occur.

Link copied to clipboard
open override fun setDocumentFromDataProviders(dataProviders: List<DataProvider?>, passwords: List<String?>?)

Loads a new document in this pdf UI and replaces the existing one. This method may only be called if onSaveInstanceState has not been called or an exception will be thrown, since after that call state loss could occur.

Link copied to clipboard
open override fun setDocumentFromUri(documentUri: Uri, password: String?)

Loads a new document in this activity and replaces the existing one. This method may only be called if onSaveInstanceState has not been called or an exception will be thrown, since after that call state loss could occur.

Link copied to clipboard
open override fun setDocumentFromUris(documentUris: List<Uri?>, passwords: List<String?>?)

Loads a new document in this activity and replaces the existing one. This method may only be called if onSaveInstanceState has not been called or an exception will be thrown, since after that call state loss could occur.