100 void renderPage( QPainter *painter,
int page )
const;
120 QImage renderPageToImage(
int page, QSize imageSize = QSize(),
double dpi = -1 )
const;
129 void renderRegion( QPainter *painter,
const QRectF ®ion )
const;
147 QImage renderRegionToImage(
const QRectF ®ion, QSize imageSize = QSize(),
double dpi = -1 )
const;
191 bool cropToContents =
false;
212 bool generateWorldFile =
false;
220 bool exportMetadata =
true;
226 QgsLayoutRenderContext::Flags flags = QgsLayoutRenderContext::Flags();
281 bool rasterizeWholeImage =
false;
290 bool forceVectorOutput =
false;
297 bool appendGeoreference =
true;
305 bool exportMetadata =
true;
310 QgsLayoutRenderContext::Flags flags = QgsLayoutRenderContext::Flags();
326 bool simplifyGeometries =
true;
339 bool writeGeoPdf =
false;
354 bool exportLayersAsSeperateFiles =
false;
364 bool useIso32000ExtensionFormatGeoreferencing =
true;
375 bool useOgcBestPracticeFormatGeoreferencing =
false;
382 bool includeGeoPdfFeatures =
true;
458 bool rasterizeWholeImage =
false;
463 QgsLayoutRenderContext::Flags flags = QgsLayoutRenderContext::Flags();
514 bool forceVectorOutput =
false;
520 bool cropToContents =
false;
533 bool exportAsLayers =
false;
543 bool exportLabelsToSeparateLayers =
true;
551 bool exportMetadata =
true;
556 QgsLayoutRenderContext::Flags flags = QgsLayoutRenderContext::Flags();
572 bool simplifyGeometries =
true;
618 QMap< QString, QgsLabelingResults * > labelingResults();
631 QMap< QString, QgsLabelingResults * > takeLabelingResults();
649 bool georeferenceOutput(
const QString &file,
QgsLayoutItemMap *referenceMap =
nullptr,
650 const QRectF &exportRegion = QRectF(),
double dpi = -1 )
const;
658 void computeWorldFileParameters(
double &a,
double &b,
double &
c,
double &d,
double &e,
double &f,
double dpi = -1 )
const;
665 void computeWorldFileParameters(
const QRectF ®ion,
double &a,
double &b,
double &
c,
double &d,
double &e,
double &f,
double dpi = -1 )
const;
675 static bool requiresRasterization(
const QgsLayout *layout );
684 static bool containsAdvancedEffects(
const QgsLayout *layout );
693 virtual QString generateFileName(
const PageExportDetails &details )
const;
697 QPointer< QgsLayout > mLayout;
699 void captureLabelingResults();
700 QMap< QString, QgsLabelingResults * > mLabelingResults;
702 mutable QString mErrorFileName;
704 QImage createImage(
const ImageExportSettings &settings,
int page, QRectF &bounds,
bool &skipPage )
const;
710 static int firstPageToBeExported(
QgsLayout *layout );
715 static bool saveImage(
const QImage &image,
const QString &imageFilename,
const QString &imageFormat,
QgsProject *projectForMetadata );
730 std::unique_ptr<double[]> computeGeoTransform(
const QgsLayoutItemMap *referenceMap =
nullptr,
const QRectF &exportRegion = QRectF(),
double dpi = -1 )
const;
733 void writeWorldFile(
const QString &fileName,
double a,
double b,
double c,
double d,
double e,
double f )
const;
738 static void preparePrintAsPdf(
QgsLayout *layout, QPagedPaintDevice *device,
const QString &filePath );
740 static void preparePrint(
QgsLayout *layout, QPagedPaintDevice *device,
bool setFirstPageSize =
false );
745 ExportResult print( QPagedPaintDevice *device );
755 ExportResult printPrivate( QPagedPaintDevice *device, QPainter &painter,
bool startNewPage =
false,
double dpi = -1,
bool rasterize =
false );
757 static void updatePrinterPageSize(
QgsLayout *layout, QPagedPaintDevice *device,
int page );
759 ExportResult renderToLayeredSvg(
const SvgExportSettings &settings,
double width,
double height,
int page,
const QRectF &bounds,
760 const QString &filename,
unsigned int svgLayerId,
const QString &layerName,
761 QDomDocument &svg, QDomNode &svgDocRoot,
bool includeMetadata )
const;
763 void appendMetadataToSvg( QDomDocument &svg )
const;
765 bool georeferenceOutputPrivate(
const QString &file,
QgsLayoutItemMap *referenceMap =
nullptr,
766 const QRectF &exportRegion = QRectF(),
double dpi = -1,
bool includeGeoreference =
true,
bool includeMetadata =
false )
const;
771 friend class TestQgsLayout;
772 friend class TestQgsLayoutExporter;
Stores information relating to the current rendering settings for a layout.
A boolean settings entry.
Contains details of a page being exported by the class.
QString baseName
Base part of filename (i.e. file name without extension or '.')
QString extension
File suffix/extension (without the leading '.')