PDFView
A view for displaying and interacting with PDF documents. It supports features like animation, zoom, caching, and swiping.
The PDF document is rendered as if we want to draw all pages side-by-side, with only the visible portions actually drawn on the screen. All parts are rendered at the same size to optimize performance and allow for interruption of native rendering. Parts are loaded when the offset or zoom level changes.
Properties
The index of the current sequence
If you picture all the pages side by side in their optimal width, and taking into account the zoom level, the current offset is the position of the left border of the screen in this big picture
If you picture all the pages side by side in their optimal width, and taking into account the zoom level, the current offset is the position of the left border of the screen in this big picture
Returns null if document is not loaded
Get current position as ratio of document length to visible area. 0 means that document start is visible, 1 that document end is visible
Will be empty until document is loaded
Functions
Handle fling animation
Checks if whole document can be displayed on screen, doesn't include zoom
Get page number at given offset
Move relatively to the current position.
Change the zoom level, relatively to a pivot point. It will call moveTo() to make sure the given point stays in the middle of the screen.
Inherited functions
Load PDF from a URI. Useful for content providers.
Load PDF using custom DocumentSource.
Load PDF from a file.
Load PDF from an {@link InputStream}. The stream is converted to a byte array, since native code does not support direct stream handling.
Load PDF from a byte array. Document is not saved on disk.
Load PDF from the assets file.