PdfViewerConfiguration

data class PdfViewerConfiguration(val isDebugEnabled: Boolean = false, val thumbnailQuality: Float = 0.7f, val renderTileSize: Float = 512.0f, val preloadMarginDp: Float = 20.0f, val maxCachedBitmaps: Int = 32, val maxCachedPages: Int = 3, val maxCachedThumbnails: Int = 4, val minZoom: Float = 1.0f, val maxZoom: Float = 5.0f)

Class to hold rendering options for a PDF previewer.

Parameters

isDebugEnabled

Whether debug mode is enabled for logging.

thumbnailQuality

The quality of thumbnails (between 0 and 1), with a default of 0.7.

renderTileSize

The size of rendered parts in pixels, with a default of 512.

preloadMarginDp

The number of pages to preload above and below the currently displayed page, in dp.

maxCachedBitmaps

The size of the main bitmap cache, which is the number of bitmaps to be kept in memory.

maxCachedPages

The maximum number of pages kept in view.

maxCachedThumbnails

The size of the thumbnail bitmap cache.

minZoom

The minimum zoom level allowed when pinching.

maxZoom

The maximum zoom level allowed when pinching.

Constructors

Link copied to clipboard
constructor(isDebugEnabled: Boolean = false, thumbnailQuality: Float = 0.7f, renderTileSize: Float = 512.0f, preloadMarginDp: Float = 20.0f, maxCachedBitmaps: Int = 32, maxCachedPages: Int = 3, maxCachedThumbnails: Int = 4, minZoom: Float = 1.0f, maxZoom: Float = 5.0f)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val isDebugEnabled: Boolean = false

Enable debug mode to see logs.

Link copied to clipboard

The size of the cache (number of bitmaps kept).

Link copied to clipboard

Max pages kept in View Increasing this value may cause performance decrease

Link copied to clipboard

The size of the thumbnails cache (number of bitmaps kept).

Link copied to clipboard
val maxZoom: Float = 5.0f

Maximum zoom level.

Link copied to clipboard
val minZoom: Float = 1.0f

Minimum zoom level.

Link copied to clipboard
val preloadMarginDp: Float = 20.0f

Part of the document above and below the screen that should be preloaded, in dp.

Link copied to clipboard
val renderTileSize: Float = 512.0f

The size of the rendered parts (default 512 for better quality). Tinier : a little bit slower to have the whole page rendered but more reactive. Bigger : user will have to wait longer to have the first visual results

Link copied to clipboard

Between 0 and 1, the thumbnails quality (default 0.7). Increasing this value may cause performance decrease.