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;
190 bool cropToContents =
false;
211 bool generateWorldFile =
false;
219 bool exportMetadata =
true;
279 bool rasterizeWholeImage =
false;
288 bool forceVectorOutput =
false;
295 bool appendGeoreference =
true;
303 bool exportMetadata =
true;
324 bool simplifyGeometries =
true;
337 bool writeGeoPdf =
false;
352 bool exportLayersAsSeperateFiles =
false;
362 bool useIso32000ExtensionFormatGeoreferencing =
true;
373 bool useOgcBestPracticeFormatGeoreferencing =
false;
380 bool includeGeoPdfFeatures =
true;
455 bool rasterizeWholeImage =
false;
471#if defined( HAVE_QTPRINTER )
513 bool forceVectorOutput =
false;
519 bool cropToContents =
false;
532 bool exportAsLayers =
false;
542 bool exportLabelsToSeparateLayers =
true;
550 bool exportMetadata =
true;
571 bool simplifyGeometries =
true;
624 QMap< QString, QgsLabelingResults * > labelingResults();
637 QMap< QString, QgsLabelingResults * > takeLabelingResults();
655 bool georeferenceOutput(
const QString &file,
QgsLayoutItemMap *referenceMap =
nullptr,
656 const QRectF &exportRegion = QRectF(),
double dpi = -1 )
const;
664 void computeWorldFileParameters(
double &a,
double &b,
double &
c,
double &d,
double &e,
double &f,
double dpi = -1 )
const;
671 void computeWorldFileParameters(
const QRectF ®ion,
double &a,
double &b,
double &
c,
double &d,
double &e,
double &f,
double dpi = -1 )
const;
681 static bool requiresRasterization(
const QgsLayout *layout );
690 static bool containsAdvancedEffects(
const QgsLayout *layout );
699 virtual QString generateFileName(
const PageExportDetails &details )
const;
703 QPointer< QgsLayout > mLayout;
705 void captureLabelingResults();
706 QMap< QString, QgsLabelingResults * > mLabelingResults;
708 mutable QString mErrorFileName;
709 mutable QString mErrorMessage;
711 QImage createImage(
const ImageExportSettings &settings,
int page, QRectF &bounds,
bool &skipPage )
const;
717 static int firstPageToBeExported(
QgsLayout *layout );
722 static bool saveImage(
const QImage &image,
const QString &imageFilename,
const QString &imageFormat,
QgsProject *projectForMetadata );
737 std::unique_ptr<double[]> computeGeoTransform(
const QgsLayoutItemMap *referenceMap =
nullptr,
const QRectF &exportRegion = QRectF(),
double dpi = -1 )
const;
740 void writeWorldFile(
const QString &fileName,
double a,
double b,
double c,
double d,
double e,
double f )
const;
745 static void preparePrintAsPdf(
QgsLayout *layout, QPdfWriter *device,
const QString &filePath );
747 static void preparePrint(
QgsLayout *layout, QPagedPaintDevice *device,
bool setFirstPageSize =
false );
752 ExportResult print( QPagedPaintDevice *device );
762 ExportResult printPrivate( QPagedPaintDevice *device, QPainter &painter,
bool startNewPage =
false,
double dpi = -1,
bool rasterize =
false );
764 static void updatePrinterPageSize(
QgsLayout *layout, QPagedPaintDevice *device,
int page );
766 ExportResult renderToLayeredSvg(
const SvgExportSettings &settings,
double width,
double height,
int page,
const QRectF &bounds,
767 const QString &filename,
unsigned int svgLayerId,
const QString &layerName,
768 QDomDocument &svg, QDomNode &svgDocRoot,
bool includeMetadata )
const;
770 void appendMetadataToSvg( QDomDocument &svg )
const;
772 bool georeferenceOutputPrivate(
const QString &file,
QgsLayoutItemMap *referenceMap =
nullptr,
773 const QRectF &exportRegion = QRectF(),
double dpi = -1,
bool includeGeoreference =
true,
bool includeMetadata =
false )
const;
775 ExportResult handleLayeredExport(
const QList<QGraphicsItem *> &items,
777 const std::function<QString(
QgsLayoutItem *item )> &getItemExportGroupFunc
781 static QString getCreator();
784 static void setXmpMetadata( QPdfWriter *pdfWriter,
QgsLayout *layout );
788 friend class TestQgsLayout;
789 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 '.')