QGIS API Documentation 3.99.0-Master (357b655ed83)
Loading...
Searching...
No Matches
qgsalgorithmlayoutatlastopdf.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgsalgorithmlayoutatlastopdf.cpp
3 ---------------------
4 begin : August 2020
5 copyright : (C) 2020 by Mathieu Pellerin
6 email : nirvn dot asia at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
19
20#include "qgslayout.h"
21#include "qgslayoutatlas.h"
22#include "qgslayoutexporter.h"
23#include "qgslayoutitemmap.h"
24#include "qgslayoututils.h"
25#include "qgsprintlayout.h"
27
28#include <QString>
29
30using namespace Qt::StringLiterals;
31
33
34// QgsLayoutAtlasToPdfAlgorithmBase
35
36QStringList QgsLayoutAtlasToPdfAlgorithmBase::tags() const
37{
38 return QObject::tr( "layout,atlas,composer,composition,save" ).split( ',' );
39}
40
41QString QgsLayoutAtlasToPdfAlgorithmBase::group() const
42{
43 return QObject::tr( "Cartography" );
44}
45
46QString QgsLayoutAtlasToPdfAlgorithmBase::groupId() const
47{
48 return u"cartography"_s;
49}
50
51Qgis::ProcessingAlgorithmFlags QgsLayoutAtlasToPdfAlgorithmBase::flags() const
52{
54}
55
56void QgsLayoutAtlasToPdfAlgorithmBase::initAlgorithm( const QVariantMap & )
57{
58 addParameter( new QgsProcessingParameterLayout( u"LAYOUT"_s, QObject::tr( "Atlas layout" ) ) );
59
60 addParameter( new QgsProcessingParameterVectorLayer( u"COVERAGE_LAYER"_s, QObject::tr( "Coverage layer" ), QList<int>(), QVariant(), true ) );
61 addParameter( new QgsProcessingParameterExpression( u"FILTER_EXPRESSION"_s, QObject::tr( "Filter expression" ), QString(), u"COVERAGE_LAYER"_s, true ) );
62 addParameter( new QgsProcessingParameterExpression( u"SORTBY_EXPRESSION"_s, QObject::tr( "Sort expression" ), QString(), u"COVERAGE_LAYER"_s, true ) );
63 addParameter( new QgsProcessingParameterBoolean( u"SORTBY_REVERSE"_s, QObject::tr( "Reverse sort order (used when a sort expression is provided)" ), false ) );
64
65 auto layersParam = std::make_unique<QgsProcessingParameterMultipleLayers>( u"LAYERS"_s, QObject::tr( "Map layers to assign to unlocked map item(s)" ), Qgis::ProcessingSourceType::MapLayer, QVariant(), true );
66 layersParam->setFlags( layersParam->flags() | Qgis::ProcessingParameterFlag::Advanced );
67 addParameter( layersParam.release() );
68
69 auto dpiParam = std::make_unique<QgsProcessingParameterNumber>( u"DPI"_s, QObject::tr( "DPI (leave blank for default layout DPI)" ), Qgis::ProcessingNumberParameterType::Double, QVariant(), true, 0 );
70 dpiParam->setFlags( dpiParam->flags() | Qgis::ProcessingParameterFlag::Advanced );
71 addParameter( dpiParam.release() );
72
73 auto forceVectorParam = std::make_unique<QgsProcessingParameterBoolean>( u"FORCE_VECTOR"_s, QObject::tr( "Always export as vectors" ), false );
74 forceVectorParam->setFlags( forceVectorParam->flags() | Qgis::ProcessingParameterFlag::Advanced );
75 addParameter( forceVectorParam.release() );
76
77 auto forceRasterParam = std::make_unique<QgsProcessingParameterBoolean>( u"FORCE_RASTER"_s, QObject::tr( "Always export as raster" ), false );
78 forceRasterParam->setFlags( forceRasterParam->flags() | Qgis::ProcessingParameterFlag::Advanced );
79 addParameter( forceRasterParam.release() );
80
81 auto appendGeorefParam = std::make_unique<QgsProcessingParameterBoolean>( u"GEOREFERENCE"_s, QObject::tr( "Append georeference information" ), true );
82 appendGeorefParam->setFlags( appendGeorefParam->flags() | Qgis::ProcessingParameterFlag::Advanced );
83 addParameter( appendGeorefParam.release() );
84
85 auto exportRDFParam = std::make_unique<QgsProcessingParameterBoolean>( u"INCLUDE_METADATA"_s, QObject::tr( "Export RDF metadata (title, author, etc.)" ), true );
86 exportRDFParam->setFlags( exportRDFParam->flags() | Qgis::ProcessingParameterFlag::Advanced );
87 addParameter( exportRDFParam.release() );
88
89 auto disableTiled = std::make_unique<QgsProcessingParameterBoolean>( u"DISABLE_TILED"_s, QObject::tr( "Disable tiled raster layer exports" ), false );
90 disableTiled->setFlags( disableTiled->flags() | Qgis::ProcessingParameterFlag::Advanced );
91 addParameter( disableTiled.release() );
92
93 auto simplify = std::make_unique<QgsProcessingParameterBoolean>( u"SIMPLIFY"_s, QObject::tr( "Simplify geometries to reduce output file size" ), true );
94 simplify->setFlags( simplify->flags() | Qgis::ProcessingParameterFlag::Advanced );
95 addParameter( simplify.release() );
96
97 const QStringList textExportOptions {
98 QObject::tr( "Always Export Text as Paths (Recommended)" ),
99 QObject::tr( "Always Export Text as Text Objects" ),
100 QObject::tr( "Prefer Exporting Text as Text Objects" ),
101 };
102
103 auto textFormat = std::make_unique<QgsProcessingParameterEnum>( u"TEXT_FORMAT"_s, QObject::tr( "Text export" ), textExportOptions, false, 0 );
104 textFormat->setFlags( textFormat->flags() | Qgis::ProcessingParameterFlag::Advanced );
105 addParameter( textFormat.release() );
106
107 const QStringList imageCompressionOptions {
108 QObject::tr( "Lossy (JPEG)" ),
109 QObject::tr( "Lossless" )
110 };
111
112 auto imageCompression = std::make_unique<QgsProcessingParameterEnum>( u"IMAGE_COMPRESSION"_s, QObject::tr( "Image compression" ), imageCompressionOptions, false, 0 );
113 imageCompression->setFlags( imageCompression->flags() | Qgis::ProcessingParameterFlag::Advanced );
114 addParameter( imageCompression.release() );
115}
116
117QVariantMap QgsLayoutAtlasToPdfAlgorithmBase::processAlgorithm( const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingFeedback *feedback )
118{
119 // this needs to be done in main thread, layouts are not thread safe
120 QgsPrintLayout *l = parameterAsLayout( parameters, u"LAYOUT"_s, context );
121 if ( !l )
122 throw QgsProcessingException( QObject::tr( "Cannot find layout with name \"%1\"" ).arg( parameters.value( u"LAYOUT"_s ).toString() ) );
123
124 std::unique_ptr<QgsPrintLayout> layout( l->clone() );
125 QgsLayoutAtlas *atlas = layout->atlas();
126
127 QString expression, error;
128 QgsVectorLayer *layer = parameterAsVectorLayer( parameters, u"COVERAGE_LAYER"_s, context );
129 if ( layer )
130 {
131 atlas->setEnabled( true );
132 atlas->setCoverageLayer( layer );
133
134 expression = parameterAsString( parameters, u"FILTER_EXPRESSION"_s, context );
135 atlas->setFilterExpression( expression, error );
136 atlas->setFilterFeatures( !expression.isEmpty() && error.isEmpty() );
137 if ( !expression.isEmpty() && !error.isEmpty() )
138 {
139 throw QgsProcessingException( QObject::tr( "Error setting atlas filter expression" ) );
140 }
141 error.clear();
142
143 expression = parameterAsString( parameters, u"SORTBY_EXPRESSION"_s, context );
144 if ( !expression.isEmpty() )
145 {
146 const bool sortByReverse = parameterAsBool( parameters, u"SORTBY_REVERSE"_s, context );
147 atlas->setSortFeatures( true );
148 atlas->setSortExpression( expression );
149 atlas->setSortAscending( !sortByReverse );
150 }
151 else
152 {
153 atlas->setSortFeatures( false );
154 }
155 }
156 else if ( !atlas->enabled() )
157 {
158 throw QgsProcessingException( QObject::tr( "Selected layout does not have atlas functionality enabled" ) );
159 }
160
161 const QgsLayoutExporter exporter( layout.get() );
163
164 if ( parameters.value( u"DPI"_s ).isValid() )
165 {
166 settings.dpi = parameterAsDouble( parameters, u"DPI"_s, context );
167 }
168 settings.forceVectorOutput = parameterAsBool( parameters, u"FORCE_VECTOR"_s, context );
169 settings.rasterizeWholeImage = parameterAsBool( parameters, u"FORCE_RASTER"_s, context );
170 settings.appendGeoreference = parameterAsBool( parameters, u"GEOREFERENCE"_s, context );
171 settings.exportMetadata = parameterAsBool( parameters, u"INCLUDE_METADATA"_s, context );
172 settings.simplifyGeometries = parameterAsBool( parameters, u"SIMPLIFY"_s, context );
173 const int textFormat = parameterAsEnum( parameters, u"TEXT_FORMAT"_s, context );
174 switch ( textFormat )
175 {
176 case 0:
178 break;
179 case 1:
181 break;
182 case 2:
184 break;
185 default:
186 break;
187 }
188
189 if ( parameterAsBool( parameters, u"DISABLE_TILED"_s, context ) )
191 else
192 settings.flags = settings.flags & ~static_cast< int >( Qgis::LayoutRenderFlag::DisableTiledRasterLayerRenders );
193
194 if ( parameterAsEnum( parameters, u"IMAGE_COMPRESSION"_s, context ) == 1 )
196 else
197 settings.flags = settings.flags & ~static_cast< int >( Qgis::LayoutRenderFlag::LosslessImageRendering );
198
199 settings.predefinedMapScales = QgsLayoutUtils::predefinedScales( layout.get() );
200
201 const QList<QgsMapLayer *> layers = parameterAsLayerList( parameters, u"LAYERS"_s, context );
202 if ( layers.size() > 0 )
203 {
204 const QList<QGraphicsItem *> items = layout->items();
205 for ( QGraphicsItem *graphicsItem : items )
206 {
207 QgsLayoutItem *item = dynamic_cast<QgsLayoutItem *>( graphicsItem );
208 QgsLayoutItemMap *map = dynamic_cast<QgsLayoutItemMap *>( item );
209 if ( map && !map->followVisibilityPreset() && !map->keepLayerSet() )
210 {
211 map->setKeepLayerSet( true );
212 map->setLayers( layers );
213 }
214 }
215 }
216
217 return exportAtlas( atlas, exporter, settings, parameters, context, feedback );
218}
219
220//
221// QgsLayoutAtlasToPdfAlgorithm
222//
223
224QString QgsLayoutAtlasToPdfAlgorithm::name() const
225{
226 return u"atlaslayouttopdf"_s;
227}
228
229QString QgsLayoutAtlasToPdfAlgorithm::displayName() const
230{
231 return QObject::tr( "Export atlas layout as PDF (single file)" );
232}
233
234QString QgsLayoutAtlasToPdfAlgorithm::shortDescription() const
235{
236 return QObject::tr( "Exports an atlas layout as a single PDF file." );
237}
238
239QString QgsLayoutAtlasToPdfAlgorithm::shortHelpString() const
240{
241 return QObject::tr( "This algorithm outputs an atlas layout as a single PDF file.\n\n"
242 "If a coverage layer is set, the selected layout's atlas settings exposed in this algorithm "
243 "will be overwritten. In this case, an empty filter or sort by expression will turn those "
244 "settings off." );
245}
246
247void QgsLayoutAtlasToPdfAlgorithm::initAlgorithm( const QVariantMap & )
248{
249 QgsLayoutAtlasToPdfAlgorithmBase::initAlgorithm();
250 addParameter( new QgsProcessingParameterFileDestination( u"OUTPUT"_s, QObject::tr( "PDF file" ), QObject::tr( "PDF Format" ) + " (*.pdf *.PDF)" ) );
251}
252
253QgsLayoutAtlasToPdfAlgorithm *QgsLayoutAtlasToPdfAlgorithm::createInstance() const
254{
255 return new QgsLayoutAtlasToPdfAlgorithm();
256}
257
258QVariantMap QgsLayoutAtlasToPdfAlgorithm::exportAtlas( QgsLayoutAtlas *atlas, const QgsLayoutExporter &exporter, const QgsLayoutExporter::PdfExportSettings &settings, const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingFeedback *feedback )
259{
260 Q_UNUSED( exporter )
261
262 const QString dest = parameterAsFileOutput( parameters, u"OUTPUT"_s, context );
263
264 QString error;
265 if ( atlas->updateFeatures() )
266 {
267 feedback->pushInfo( QObject::tr( "Exporting %n atlas feature(s)", "", atlas->count() ) );
268 switch ( QgsLayoutExporter::exportToPdf( atlas, dest, settings, error, feedback ) )
269 {
271 {
272 feedback->pushInfo( QObject::tr( "Successfully exported atlas to %1" ).arg( QDir::toNativeSeparators( dest ) ) );
273 break;
274 }
275
277 throw QgsProcessingException( !error.isEmpty() ? error : QObject::tr( "Cannot write to %1.\n\nThis file may be open in another application." ).arg( QDir::toNativeSeparators( dest ) ) );
278
280 throw QgsProcessingException( !error.isEmpty() ? error : QObject::tr( "Could not create print device." ) );
281
283 throw QgsProcessingException( !error.isEmpty() ? error : QObject::tr( "Trying to create the image "
284 "resulted in a memory overflow.\n\n"
285 "Please try a lower resolution or a smaller paper size." ) );
286
288 throw QgsProcessingException( !error.isEmpty() ? error : QObject::tr( "Error encountered while exporting atlas." ) );
289
292 // no meaning for PDF exports, will not be encountered
293 break;
294 }
295 }
296 else
297 {
298 feedback->reportError( QObject::tr( "No atlas features found" ) );
299 }
300
301 feedback->setProgress( 100 );
302
303 QVariantMap outputs;
304 outputs.insert( u"OUTPUT"_s, dest );
305 return outputs;
306}
307
308//
309// QgsLayoutAtlasToMultiplePdfAlgorithm
310//
311
312QString QgsLayoutAtlasToMultiplePdfAlgorithm::name() const
313{
314 return u"atlaslayouttomultiplepdf"_s;
315}
316
317QString QgsLayoutAtlasToMultiplePdfAlgorithm::displayName() const
318{
319 return QObject::tr( "Export atlas layout as PDF (multiple files)" );
320}
321
322QString QgsLayoutAtlasToMultiplePdfAlgorithm::shortDescription() const
323{
324 return QObject::tr( "Exports an atlas layout to multiple PDF files." );
325}
326
327QString QgsLayoutAtlasToMultiplePdfAlgorithm::shortHelpString() const
328{
329 return QObject::tr( "This algorithm outputs an atlas layout to multiple PDF files.\n\n"
330 "If a coverage layer is set, the selected layout's atlas settings exposed in this algorithm "
331 "will be overwritten. In this case, an empty filter or sort by expression will turn those "
332 "settings off.\n"
333 );
334}
335
336void QgsLayoutAtlasToMultiplePdfAlgorithm::initAlgorithm( const QVariantMap & )
337{
338 QgsLayoutAtlasToPdfAlgorithmBase::initAlgorithm();
339 addParameter( new QgsProcessingParameterExpression( u"OUTPUT_FILENAME"_s, QObject::tr( "Output filename" ), QString(), u"COVERAGE_LAYER"_s, true ) );
340 addParameter( new QgsProcessingParameterFile( u"OUTPUT_FOLDER"_s, QObject::tr( "Output folder" ), Qgis::ProcessingFileParameterBehavior::Folder ) );
341}
342
343QgsLayoutAtlasToMultiplePdfAlgorithm *QgsLayoutAtlasToMultiplePdfAlgorithm::createInstance() const
344{
345 return new QgsLayoutAtlasToMultiplePdfAlgorithm();
346}
347
348QVariantMap QgsLayoutAtlasToMultiplePdfAlgorithm::exportAtlas( QgsLayoutAtlas *atlas, const QgsLayoutExporter &exporter, const QgsLayoutExporter::PdfExportSettings &settings, const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingFeedback *feedback )
349{
350 Q_UNUSED( exporter )
351
352 QString error;
353
354 const QString filename = parameterAsString( parameters, u"OUTPUT_FILENAME"_s, context );
355 const QString destFolder = parameterAsFile( parameters, u"OUTPUT_FOLDER"_s, context );
356
357 // the "atlas.pdf" part will be overridden, only the folder is important
358 const QString dest = u"%1/atlas.pdf"_s.arg( destFolder );
359
360 if ( atlas->updateFeatures() )
361 {
362 feedback->pushInfo( QObject::tr( "Exporting %n atlas feature(s)", "", atlas->count() ) );
363
365 if ( atlas->filenameExpression().isEmpty() && filename.isEmpty() )
366 {
367 atlas->setFilenameExpression( u"'output_'||@atlas_featurenumber"_s, error );
368 }
369 else if ( !filename.isEmpty() )
370 {
371 if ( !atlas->setFilenameExpression( filename, error ) )
372 {
373 throw QgsProcessingException( QObject::tr( "Output file name expression is not valid: %1" ).arg( error ) );
374 }
375 }
376
377 result = QgsLayoutExporter::exportToPdfs( atlas, dest, settings, error, feedback );
378
379 switch ( result )
380 {
382 {
383 feedback->pushInfo( QObject::tr( "Successfully exported atlas to %1" ).arg( QDir::toNativeSeparators( destFolder ) ) );
384 break;
385 }
386
388 throw QgsProcessingException( !error.isEmpty() ? error : QObject::tr( "Cannot write to %1.\n\nThis file may be open in another application." ).arg( QDir::toNativeSeparators( dest ) ) );
389
391 throw QgsProcessingException( !error.isEmpty() ? error : QObject::tr( "Could not create print device." ) );
392
394 throw QgsProcessingException( !error.isEmpty() ? error : QObject::tr( "Trying to create the image "
395 "resulted in a memory overflow.\n\n"
396 "Please try a lower resolution or a smaller paper size." ) );
397
399 throw QgsProcessingException( !error.isEmpty() ? error : QObject::tr( "Error encountered while exporting atlas." ) );
400
403 // no meaning for PDF exports, will not be encountered
404 break;
405 }
406 }
407 else
408 {
409 feedback->reportError( QObject::tr( "No atlas features found" ) );
410 }
411
412 feedback->setProgress( 100 );
413
414 QVariantMap outputs;
415 outputs.insert( u"OUTPUT_FOLDER"_s, destFolder );
416 return outputs;
417}
418
@ MapLayer
Any map layer type (raster, vector, mesh, point cloud, annotation or plugin layer).
Definition qgis.h:3603
@ Folder
Parameter is a folder.
Definition qgis.h:3861
QFlags< ProcessingAlgorithmFlag > ProcessingAlgorithmFlags
Flags indicating how and when an algorithm operates and should be exposed to users.
Definition qgis.h:3680
@ PreferText
Render text as text objects, unless doing so results in rendering artifacts or poor quality rendering...
Definition qgis.h:2887
@ AlwaysOutlines
Always render text using path objects (AKA outlines/curves). This setting guarantees the best quality...
Definition qgis.h:2885
@ AlwaysText
Always render text as text objects. While this mode preserves text objects as text for post-processin...
Definition qgis.h:2886
@ NoThreading
Algorithm is not thread safe and cannot be run in a background thread, e.g. for algorithms which mani...
Definition qgis.h:3659
@ RequiresProject
The algorithm requires that a valid QgsProject is available from the processing context in order to e...
Definition qgis.h:3667
@ Advanced
Parameter is an advanced parameter which should be hidden from users by default.
Definition qgis.h:3834
@ Double
Double/float values.
Definition qgis.h:3875
@ DisableTiledRasterLayerRenders
If set, then raster layers will not be drawn as separate tiles. This may improve the appearance in ex...
Definition qgis.h:5352
@ LosslessImageRendering
Render images losslessly whenever possible, instead of the default lossy jpeg rendering used for some...
Definition qgis.h:5354
void setProgress(double progress)
Sets the current progress for the feedback object.
Definition qgsfeedback.h:63
Used to render QgsLayout as an atlas, by iterating over the features from an associated vector layer.
QString filenameExpression() const
Returns the filename expression used for generating output filenames for each atlas page.
void setCoverageLayer(QgsVectorLayer *layer)
Sets the coverage layer to use for the atlas features.
bool setFilterExpression(const QString &expression, QString &errorString)
Sets the expression used for filtering features in the coverage layer.
void setSortAscending(bool ascending)
Sets whether features should be sorted in an ascending order.
void setEnabled(bool enabled)
Sets whether the atlas is enabled.
bool enabled() const
Returns whether the atlas generation is enabled.
bool setFilenameExpression(const QString &expression, QString &errorString)
Sets the filename expression used for generating output filenames for each atlas page.
void setSortFeatures(bool enabled)
Sets whether features should be sorted in the atlas.
int count() const override
Returns the number of features to iterate over.
void setSortExpression(const QString &expression)
Sets the expression (or field name) to use for sorting features.
void setFilterFeatures(bool filtered)
Sets whether features should be filtered in the coverage layer.
int updateFeatures()
Requeries the current atlas coverage layer and applies filtering and sorting.
Handles rendering and exports of layouts to various formats.
ExportResult exportToPdf(const QString &filePath, const QgsLayoutExporter::PdfExportSettings &settings)
Exports the layout as a PDF to the filePath, using the specified export settings.
ExportResult
Result codes for exporting layouts.
@ Canceled
Export was canceled.
@ MemoryError
Unable to allocate memory required to export.
@ PrintError
Could not start printing to destination device.
@ IteratorError
Error iterating over layout.
@ FileError
Could not write to destination file, likely due to a lock held by another application.
@ Success
Export was successful.
@ SvgLayerError
Could not create layered SVG file.
static ExportResult exportToPdfs(QgsAbstractLayoutIterator *iterator, const QString &baseFilePath, const QgsLayoutExporter::PdfExportSettings &settings, QString &error, QgsFeedback *feedback=nullptr)
Exports a layout iterator to multiple PDF files, with the specified export settings.
Layout graphical items for displaying a map.
bool keepLayerSet() const
Returns whether a stored layer set should be used or the current layer set from the project associate...
void setKeepLayerSet(bool enabled)
Sets whether the stored layer set should be used or the current layer set of the associated project.
bool followVisibilityPreset() const
Returns whether the map should follow a map theme.
void setLayers(const QList< QgsMapLayer * > &layers)
Sets the stored layers set.
Base class for graphical items within a QgsLayout.
static QVector< double > predefinedScales(const QgsLayout *layout)
Returns a list of predefined scales associated with a layout.
Print layout, a QgsLayout subclass for static or atlas-based layouts.
QgsPrintLayout * clone() const override
Creates a clone of the layout.
virtual Qgis::ProcessingAlgorithmFlags flags() const
Returns the flags indicating how and when the algorithm operates and should be exposed to users.
Contains information about the context in which a processing algorithm is executed.
Custom exception class for processing related exceptions.
Base class for providing feedback from a processing algorithm.
virtual void pushInfo(const QString &info)
Pushes a general informational message from the algorithm.
virtual void reportError(const QString &error, bool fatalError=false)
Reports that the algorithm encountered an error while executing.
A boolean parameter for processing algorithms.
An expression parameter for processing algorithms.
A generic file based destination parameter, for specifying the destination path for a file (non-map l...
An input file or folder parameter for processing algorithms.
A print layout parameter, allowing users to select a print layout.
A vector layer (with or without geometry) parameter for processing algorithms.
Represents a vector layer which manages a vector based dataset.
Contains settings relating to exporting layouts to PDF.
bool forceVectorOutput
Set to true to force vector object exports, even when the resultant appearance will differ from the l...
bool rasterizeWholeImage
Set to true to force whole layout to be rasterized while exporting.
bool exportMetadata
Indicates whether PDF export should include metadata generated from the layout's project's metadata.
bool appendGeoreference
Indicates whether PDF export should append georeference data.
Qgis::LayoutRenderFlags flags
Layout context flags, which control how the export will be created.
double dpi
Resolution to export layout at. If dpi <= 0 the default layout dpi will be used.
QVector< qreal > predefinedMapScales
A list of predefined scales to use with the layout.
bool simplifyGeometries
Indicates whether vector geometries should be simplified to avoid redundant extraneous detail,...
Qgis::TextRenderFormat textRenderFormat
Text rendering format, which controls how text should be rendered in the export (e....