QGIS API Documentation 3.99.0-Master (2fe06baccd8)
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
29
30// QgsLayoutAtlasToPdfAlgorithmBase
31
32QStringList QgsLayoutAtlasToPdfAlgorithmBase::tags() const
33{
34 return QObject::tr( "layout,atlas,composer,composition,save" ).split( ',' );
35}
36
37QString QgsLayoutAtlasToPdfAlgorithmBase::group() const
38{
39 return QObject::tr( "Cartography" );
40}
41
42QString QgsLayoutAtlasToPdfAlgorithmBase::groupId() const
43{
44 return QStringLiteral( "cartography" );
45}
46
47Qgis::ProcessingAlgorithmFlags QgsLayoutAtlasToPdfAlgorithmBase::flags() const
48{
50}
51
52void QgsLayoutAtlasToPdfAlgorithmBase::initAlgorithm( const QVariantMap & )
53{
54 addParameter( new QgsProcessingParameterLayout( QStringLiteral( "LAYOUT" ), QObject::tr( "Atlas layout" ) ) );
55
56 addParameter( new QgsProcessingParameterVectorLayer( QStringLiteral( "COVERAGE_LAYER" ), QObject::tr( "Coverage layer" ), QList<int>(), QVariant(), true ) );
57 addParameter( new QgsProcessingParameterExpression( QStringLiteral( "FILTER_EXPRESSION" ), QObject::tr( "Filter expression" ), QString(), QStringLiteral( "COVERAGE_LAYER" ), true ) );
58 addParameter( new QgsProcessingParameterExpression( QStringLiteral( "SORTBY_EXPRESSION" ), QObject::tr( "Sort expression" ), QString(), QStringLiteral( "COVERAGE_LAYER" ), true ) );
59 addParameter( new QgsProcessingParameterBoolean( QStringLiteral( "SORTBY_REVERSE" ), QObject::tr( "Reverse sort order (used when a sort expression is provided)" ), false ) );
60
61 auto layersParam = std::make_unique<QgsProcessingParameterMultipleLayers>( QStringLiteral( "LAYERS" ), QObject::tr( "Map layers to assign to unlocked map item(s)" ), Qgis::ProcessingSourceType::MapLayer, QVariant(), true );
62 layersParam->setFlags( layersParam->flags() | Qgis::ProcessingParameterFlag::Advanced );
63 addParameter( layersParam.release() );
64
65 auto dpiParam = std::make_unique<QgsProcessingParameterNumber>( QStringLiteral( "DPI" ), QObject::tr( "DPI (leave blank for default layout DPI)" ), Qgis::ProcessingNumberParameterType::Double, QVariant(), true, 0 );
66 dpiParam->setFlags( dpiParam->flags() | Qgis::ProcessingParameterFlag::Advanced );
67 addParameter( dpiParam.release() );
68
69 auto forceVectorParam = std::make_unique<QgsProcessingParameterBoolean>( QStringLiteral( "FORCE_VECTOR" ), QObject::tr( "Always export as vectors" ), false );
70 forceVectorParam->setFlags( forceVectorParam->flags() | Qgis::ProcessingParameterFlag::Advanced );
71 addParameter( forceVectorParam.release() );
72
73 auto forceRasterParam = std::make_unique<QgsProcessingParameterBoolean>( QStringLiteral( "FORCE_RASTER" ), QObject::tr( "Always export as raster" ), false );
74 forceRasterParam->setFlags( forceRasterParam->flags() | Qgis::ProcessingParameterFlag::Advanced );
75 addParameter( forceRasterParam.release() );
76
77 auto appendGeorefParam = std::make_unique<QgsProcessingParameterBoolean>( QStringLiteral( "GEOREFERENCE" ), QObject::tr( "Append georeference information" ), true );
78 appendGeorefParam->setFlags( appendGeorefParam->flags() | Qgis::ProcessingParameterFlag::Advanced );
79 addParameter( appendGeorefParam.release() );
80
81 auto exportRDFParam = std::make_unique<QgsProcessingParameterBoolean>( QStringLiteral( "INCLUDE_METADATA" ), QObject::tr( "Export RDF metadata (title, author, etc.)" ), true );
82 exportRDFParam->setFlags( exportRDFParam->flags() | Qgis::ProcessingParameterFlag::Advanced );
83 addParameter( exportRDFParam.release() );
84
85 auto disableTiled = std::make_unique<QgsProcessingParameterBoolean>( QStringLiteral( "DISABLE_TILED" ), QObject::tr( "Disable tiled raster layer exports" ), false );
86 disableTiled->setFlags( disableTiled->flags() | Qgis::ProcessingParameterFlag::Advanced );
87 addParameter( disableTiled.release() );
88
89 auto simplify = std::make_unique<QgsProcessingParameterBoolean>( QStringLiteral( "SIMPLIFY" ), QObject::tr( "Simplify geometries to reduce output file size" ), true );
90 simplify->setFlags( simplify->flags() | Qgis::ProcessingParameterFlag::Advanced );
91 addParameter( simplify.release() );
92
93 const QStringList textExportOptions {
94 QObject::tr( "Always Export Text as Paths (Recommended)" ),
95 QObject::tr( "Always Export Text as Text Objects" ),
96 QObject::tr( "Prefer Exporting Text as Text Objects" ),
97 };
98
99 auto textFormat = std::make_unique<QgsProcessingParameterEnum>( QStringLiteral( "TEXT_FORMAT" ), QObject::tr( "Text export" ), textExportOptions, false, 0 );
100 textFormat->setFlags( textFormat->flags() | Qgis::ProcessingParameterFlag::Advanced );
101 addParameter( textFormat.release() );
102
103 const QStringList imageCompressionOptions {
104 QObject::tr( "Lossy (JPEG)" ),
105 QObject::tr( "Lossless" )
106 };
107
108 auto imageCompression = std::make_unique<QgsProcessingParameterEnum>( QStringLiteral( "IMAGE_COMPRESSION" ), QObject::tr( "Image compression" ), imageCompressionOptions, false, 0 );
109 imageCompression->setFlags( imageCompression->flags() | Qgis::ProcessingParameterFlag::Advanced );
110 addParameter( imageCompression.release() );
111}
112
113QVariantMap QgsLayoutAtlasToPdfAlgorithmBase::processAlgorithm( const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingFeedback *feedback )
114{
115 // this needs to be done in main thread, layouts are not thread safe
116 QgsPrintLayout *l = parameterAsLayout( parameters, QStringLiteral( "LAYOUT" ), context );
117 if ( !l )
118 throw QgsProcessingException( QObject::tr( "Cannot find layout with name \"%1\"" ).arg( parameters.value( QStringLiteral( "LAYOUT" ) ).toString() ) );
119
120 std::unique_ptr<QgsPrintLayout> layout( l->clone() );
121 QgsLayoutAtlas *atlas = layout->atlas();
122
123 QString expression, error;
124 QgsVectorLayer *layer = parameterAsVectorLayer( parameters, QStringLiteral( "COVERAGE_LAYER" ), context );
125 if ( layer )
126 {
127 atlas->setEnabled( true );
128 atlas->setCoverageLayer( layer );
129
130 expression = parameterAsString( parameters, QStringLiteral( "FILTER_EXPRESSION" ), context );
131 atlas->setFilterExpression( expression, error );
132 atlas->setFilterFeatures( !expression.isEmpty() && error.isEmpty() );
133 if ( !expression.isEmpty() && !error.isEmpty() )
134 {
135 throw QgsProcessingException( QObject::tr( "Error setting atlas filter expression" ) );
136 }
137 error.clear();
138
139 expression = parameterAsString( parameters, QStringLiteral( "SORTBY_EXPRESSION" ), context );
140 if ( !expression.isEmpty() )
141 {
142 const bool sortByReverse = parameterAsBool( parameters, QStringLiteral( "SORTBY_REVERSE" ), context );
143 atlas->setSortFeatures( true );
144 atlas->setSortExpression( expression );
145 atlas->setSortAscending( !sortByReverse );
146 }
147 else
148 {
149 atlas->setSortFeatures( false );
150 }
151 }
152 else if ( !atlas->enabled() )
153 {
154 throw QgsProcessingException( QObject::tr( "Selected layout does not have atlas functionality enabled" ) );
155 }
156
157 const QgsLayoutExporter exporter( layout.get() );
159
160 if ( parameters.value( QStringLiteral( "DPI" ) ).isValid() )
161 {
162 settings.dpi = parameterAsDouble( parameters, QStringLiteral( "DPI" ), context );
163 }
164 settings.forceVectorOutput = parameterAsBool( parameters, QStringLiteral( "FORCE_VECTOR" ), context );
165 settings.rasterizeWholeImage = parameterAsBool( parameters, QStringLiteral( "FORCE_RASTER" ), context );
166 settings.appendGeoreference = parameterAsBool( parameters, QStringLiteral( "GEOREFERENCE" ), context );
167 settings.exportMetadata = parameterAsBool( parameters, QStringLiteral( "INCLUDE_METADATA" ), context );
168 settings.simplifyGeometries = parameterAsBool( parameters, QStringLiteral( "SIMPLIFY" ), context );
169 const int textFormat = parameterAsEnum( parameters, QStringLiteral( "TEXT_FORMAT" ), context );
170 switch ( textFormat )
171 {
172 case 0:
174 break;
175 case 1:
177 break;
178 case 2:
180 break;
181 default:
182 break;
183 }
184
185 if ( parameterAsBool( parameters, QStringLiteral( "DISABLE_TILED" ), context ) )
187 else
188 settings.flags = settings.flags & ~static_cast< int >( Qgis::LayoutRenderFlag::DisableTiledRasterLayerRenders );
189
190 if ( parameterAsEnum( parameters, QStringLiteral( "IMAGE_COMPRESSION" ), context ) == 1 )
192 else
193 settings.flags = settings.flags & ~static_cast< int >( Qgis::LayoutRenderFlag::LosslessImageRendering );
194
195 settings.predefinedMapScales = QgsLayoutUtils::predefinedScales( layout.get() );
196
197 const QList<QgsMapLayer *> layers = parameterAsLayerList( parameters, QStringLiteral( "LAYERS" ), context );
198 if ( layers.size() > 0 )
199 {
200 const QList<QGraphicsItem *> items = layout->items();
201 for ( QGraphicsItem *graphicsItem : items )
202 {
203 QgsLayoutItem *item = dynamic_cast<QgsLayoutItem *>( graphicsItem );
204 QgsLayoutItemMap *map = dynamic_cast<QgsLayoutItemMap *>( item );
205 if ( map && !map->followVisibilityPreset() && !map->keepLayerSet() )
206 {
207 map->setKeepLayerSet( true );
208 map->setLayers( layers );
209 }
210 }
211 }
212
213 return exportAtlas( atlas, exporter, settings, parameters, context, feedback );
214}
215
216//
217// QgsLayoutAtlasToPdfAlgorithm
218//
219
220QString QgsLayoutAtlasToPdfAlgorithm::name() const
221{
222 return QStringLiteral( "atlaslayouttopdf" );
223}
224
225QString QgsLayoutAtlasToPdfAlgorithm::displayName() const
226{
227 return QObject::tr( "Export atlas layout as PDF (single file)" );
228}
229
230QString QgsLayoutAtlasToPdfAlgorithm::shortDescription() const
231{
232 return QObject::tr( "Exports an atlas layout as a single PDF file." );
233}
234
235QString QgsLayoutAtlasToPdfAlgorithm::shortHelpString() const
236{
237 return QObject::tr( "This algorithm outputs an atlas layout as a single PDF file.\n\n"
238 "If a coverage layer is set, the selected layout's atlas settings exposed in this algorithm "
239 "will be overwritten. In this case, an empty filter or sort by expression will turn those "
240 "settings off." );
241}
242
243void QgsLayoutAtlasToPdfAlgorithm::initAlgorithm( const QVariantMap & )
244{
245 QgsLayoutAtlasToPdfAlgorithmBase::initAlgorithm();
246 addParameter( new QgsProcessingParameterFileDestination( QStringLiteral( "OUTPUT" ), QObject::tr( "PDF file" ), QObject::tr( "PDF Format" ) + " (*.pdf *.PDF)" ) );
247}
248
249QgsLayoutAtlasToPdfAlgorithm *QgsLayoutAtlasToPdfAlgorithm::createInstance() const
250{
251 return new QgsLayoutAtlasToPdfAlgorithm();
252}
253
254QVariantMap QgsLayoutAtlasToPdfAlgorithm::exportAtlas( QgsLayoutAtlas *atlas, const QgsLayoutExporter &exporter, const QgsLayoutExporter::PdfExportSettings &settings, const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingFeedback *feedback )
255{
256 Q_UNUSED( exporter )
257
258 const QString dest = parameterAsFileOutput( parameters, QStringLiteral( "OUTPUT" ), context );
259
260 QString error;
261 if ( atlas->updateFeatures() )
262 {
263 feedback->pushInfo( QObject::tr( "Exporting %n atlas feature(s)", "", atlas->count() ) );
264 switch ( QgsLayoutExporter::exportToPdf( atlas, dest, settings, error, feedback ) )
265 {
267 {
268 feedback->pushInfo( QObject::tr( "Successfully exported atlas to %1" ).arg( QDir::toNativeSeparators( dest ) ) );
269 break;
270 }
271
273 throw QgsProcessingException( !error.isEmpty() ? error : QObject::tr( "Cannot write to %1.\n\nThis file may be open in another application." ).arg( QDir::toNativeSeparators( dest ) ) );
274
276 throw QgsProcessingException( !error.isEmpty() ? error : QObject::tr( "Could not create print device." ) );
277
279 throw QgsProcessingException( !error.isEmpty() ? error : QObject::tr( "Trying to create the image "
280 "resulted in a memory overflow.\n\n"
281 "Please try a lower resolution or a smaller paper size." ) );
282
284 throw QgsProcessingException( !error.isEmpty() ? error : QObject::tr( "Error encountered while exporting atlas." ) );
285
288 // no meaning for PDF exports, will not be encountered
289 break;
290 }
291 }
292 else
293 {
294 feedback->reportError( QObject::tr( "No atlas features found" ) );
295 }
296
297 feedback->setProgress( 100 );
298
299 QVariantMap outputs;
300 outputs.insert( QStringLiteral( "OUTPUT" ), dest );
301 return outputs;
302}
303
304//
305// QgsLayoutAtlasToMultiplePdfAlgorithm
306//
307
308QString QgsLayoutAtlasToMultiplePdfAlgorithm::name() const
309{
310 return QStringLiteral( "atlaslayouttomultiplepdf" );
311}
312
313QString QgsLayoutAtlasToMultiplePdfAlgorithm::displayName() const
314{
315 return QObject::tr( "Export atlas layout as PDF (multiple files)" );
316}
317
318QString QgsLayoutAtlasToMultiplePdfAlgorithm::shortDescription() const
319{
320 return QObject::tr( "Exports an atlas layout to multiple PDF files." );
321}
322
323QString QgsLayoutAtlasToMultiplePdfAlgorithm::shortHelpString() const
324{
325 return QObject::tr( "This algorithm outputs an atlas layout to multiple PDF files.\n\n"
326 "If a coverage layer is set, the selected layout's atlas settings exposed in this algorithm "
327 "will be overwritten. In this case, an empty filter or sort by expression will turn those "
328 "settings off.\n"
329 );
330}
331
332void QgsLayoutAtlasToMultiplePdfAlgorithm::initAlgorithm( const QVariantMap & )
333{
334 QgsLayoutAtlasToPdfAlgorithmBase::initAlgorithm();
335 addParameter( new QgsProcessingParameterExpression( QStringLiteral( "OUTPUT_FILENAME" ), QObject::tr( "Output filename" ), QString(), QStringLiteral( "COVERAGE_LAYER" ), true ) );
336 addParameter( new QgsProcessingParameterFile( QStringLiteral( "OUTPUT_FOLDER" ), QObject::tr( "Output folder" ), Qgis::ProcessingFileParameterBehavior::Folder ) );
337}
338
339QgsLayoutAtlasToMultiplePdfAlgorithm *QgsLayoutAtlasToMultiplePdfAlgorithm::createInstance() const
340{
341 return new QgsLayoutAtlasToMultiplePdfAlgorithm();
342}
343
344QVariantMap QgsLayoutAtlasToMultiplePdfAlgorithm::exportAtlas( QgsLayoutAtlas *atlas, const QgsLayoutExporter &exporter, const QgsLayoutExporter::PdfExportSettings &settings, const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingFeedback *feedback )
345{
346 Q_UNUSED( exporter )
347
348 QString error;
349
350 const QString filename = parameterAsString( parameters, QStringLiteral( "OUTPUT_FILENAME" ), context );
351 const QString destFolder = parameterAsFile( parameters, QStringLiteral( "OUTPUT_FOLDER" ), context );
352
353 // the "atlas.pdf" part will be overridden, only the folder is important
354 const QString dest = QStringLiteral( "%1/atlas.pdf" ).arg( destFolder );
355
356 if ( atlas->updateFeatures() )
357 {
358 feedback->pushInfo( QObject::tr( "Exporting %n atlas feature(s)", "", atlas->count() ) );
359
361 if ( atlas->filenameExpression().isEmpty() && filename.isEmpty() )
362 {
363 atlas->setFilenameExpression( QStringLiteral( "'output_'||@atlas_featurenumber" ), error );
364 }
365 else if ( !filename.isEmpty() )
366 {
367 if ( !atlas->setFilenameExpression( filename, error ) )
368 {
369 throw QgsProcessingException( QObject::tr( "Output file name expression is not valid: %1" ).arg( error ) );
370 }
371 }
372
373 result = QgsLayoutExporter::exportToPdfs( atlas, dest, settings, error, feedback );
374
375 switch ( result )
376 {
378 {
379 feedback->pushInfo( QObject::tr( "Successfully exported atlas to %1" ).arg( QDir::toNativeSeparators( destFolder ) ) );
380 break;
381 }
382
384 throw QgsProcessingException( !error.isEmpty() ? error : QObject::tr( "Cannot write to %1.\n\nThis file may be open in another application." ).arg( QDir::toNativeSeparators( dest ) ) );
385
387 throw QgsProcessingException( !error.isEmpty() ? error : QObject::tr( "Could not create print device." ) );
388
390 throw QgsProcessingException( !error.isEmpty() ? error : QObject::tr( "Trying to create the image "
391 "resulted in a memory overflow.\n\n"
392 "Please try a lower resolution or a smaller paper size." ) );
393
395 throw QgsProcessingException( !error.isEmpty() ? error : QObject::tr( "Error encountered while exporting atlas." ) );
396
399 // no meaning for PDF exports, will not be encountered
400 break;
401 }
402 }
403 else
404 {
405 feedback->reportError( QObject::tr( "No atlas features found" ) );
406 }
407
408 feedback->setProgress( 100 );
409
410 QVariantMap outputs;
411 outputs.insert( QStringLiteral( "OUTPUT_FOLDER" ), destFolder );
412 return outputs;
413}
414
@ MapLayer
Any map layer type (raster, vector, mesh, point cloud, annotation or plugin layer).
Definition qgis.h:3532
@ Folder
Parameter is a folder.
Definition qgis.h:3790
QFlags< ProcessingAlgorithmFlag > ProcessingAlgorithmFlags
Flags indicating how and when an algorithm operates and should be exposed to users.
Definition qgis.h:3609
@ PreferText
Render text as text objects, unless doing so results in rendering artifacts or poor quality rendering...
Definition qgis.h:2829
@ AlwaysOutlines
Always render text using path objects (AKA outlines/curves). This setting guarantees the best quality...
Definition qgis.h:2827
@ AlwaysText
Always render text as text objects. While this mode preserves text objects as text for post-processin...
Definition qgis.h:2828
@ NoThreading
Algorithm is not thread safe and cannot be run in a background thread, e.g. for algorithms which mani...
Definition qgis.h:3588
@ RequiresProject
The algorithm requires that a valid QgsProject is available from the processing context in order to e...
Definition qgis.h:3596
@ Advanced
Parameter is an advanced parameter which should be hidden from users by default.
Definition qgis.h:3763
@ Double
Double/float values.
Definition qgis.h:3804
@ DisableTiledRasterLayerRenders
If set, then raster layers will not be drawn as separate tiles. This may improve the appearance in ex...
Definition qgis.h:5245
@ LosslessImageRendering
Render images losslessly whenever possible, instead of the default lossy jpeg rendering used for some...
Definition qgis.h:5247
void setProgress(double progress)
Sets the current progress for the feedback object.
Definition qgsfeedback.h:61
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....