modern-pdf-lib / DownscaleOptions
Interface: DownscaleOptions
Defined in: src/assets/image/imageOptimize.ts:24
Options for image downscaling.
Extended by
Properties
algorithm?
readonlyoptionalalgorithm:"nearest"|"bilinear"|"lanczos"
Defined in: src/assets/image/imageOptimize.ts:56
Resampling algorithm.
'nearest': Nearest-neighbor (fast, blocky)'bilinear': Bilinear interpolation (good quality, moderate speed)'lanczos': Lanczos-3 resampling (best quality, slowest)
Default: 'bilinear'.
maxHeight?
readonlyoptionalmaxHeight:number
Defined in: src/assets/image/imageOptimize.ts:28
Target maximum height in pixels. The image is scaled proportionally.
maxWidth?
readonlyoptionalmaxWidth:number
Defined in: src/assets/image/imageOptimize.ts:26
Target maximum width in pixels. The image is scaled proportionally.
printHeight?
readonlyoptionalprintHeight:number
Defined in: src/assets/image/imageOptimize.ts:47
Intended print height in points (1/72 inch). Used together with targetDpi to compute the target pixel dimensions.
printWidth?
readonlyoptionalprintWidth:number
Defined in: src/assets/image/imageOptimize.ts:42
Intended print width in points (1/72 inch). Used together with targetDpi to compute the target pixel dimensions.
targetDpi?
readonlyoptionaltargetDpi:number
Defined in: src/assets/image/imageOptimize.ts:37
Target DPI for the image at its intended print size. If specified along with printWidth / printHeight, the image is downscaled to match the target DPI.
For example, a 3000×2000 image printed at 10×6.67 inches would be 300 DPI. Setting targetDpi: 150 would downscale to 1500×1000.