| Latest Update | Stable Release | Release Candidate | Beta Release | Alpha Release |
|---|---|---|---|---|
| October 22, 2025 | - | - | - | 1.0.0-alpha11 |
Declaring dependencies
To add a dependency on pdf, you must add the Google Maven repository to your project. Read Google's Maven repository for more information.
Add the dependencies for the artifacts you need in the build.gradle file for
your app or module:
Groovy
dependencies { implementation "androidx.pdf:pdf-viewer-fragment:1.0.0-alpha11" }
Kotlin
dependencies { implementation("androidx.pdf:pdf-viewer-fragment:1.0.0-alpha11") }
For more information about dependencies, see Add build dependencies.
Feedback
Your feedback helps make Jetpack better. Let us know if you discover new issues or have ideas for improving this library. Please take a look at the existing issues in this library before you create a new one. You can add your vote to an existing issue by clicking the star button.
See the Issue Tracker documentation for more information.
There are no release notes for this artifact.
Version 1.0
Version 1.0.0-alpha11
October 22, 2025
androidx.pdf:pdf-*:1.0.0-alpha11 is released. Version 1.0.0-alpha11 contains these commits.
New Features
- Enabling Smart Menu Items on pdf content selection.
- Enabling hyperlink selection and GoTo link selection in pdf.
- Exposing selection menu api
fromPdfViewandPdfViewerComposable, which allows developers to add selection menu items. - Adding page alignment api in PdfView and PdfViewer Composable which allows developers to choose the page alignment when the content height < viewport height.
API Changes
- Made
contentDescnullable and removed default value. (I86f8c, b/441973880) - Expose
PdfSelectionMenuKeysfor Link Selection Menu Items (Ic9b05, b/447079082) - Add
PageAlignmentAPI toPdfViewandPdfViewerinto androidx-main - Change angle-related API to use degrees and include unit in names, be clear about units in Angle conversion utilities and support both degrees and radians, change
StockBrushesAPI to take stock brush version as a factory function parameter and expose self-overlap behavior control for highlighter brushes, renameMutableAffineTransform.populateFromTranslatetopopulateFromTranslation, removeInProgressStrokesView.setRenderFactory/getRenderFactory. (Id9eab, b/436656418) - Add
PageAlignmentAPI toPdfViewandPdfViewer(I9c9a5, b/438065228) - Expose Selection Menu API from
PdfViewerComposable (Id9b0f, b/407663999) - Make
PdfViewaViewGroup. No support for arbitrary children. (Ib51d8, b/410008792) - Expose
HyperLinkSelectionandGoToLinkSelectionfromPdfView(I378c4, b/441280002) - Refactor
PdfPageContentto support generic selections (I28f16, b/437845185) - Expose Selection Menu API from
PdfView(Idd547, b/407663737) - Move selection-related classes to a dedicated package (I953cb, b/436157691)
- Introduce experimental
onPdfViewCreatedfor PdfView access inPdfViewerFragment. (I86715, b/422620454) - Adds
FileDescriptorAPI toPdfLoader(I60b8d)
Bug Fixes
- Improve input modeling to make strokes more accurately reflect input (I93097)
External Contribution
- Expose
PdfSelectionMenuKeysfor Link Selection Menu Items - Expose Selection Menu API from
PdfViewerComposable - Expose Selection Menu API from
PdfView
Version 1.0.0-alpha10
July 16, 2025
androidx.pdf:pdf-*:1.0.0-alpha10 is released. Version 1.0.0-alpha10 contains these commits.
New Features
- Enhanced selection that allows users to select text across multiple pages by dragging selection handles beyond page boundaries.
- Applications can now intercept and customize the handling of hyperlink clicks within PDF documents.
API Changes
- Exposes a Composable for presenting PDF content (I8e7ee)
- Moving
PdfPointandPdfRecttoandroidx.pdf.modelspackage (I26cf4) - Exposes a View component for presenting PDF content (I9fe27)
- Exposes API to initialize pdf resources ahead of time and bring down cold-start latency (a18fa89)
- Exposes API to override hyperlink click handling on Pdf content(6330a8b)
- Exposes a new artifact pdf-document-service and the corresponding APIs -
PdfLoader,PdfDocumentandSandboxedPdfLoader. The interfaces can be used to implement the parsing and processing component of the PDF document (Ide70d) - Exposes an API to set
PdfDocumentonPdfViewto initialize rendering of the document (If8738)
Version 1.0.0-alpha09
May 7, 2025
androidx.pdf:pdf-*:1.0.0-alpha09 is released. Version 1.0.0-alpha09 contains these commits.
Major Changes
- The codebase has undergone a major refactoring and is now fully written in Kotlin, utilizing Coroutines and
ViewModel. This includes a reimplementation of thePdfViewerFragment. This release does not include any new APIs or features.
Known Issues:
- The fast scroller and page indicator are missing shadow effects.
- Single-page PDF documents might not always be centered and scaled to the view's width.
API Changes
- Annotate
containerStyleResIdwith@StyleRes. (I88d85)
Version 1.0.0-alpha08
March 12, 2025
androidx.pdf:pdf-document-service:1.0.0-alpha08, androidx.pdf:pdf-viewer:1.0.0-alpha08, and androidx.pdf:pdf-viewer-fragment:1.0.0-alpha08 are released. Version 1.0.0-alpha08 contains these commits.
Bug Fixes
- Resolved inconsistent selection menu placement between different Android devices due to scaling differences. Selection menu placement is now consistent across devices.
- Aligned fast scroller and page indicator position on fragment recreation in scenarios like config change, etc.
Version 1.0.0-alpha07
February 26, 2025
androidx.pdf:pdf-document-service:1.0.0-alpha07, androidx.pdf:pdf-viewer:1.0.0-alpha07, and androidx.pdf:pdf-viewer-fragment:1.0.0-alpha07 are released. Version 1.0.0-alpha07 contains these commits.
New Features
- The
PdfViewerFragmentnow supportsStylingOptions(a set of style resource ids) enabling custom styling vianewInstanceor XML (FragmentContainerView). Subclasses can utilize the protected constructor for similar functionality. StylingOptionscurrently takes incontainerStylewhich provides:- Custom drawable support for the fast scroll handle and page indicator.
marginEndattribute for precise positioning of the fast scroll handle and page indicator.
API Changes
Bug Fixes
- Fixed synchronization discrepancy between the fast scroll handle and page indicator visibility state.
Version 1.0.0-alpha06
January 29, 2025
androidx.pdf:pdf-document-service:1.0.0-alpha06, androidx.pdf:pdf-viewer:1.0.0-alpha06, and androidx.pdf:pdf-viewer-fragment:1.0.0-alpha06 are released. Version 1.0.0-alpha06 contains these commits.
Bug Fixes
- Fix: Crash caused by
IllegalArgumentExceptionwhen unbinding a service that's not registered (eb4e85) - Fix: Crash
IllegalArgumentExceptiondue to difference inmMaxPagesandnumPages. (75d763)
Version 1.0.0-alpha05
December 11, 2024
androidx.pdf:pdf-document-service:1.0.0-alpha05, androidx.pdf:pdf-viewer:1.0.0-alpha05, and androidx.pdf:pdf-viewer-fragment:1.0.0-alpha05 are released. Version 1.0.0-alpha05 contains these commits.
Bug Fixes
- This library now uses JSpecify nullness annotations, which are type-use. Kotlin developers should use the following compiler argument to enforce correct usage:
-Xjspecify-annotations=strict(this is the default starting with version 2.1.0 of the Kotlin compiler). (I38301, b/326456246) - Fixed previously opened page being displayed after rotation in Android 13. (Ib03dd)
- Fixed Toolbox disappearing on Rotation. (01148f)
Version 1.0.0-alpha04
November 13, 2024
androidx.pdf:pdf-viewer:1.0.0-alpha04 and androidx.pdf:pdf-viewer-fragment:1.0.0-alpha04 are released. Version 1.0.0-alpha04 contains these commits.
Expanded Compatibility
- The
PDFViewerlibrary now supports Android versions S, T, U, and V. This enhanced compatibility is linked to the SDK extension 13 update.
API Changes
- Added minimum
SdkExtensionconstraint toPdfViewerFragment. (I922af) - Exposing new apis for PDF Viewer library. (I0af57)
Bug Fixes
- Crash fix for process death issue.
- UI fixes related to the password dialog.
- Accessibility fixes for
findInFileViewandFastscrollView.
Ongoing Development
- We are actively working on incorporating Jetpack Compose into the library.
Version 1.0.0-alpha03
September 18, 2024
androidx.pdf:pdf-viewer:1.0.0-alpha03 and androidx.pdf:pdf-viewer-fragment:1.0.0-alpha03 are released. Version 1.0.0-alpha03 contains these commits.
Bug Fixes
- Keyboard not coming up when search is opened for the first time is resolved
- UI fixes related to the font of FindInFile view.
- UI fixes for text selection and drag handle.
Known Issues
- 3D images in PDF documents are not rendered in the viewer.
PdfViewerFragmenthas some performance issues on very large PDF documents (> 250 MB)
Version 1.0.0-alpha02
September 4, 2024
androidx.pdf:pdf-viewer:1.0.0-alpha02 and androidx.pdf:pdf-viewer-fragment:1.0.0-alpha02 are released. Version 1.0.0-alpha02 contains these commits.
Bug Fixes
- The blurry PDF image issue when rotating from portrait to landscape and the app going to sleep has been resolved.
- The find in file menu now maintains the result count even when the configuration changes.
- The
FloatingActionButtonicon is now available for single-page PDFs. - Overlapping issues between the Find in file bar and the
FloatingActionButtonhave been fixed. - Text and highlight annotations can now be rendered in the viewer.
- Accessibility improvements have been made to the Find in file bar.
- UI fixes have been implemented for rotation, including preserving the find count, addressing the disappearing text selection menu, and resolving the FAB overlapping issue.
- The find in file menu hiding behind the keyboard in landscape mode has been fixed.
Known Issues
- 3D images in PDF documents are not rendered in the viewer.
PdfViewerFragmenthas some performance issues on very large PDF documents (> 250 MB)
Version 1.0.0-alpha01
August 7, 2024
androidx.pdf:pdf-viewer:1.0.0-alpha01 and androidx.pdf:pdf-viewer-fragment:1.0.0-alpha01 are released. Version 1.0.0-alpha01 contains these commits.
New Features
The initial alpha release of PDFViewer includes early preview implementations that enable core PDF reading scenarios. Please note that the PdfViewerFragment is currently supported only on Android V (SDK 35) versions. Support for older Android versions will be added in upcoming releases.
- Introduced
PdfViewerFragmentwhich your app can use to render a PDF document.PdfViewerFragmentsimplifies integrating a PDF viewer in your Activity and lets the users interact in the following ways:- Zooming: Pinch in and out to adjust zoom levels for a comfortable reading experience as well as double tap for a quick zoom in/out to the default state.
- Navigation: Scroll in the default/zoomed state.
PdfViewerFragmentprovides a quick scrubber for fast scrolling between pages. - Text actions: Long tapping on text selects it, allowing users to use options like Copy and Select all on the current page.
- Password-protected documents:
PdfViewerFragmentprovides a dialog box for the user to enter the password and open the document. - Navigable hyperlinks: Users can navigate to Web URLs or bookmarks by tapping on hyperlinks within the PDF.
- Shortcut to annotations mode: Edit mode is not yet supported in
PdfViewerFragment. Instead,PdfViewerFragmentdisplays aFloatingActionButtonthat fires an implicitandroid.intent.action.ANNOTATEintent with the document URI.
API Changes
- Added
PdfViewerFragment.documentUriproperty to set a file or content URI for the document and initiate the document loading.PdfViewerFragmentdisplays a loading spinner when the URI is set indicating the background processing of the document. - Added
PdfViewerFragment.isTextSearchActiveto toggle the visibility of the find in file menu.PdfViewerFragmenthandles the entire flow - allowing input, displaying total number of matches, enabling navigation between results and exiting it. - Added
onDocumentLoadSuccessandonDocumentLoadErrorcallbacks which are invoked after successful rendering of the document or after an error is thrown before the rendering.
Known Issues
- Find in file bar overlaps with the
FloatingActionButtonin some cases. FloatingActionButtonicon isn’t visible for single page PDFs.- Result count is not preserved on configuration change in the find in file menu.
- Flickering is observed while closing the find in file menu
- 3D images in PDF documents are not rendered in the viewer.
- Accessibility features will be enabled in the following releases.
- PDF image gets blurry on rotating from portrait to landscape.
- No support for text/highlight annotation.
PdfViewerFragmenthas some performance issues on very large PDF documents (> 250 MB)
Note
- Update
compileSdkto 35 5dc41be