Search Docs
Loading...
Skip to content

Interface: ExportOptions

Options for exporting images

Properties#

Property Type Default value Description
mimeType? "application/pdf" "application/octet-stream"
pngCompressionLevel? number undefined PNG compression level (0-9)
jpegQuality? number undefined JPEG quality (0-1)
webpQuality? number undefined WebP quality (0-1)
targetWidth? number undefined Target width for export. Without a target height, the height follows from the block’s aspect ratio.
targetHeight? number undefined Target height for export. Without a target width, the width follows from the block’s aspect ratio.
exportPdfWithHighCompatibility? boolean undefined Export PDF with high compatibility. When outputProfileMode is not 'Off', or with embedProfiles, a rasterized image converts or is tagged from its rendered RGB. The profile of each image and the original bytes of a CMYK JPEG reach the file only with this option off.
exportPdfWithDeviceCMYK? boolean undefined Export PDF with DeviceCMYK color space (instead of sRGB) for prepress workflows. A PDF export reads it only while outputColorSpace is 'RGB', outputProfileMode is 'Off' and embedProfiles is off. Deprecated Set outputColorSpace to 'CMYK' instead, which writes the same file.
outputColorSpace? "RGB" "CMYK" undefined
outputProfileMode? "Off" "Convert" "Assign"
embedProfiles? boolean undefined Write the Output profile of outputColorSpace as the OutputIntent, and the default color spaces, into the PDF. With outputProfileMode 'Off', each image keeps its samples. A tagged image keeps its profile as its tag, unless the engine cannot use that profile and decodes the image to sRGB. An untagged CMYK JPEG gets the document CMYK profile, so every embedding export resolves that profile. The export waits for that profile, and fails with COLOR.PROFILE_MISSING only when the bundled fallback does not load either. An untagged RGB or gray image stays untagged. A PNG gamma chunk can give an RGB image a color space, which then tags it. A CMYK JPEG whose EXIF orientation is not up is written as RGB samples. An image under an effect, in a blurred group or with an imported definition is written from its RGB raster. When the export must decode a CMYK JPEG and cannot, as with a side above 20000 pixels, it fails with COLOR.IMAGE_DECODE_FAILED. With exportPdfWithHighCompatibility off, a JPEG, PNG or WebP image is written at its native size. An image that does not fit in memory at that size fails the export with ENCODE.INSUFFICIENT_RESOURCES. A JPEG keeps its original bytes when its EXIF orientation is up, and a CMYK JPEG also needs the Adobe marker. A PDF export waits for an Output profile that is still loading. It fails when the slot is empty or the profile does not load, and it accepts a profile that cannot convert. A profile that never answers fails the export with COLOR.PROFILE_MISSING after the time that the setting exportPendingTimeoutSeconds allows. A PNG, JPEG or WebP export writes one profile into the file. With 'Convert' or 'Assign', it is the exact Output 'RGB' profile, and 'Assign' writes it also without this option. With 'Off', it is the profile of the working space, and the export does not read the Output profile. A TGA, raw data or SVG export fails with ENCODE.OUTPUT_PROFILE_UNSUPPORTED_FORMAT, and a color mask export with ENCODE.COLOR_MASK_OUTPUT_PROFILE_UNSUPPORTED. Defaults to false.
preserveBlack? boolean undefined Keep black as black ink where outputProfileMode converts a color. An exact RGB black becomes 0/0/0/100 K in a CMYK output. A K-only black becomes exact RGB black in an RGB output. Images and PNG, JPEG and WebP exports ignore this option. Ignored when outputProfileMode is 'Off'. Defaults to false.
exportPdfWithUnderlayer? boolean undefined Export PDF with underlayer
underlayerSpotColorName? string undefined Spot color name for underlayer
underlayerOffset? number undefined Underlayer offset
underlayerRenderRatio? number undefined Resolution multiplier for the raster pass that extracts the underlayer contour. Higher values produce sharper underlayer outlines at the cost of memory and export time. Useful for small text on large pages. Values <= 0 fall back to 1.0.
underlayerMaxError? number undefined Maximum acceptable curve-fit error, in pixels, when vectorising the underlayer contour. Smaller values produce tighter fits at the cost of more path complexity. Values <= 0 fall back to 2.0.
underlayerMinFeatureWidth? number undefined The width that a part of the underlayer keeps at least when a negative underlayerOffset shrinks it, in the same unit as underlayerOffset. A part that the shrink would make thinner keeps this width along its middle, and a part that is already thinner keeps its own shape. No effect when underlayerOffset is 0 or more. Values <= 0 turn it off.
allowTextOverhang? boolean undefined Allow text to extend beyond block boundaries
exportArea? ExportArea undefined Export only this rectangle of the block instead of its whole bounds. See ExportArea. Not supported for PDF.
exportPdfWithCropMarks? boolean undefined Draw crop marks outside the bleed on every exported PDF page. Crop marks are the four pairs of corner lines that show a print shop where to cut. They are painted in the PDF registration colorant All, so they appear on every separation. Crop marks draw no fold marks: exportPdfWithFoldMarks asks for those. This grows the PDF MediaBox, because the marks live outside the bleed. The page content, the TrimBox and the BleedBox keep describing the same physical rectangles. A page whose trim is not a rectangle gets no marks and no larger page.
exportPdfWithFoldMarks? boolean false Draw fold marks outside the bleed on each exported PDF page of a page with page slices. A fold is at the start of each visible page slice that follows another visible page slice. A fold mark is a line on the extension of the fold, one on each side of the page. It is drawn as a crop mark line, with the offset, weight and length of the crop marks, in the PDF registration colorant All. A fold never moves or removes a registration mark. At a fold in the middle of a page edge, the fold mark lies over the registration mark. This grows the PDF MediaBox of a page with folds on the same terms as exportPdfWithCropMarks. A page without folds, and a PDF page of one page slice, gets no fold marks and no larger sheet.
exportPdfWithRegistrationMarks? boolean false Draw registration marks outside the bleed on every exported PDF page. A registration mark is the bullseye target a press operator aligns the plates by. One sits at the middle of each page edge, and each is painted in the PDF registration colorant All, so they appear on every separation. This grows the PDF MediaBox on the same terms as exportPdfWithCropMarks, and a page whose trim is not a rectangle gets no marks either. A registration mark has one fixed size, so there is no knob for it.
exportPdfPageSlices? boolean false Export each page slice of a page as its own PDF page, in reading order. Applies to the PDF export of a scene or of one page. Each PDF page holds the part of the page inside the page slice. It has the bleed of the page on all four sides. With a bleed or printer’s marks, it has a TrimBox and a BleedBox, as a page has. At a fold, the bleed strip shows the content across the fold. A hidden page slice gets no PDF page. It keeps its room in the layout, and the content it owns shows in no PDF page. A page that is not included in the export keeps its PDF pages, without content. A page that is exported itself always gives a PDF page, and an export never gives a PDF with no page because of this option. A page without page slices stays one PDF page. A page slice that is not included in the export keeps its PDF page, without its own fill and stroke. A PDF page of one page slice gets no fold marks.
printMarkOffset? number undefined Distance from the trim to the nearest edge of any printer’s mark, in design units, so it is comparable with the page bleed. A negative value falls back to the equivalent of 6 pt; 0 is a real offset that places a mark on the trim edge. A mark may reach into the bleed, and every mark carries a white knockout underneath so it stays legible over artwork.
cropMarkLength? number undefined Length of one crop mark line and of one fold mark line, in design units. Values <= 0 fall back to 15 pt.
printMarkWidth? number undefined Stroke width of any printer’s mark, in points. Values <= 0 fall back to 0.25.
pdfImageQuality? number undefined The encoding quality to use for images that have to be rasterized during PDF export, e.g. images with effects or blurs applied, or any bitmap image when exportPdfWithHighCompatibility is enabled. Valid values are (0-1]. Exactly 1.0 (the default) keeps the lossless encoding, like webpQuality. Any value below 1.0 re-encodes rasterized images as lossy JPEG at the given quality, which produces much smaller files. Only rasterized content that is fully opaque can be re-encoded, because JPEG has no alpha channel. Content that keeps transparency, for example when exporting a block or a page without a background fill, stays losslessly encoded whatever this option is set to. Images whose original JPEG data is embedded directly are never re-encoded and are not affected by this option. Images that outputProfileMode converts stay lossless too. A CMYK JPEG that embedProfiles writes as samples stays lossless too.
pdfChunkSize? number undefined Upper bound, in bytes, for a single chunk of PDF output. A larger value lowers the per-chunk overhead and raises the memory each chunk costs. A smaller value does the opposite. Values outside [4096, 67108864] are clamped into that range. Defaults to an engine-chosen size.
onProgress? (exportedPages, totalPages) => void undefined Progress callback. For a PDF, invoked after each page has been serialized into the document with the number of pages exported so far and the total number of pages. For a PNG, JPEG, WebP, TGA or raw export that renders in more than one strip, invoked after each strip with the number of strips rendered so far and the total number of strips. engine.block.export runs it between two strips of one render, so it must not change the scene.
abortSignal? AbortSignal undefined Cancels the export when it aborts. The promise rejects at once, and the engine frees the export in its next update.