QgsLayoutExporter::ImageExportSettings struct

Contains settings relating to exporting layouts to raster images.

Constructors, destructors, conversion operators

ImageExportSettings()
Constructor for ImageExportSettings.

Public variables

QgsMargins cropMargins
Crop to content margins, in pixels.
bool cropToContents
Set to true if image should be cropped so only parts of the layout containing items are exported.
double dpi
Resolution to export layout at. If dpi <= 0 the default layout dpi will be used.
bool exportMetadata
Indicates whether image export should include metadata generated from the layout's project's metadata.
QgsLayoutRenderContext::Flags flags
Layout context flags, which control how the export will be created.
bool generateWorldFile
Set to true to generate an external world file alongside exported images.
QSize imageSize
Manual size in pixels for output image.
QList<int> pages
List of specific pages to export, or an empty list to export all pages.

Variable documentation

QgsMargins QgsLayoutExporter::ImageExportSettings::cropMargins

Crop to content margins, in pixels.

These margins will be added to the bounds of the exported layout if cropToContents is true.

bool QgsLayoutExporter::ImageExportSettings::exportMetadata

Indicates whether image export should include metadata generated from the layout's project's metadata.

QSize QgsLayoutExporter::ImageExportSettings::imageSize

Manual size in pixels for output image.

If imageSize is not set then it will be automatically calculated based on the output dpi and layout size.

If cropToContents is true then imageSize has no effect.

Be careful when specifying manual sizes if pages in the layout have differing sizes! It's likely not going to give a reasonable output in this case, and the automatic dpi-based image size should be used instead.

QList<int> QgsLayoutExporter::ImageExportSettings::pages

List of specific pages to export, or an empty list to export all pages.

Page numbers are 0 index based, so the first page in the layout corresponds to page 0.