type ExportOptions = object;Represents the options for exporting a design block.
Defines the possible options for exporting a design block.
- ‘mimeType’: The MIME type of the output file.
- ‘pngCompressionLevel’: The PNG compression level to use, when exporting to PNG.
- ‘jpegQuality’: The JPEG quality to use when encoding to JPEG.
- ‘webpQuality’: The WebP quality to use when encoding to WebP.
- ‘targetWidth’: An optional target width used in conjunction with target height.
- ‘targetHeight’: An optional target height used in conjunction with target width.
- ‘exportPdfWithHighCompatibility’: Export the PDF document with a higher compatibility to different PDF viewers.
- ‘exportPdfWithUnderlayer’: Export the PDF document with an underlayer.
- ‘underlayerSpotColorName’: The name of the spot color to be used for the underlayer’s fill.
- ‘underlayerOffset’: The adjustment in size of the shape of the underlayer.
- ‘abortSignal’: An abort signal that can be used to cancel the export.
Properties#
| Property | Type | Default value | Description |
|---|---|---|---|
mimeType? | ImageMimeType | Exclude<ApplicationMimeType, "application/zip"> | |
pngCompressionLevel? | number | 5. | The PNG compression level to use, when exporting to PNG. Valid values are 0 to 9, higher means smaller, but slower. Quality is not affected. Ignored for other encodings. |
jpegQuality? | number | 0.9 | The JPEG quality to use when encoding to JPEG. Valid values are (0-1], higher means better quality. Ignored for other encodings. |
webpQuality? | number | undefined | The WebP quality to use when encoding to WebP. Valid values are (0-1], higher means better quality. WebP uses a special lossless encoding that usually produces smaller file sizes than PNG. Ignored for other encodings. Defaults to 1.0. |
targetWidth? | number | undefined | An optional target width used in conjunction with target height. If used, the block will be rendered large enough, that it fills the target size entirely while maintaining its aspect ratio. |
targetHeight? | number | undefined | An optional target height used in conjunction with target width. If used, the block will be rendered large enough, that it fills the target size entirely while maintaining its aspect ratio. |
exportPdfWithHighCompatibility? | boolean | undefined | Export the PDF document with a higher compatibility to different PDF viewers. Bitmap images and some effects like gradients will be rasterized with the DPI setting instead of embedding them directly. |
exportPdfWithUnderlayer? | boolean | undefined | Export the PDF document with an underlayer. An underlayer is generated by adding a graphics block behind the existing elements of the shape of the elements on the page. |
underlayerSpotColorName? | string | undefined | The name of the spot color to be used for the underlayer’s fill. |
underlayerOffset? | number | undefined | The adjustment in size of the shape of the underlayer. |
allowTextOverhang? | boolean | false | If true, the export will include text bounding boxes that account for glyph overhangs. When enabled, text blocks with glyphs that extend beyond their frame (e.g., decorative fonts with swashes) will be exported with the full glyph bounds visible, preventing text clipping. |
abortSignal? | AbortSignal | undefined | An abortsignal that can be used to cancel the export. |