104 void renderPage( QPainter *painter,
int page )
const;
124 QImage renderPageToImage(
int page, QSize imageSize = QSize(),
double dpi = -1 )
const;
133 void renderRegion( QPainter *painter,
const QRectF ®ion )
const;
151 QImage renderRegionToImage(
const QRectF ®ion, QSize imageSize = QSize(),
double dpi = -1 )
const;
194 bool cropToContents =
false;
215 bool generateWorldFile =
false;
223 bool exportMetadata =
true;
291 bool rasterizeWholeImage =
false;
300 bool forceVectorOutput =
false;
307 bool appendGeoreference =
true;
315 bool exportMetadata =
true;
336 bool simplifyGeometries =
true;
349 bool writeGeoPdf =
false;
364 bool exportLayersAsSeperateFiles =
false;
374 bool useIso32000ExtensionFormatGeoreferencing =
true;
385 bool useOgcBestPracticeFormatGeoreferencing =
false;
392 bool includeGeoPdfFeatures =
true;
467 bool rasterizeWholeImage =
false;
483#if defined( HAVE_QTPRINTER )
525 bool forceVectorOutput =
false;
531 bool cropToContents =
false;
544 bool exportAsLayers =
false;
554 bool exportLabelsToSeparateLayers =
true;
562 bool exportMetadata =
true;
583 bool simplifyGeometries =
true;
636 QMap< QString, QgsLabelingResults * > labelingResults();
649 QMap< QString, QgsLabelingResults * > takeLabelingResults();
667 bool georeferenceOutput(
const QString &file,
QgsLayoutItemMap *referenceMap =
nullptr,
668 const QRectF &exportRegion = QRectF(),
double dpi = -1 )
const;
676 void computeWorldFileParameters(
double &a,
double &b,
double &
c,
double &d,
double &e,
double &f,
double dpi = -1 )
const;
683 void computeWorldFileParameters(
const QRectF ®ion,
double &a,
double &b,
double &
c,
double &d,
double &e,
double &f,
double dpi = -1 )
const;
693 static bool requiresRasterization(
const QgsLayout *layout );
702 static bool containsAdvancedEffects(
const QgsLayout *layout );
711 virtual QString generateFileName(
const PageExportDetails &details )
const;
715 QPointer< QgsLayout > mLayout;
717 void captureLabelingResults();
718 QMap< QString, QgsLabelingResults * > mLabelingResults;
720 mutable QString mErrorFileName;
721 mutable QString mErrorMessage;
723 QImage createImage(
const ImageExportSettings &settings,
int page, QRectF &bounds,
bool &skipPage )
const;
729 static int firstPageToBeExported(
QgsLayout *layout );
734 static bool saveImage(
const QImage &image,
const QString &imageFilename,
const QString &imageFormat,
QgsProject *projectForMetadata,
int quality = -1 );
749 std::unique_ptr<double[]> computeGeoTransform(
const QgsLayoutItemMap *referenceMap =
nullptr,
const QRectF &exportRegion = QRectF(),
double dpi = -1 )
const;
752 void writeWorldFile(
const QString &fileName,
double a,
double b,
double c,
double d,
double e,
double f )
const;
757 static void preparePrintAsPdf(
QgsLayout *layout, QPdfWriter *device,
const QString &filePath );
759 static void preparePrint(
QgsLayout *layout, QPagedPaintDevice *device,
bool setFirstPageSize =
false );
764 ExportResult print( QPagedPaintDevice *device );
774 ExportResult printPrivate( QPagedPaintDevice *device, QPainter &painter,
bool startNewPage =
false,
double dpi = -1,
bool rasterize =
false );
776 static void updatePrinterPageSize(
QgsLayout *layout, QPagedPaintDevice *device,
int page );
778 ExportResult renderToLayeredSvg(
const SvgExportSettings &settings,
double width,
double height,
int page,
const QRectF &bounds,
779 const QString &filename,
unsigned int svgLayerId,
const QString &layerName,
780 QDomDocument &svg, QDomNode &svgDocRoot,
bool includeMetadata )
const;
782 void appendMetadataToSvg( QDomDocument &svg )
const;
784 bool georeferenceOutputPrivate(
const QString &file,
QgsLayoutItemMap *referenceMap =
nullptr,
785 const QRectF &exportRegion = QRectF(),
double dpi = -1,
bool includeGeoreference =
true,
bool includeMetadata =
false )
const;
787 ExportResult handleLayeredExport(
const QList<QGraphicsItem *> &items,
789 const std::function<QString(
QgsLayoutItem *item )> &getItemExportGroupFunc
793 static QString getCreator();
796 static void setXmpMetadata( QPdfWriter *pdfWriter,
QgsLayout *layout );
800 friend class TestQgsLayout;
801 friend class TestQgsLayoutExporter;
Stores information relating to the current rendering settings for a layout.
A boolean settings entry.
An integer 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 '.')