Skip to main content
CESDK/Web/Guides

Exporting Pages

Learn which export options CreativeEditor SDK offers and how to use them.

Exporting via the Export button#

When a user triggers an export by clicking the corresponding button, the editor will export the current page to a PDF or PNG image and notify the onExport callback if configured. The callback handler receives the encoded data as a Blob object along with the options used during export.

Besides the onExport callback, you have to enable the export button in the navigation bar. See the configuration of elements for further information.

Exporting Programmatically#

Exporting via the CreativeEditorSDK.export endpoint allows fine-grained control of the target format. CE.SDK currently supports exporting images as PNG, JPEG, and TGA. To specify the desired type, just pass in the corresponding mimeType. Pass additional options in a mime-type specific object:

const options = {
mimeType: "image/jpeg",
jpegQuality: 0.5
}
FormatMimeTypeOptions (Default)
Format
PNG
MimeType
image/png
Options (Default)
pngCompressionLevel (5) - The compression level is a trade-off between file size and encoding/decoding speed, but doesn't affect quality. Valid values are [0-9] ranging from no to maximum compression.
Format
JPEG
MimeType
image/jpeg
Options (Default)
jpegQuality (0.9) - Directly influences the resulting files visual quality. Smaller = worse quality, but lower file size. Valid values are (0-1]
Format
TGA
MimeType
image/x-tga
Options (Default)
 
Format
PDF
MimeType
application/pdf
Options (Default)
 

Certain formats allow additional configuration, e.g. options.jpegQuality controls the output quality level when exporting to JPEG. These format-specific options are ignored when exporting to other formats. To control which pages should be included in the export, use the options.pages parameter. This expects a list of page indices and defaults to all pages.

When triggering CreativeEditorSDK.export, the onExport callback is not triggered.