PdfRenderSpec

sealed interface PdfRenderSpec

How PdfView turns pages into pixels. Pick a variant; each carries only the knobs that actually apply to it, so there are no settings that silently do nothing. Defaults to Rasterized via PdfRenderSpec.Default.

Inheritors

Types

Link copied to clipboard
object Companion
Link copied to clipboard
data class Rasterized(val quality: Float = 1.0f, val maxBitmapLongSide: Int = 4096, val rerasterizeOnZoom: Boolean = true, val preserveHairlines: Boolean = true) : PdfRenderSpec

Vector-render each page once into a bitmap per size/zoom bucket, then draw that bitmap and GPU-transform it during gestures — so scrolling and zoom never re-execute the content stream. Heavy gesturing is cheap and content-independent; the costs are one rasterization hitch per bucket and softness when zoomed past the raster resolution until the zoom settles and it re-rasterizes. Best for slow devices and dense pages.

Link copied to clipboard
data class Vectorized(val hairlineWidthPx: Float = 1.0f) : PdfRenderSpec

Re-execute each page's content stream into a live Canvas every composition, transformed by zoom/pan via the same GPU layer — no bitmap (lower memory), resolution-independent quality at rest on every platform. On Android the vector display list replays under the live transform, so it stays crisp even mid-pinch; on Skia targets (iOS/desktop/web) the layer is texture-cached, so deep in-gesture zoom softens until the draw re-runs. Per-page draw cost scales with content complexity. Best for simple pages, deep-zoom crispness, and low memory.