PDF Viewer then and now — PdfRenderer improvements in Android 15
summary
Covers building a custom Android PDF viewer using the platform PdfRenderer API and Jetpack Compose, including code for Compose lists, scrolling/zoom gestures, and rotation-safe state via ViewModel. Presents fixes for crashes by adding per-renderer page locks and reducing bitmap size to view-size, implements an LRU-like bitmap cache with Coil for disk caching, and documents new Android 15 PdfRenderer features (annotations, search, forms, password handling) plus a demo Compose gestures implementation and an alpha AndroidX PDFFragment running on Android 15+.
AI-written summary · about
chapters (36)
- 0:00Introduction
- 1:07Displaying PDFs on Android
- 2:35Simple PDF viewer
- 4:23Understanding PDFRenderer
- 5:04PDFRenderer from file URI
- 6:07PDF pages to bitmaps
- 7:54Display single page
- 8:17Multi-page PDF list
- 9:24Fixing multi-page crashes
- 10:30Thread-safe page access
- 10:53Zoom and pan gestures
- 12:45Panning restrictions
- 13:54Tap gestures for zoom
- 15:18Finalizing gestures
- 15:39Rotation with ViewModel
- 16:22Optimizing bitmap generation
- 17:50Testing rotation
- 18:13Reducing bitmap memory
- 19:41Bitmap caching
- 21:07Coil for caching
- 23:14Custom vs Coil caching
- 24:20Benchmarking performance
- 25:26Android 15 PDFRenderer features
- 26:52Displaying annotations
- 27:33Password-protected PDFs
- 28:14Extracting PDF content
- 28:58Text search in PDFs
- 29:41Interactive PDF forms
- 31:09Saving edited PDFs
- 31:53AI PDF summarization
- 32:16Form editing workflow
- 33:20AndroidX PDF library
- 34:28Using PDFViewerFragment
- 35:30Testing AndroidX viewer
- 36:40PDF display methods
- 37:24Q&A
related talks
32mOvercoming the Challenges of Integrating an Epub Viewer into a Mo…
43mBuilding for the Future of Android
01h 05mLet's build Android UI with Jetpack Compose
49mBuilding an Android UI using declarative programming in Jetpack Compose
32mReimagining Android Dialogs with Jetpack Compose
38mCutting-Edge-to-Edge in Android 15
35mNext Generation Android UI with Jetpack Compose
33mThe Evolution of Android UI Development. A Journey From XML to Compose. What’s next ?
