com.pspdfkit.listeners.DocumentListener |
Listeners for document events on the the PdfFragment
.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
abstract boolean |
onDocumentClick()
Called when the user taps / clicks on the document, not the page itself but on the side (if
visible).
| ||||||||||
abstract void |
onDocumentLoadFailed(Throwable exception)
Called if document loading has failed.
| ||||||||||
abstract void |
onDocumentLoaded(PdfDocument document)
Called when document is successfully loaded and the document view has been laid out.
| ||||||||||
abstract boolean |
onDocumentSave(PdfDocument document, DocumentSaveOptions saveOptions)
Called before document will be saved.
| ||||||||||
abstract void |
onDocumentSaveCancelled(PdfDocument document)
Called if document saving has been cancelled.
| ||||||||||
abstract void |
onDocumentSaveFailed(PdfDocument document, Throwable exception)
Called if document saving has failed.
| ||||||||||
abstract void |
onDocumentSaved(PdfDocument document)
Called after the document has been saved.
| ||||||||||
abstract void |
onDocumentZoomed(PdfDocument document, int pageIndex, float scaleFactor)
Called when a user zooms a document.
| ||||||||||
abstract void |
onPageChanged(PdfDocument document, int pageIndex)
Called when user scrolled to a new page.
| ||||||||||
abstract boolean |
onPageClick(PdfDocument document, int pageIndex, MotionEvent event, PointF pagePosition, Annotation clickedAnnotation)
Called when user taps / clicks on the page.
| ||||||||||
abstract void |
onPageUpdated(PdfDocument document, int pageIndex)
Called when content of page with pageIndex has changed (for example due to annotation or form
field being updated).
|
Called when the user taps / clicks on the document, not the page itself but on the side (if visible).
true
if tap is handled or false
if PSPDFKit should execute it's
default action.
Called if document loading has failed.
exception | Cause of the loading failure. |
---|
Called when document is successfully loaded and the document view has been laid out. This has to be called on the main thread.
document | Loaded document instance. |
---|
Called before document will be saved. This callback allows cancellation of the save process.
document | Instance of document to be saved. |
---|---|
saveOptions | Save options to be applied to the document. You may change parameters on this object to control how document is saved. |
true
if the document should be saved, false
if saving should be
cancelled.
Called if document saving has been cancelled.
document | Instance of document that was saved. |
---|
Called if document saving has failed.
exception | Cause of the saving failure if applicable. |
---|
Called after the document has been saved.
document | Instance of document that was saved. |
---|
Called when a user zooms a document.
document | Current document. |
---|---|
pageIndex | The number of the page that the was zoomed. |
scaleFactor | The current scale factor. |
Called when user scrolled to a new page.
document | Currently opened document. |
---|---|
pageIndex | Page number of new page. |
Called when user taps / clicks on the page.
document | Currently opened document. |
---|---|
pageIndex | Page number of the page being tapped. |
event | MotionEvent that triggered this page click. May be null if this
page click was triggered from keyboard or accessibility event. |
pagePosition | Tapped page position (in PDF page coordinates with origin on bottom
left). Coordinates passed here may exceed the page size (which is returned by getPageSize(int) ) and can also be negative. If the click was triggered by
the keyboard, pagePosition will be null . |
clickedAnnotation | Annotation that was tapped, or null if no annotation was
tapped. |
true
if tap was handled by this DocumentListener
and should not be
handled by PSPDFKit anymore. If returning false
PSPDFKit will continue executing
it's default action.
Called when content of page with pageIndex has changed (for example due to annotation or form field being updated). All views displaying this page need to refresh.
pageIndex | Page index of the updated page. Page index is 0-based. |
---|