summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qpdf_p.h
diff options
context:
space:
mode:
authorTobias Koenig <tobias.koenig@kdab.com>2017-02-14 10:11:19 +0100
committerTobias Koenig <tobias.koenig@kdab.com>2017-03-28 07:02:05 +0000
commit6c32927f8cf226b8158dd25f4b92a6853dadb8b6 (patch)
tree7fcd1dcfa76c05d59fb6f115d133308dfe2922e2 /src/gui/painting/qpdf_p.h
parent3398d9d40cb0dae2dc2a1a4f7dc3b4b9cceae903 (diff)
Improve PDF/A-1b support in QPdfWriter
Add new enum QPrinter::PdfVersion to switch QPdfWriter into PDF/A-1b mode. In that mode - meta data are embedded in XMP format - a color profile for sRGB is embedded and an OutputIntent defined - the ID key is added to the document trailer dictionary - a CIDSet entry is added to the font descriptor - transparency is removed from pens, brushes and images Change-Id: Ia8a24d83609b239e716aefc1ba05f07320dbd290 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/gui/painting/qpdf_p.h')
-rw-r--r--src/gui/painting/qpdf_p.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gui/painting/qpdf_p.h b/src/gui/painting/qpdf_p.h
index a6aa2940c8..f5bb4e17a8 100644
--- a/src/gui/painting/qpdf_p.h
+++ b/src/gui/painting/qpdf_p.h
@@ -168,6 +168,12 @@ class Q_GUI_EXPORT QPdfEngine : public QPaintEngine
Q_DECLARE_PRIVATE(QPdfEngine)
friend class QPdfWriter;
public:
+ enum PdfVersion
+ {
+ Version_1_4,
+ Version_A1b
+ };
+
QPdfEngine();
QPdfEngine(QPdfEnginePrivate &d);
~QPdfEngine() {}
@@ -177,6 +183,8 @@ public:
void setResolution(int resolution);
int resolution() const;
+ void setPdfVersion(PdfVersion version);
+
// reimplementations QPaintEngine
bool begin(QPaintDevice *pdev) Q_DECL_OVERRIDE;
bool end() Q_DECL_OVERRIDE;
@@ -258,6 +266,7 @@ public:
bool hasBrush;
bool simplePen;
qreal opacity;
+ QPdfEngine::PdfVersion pdfVersion;
QHash<QFontEngine::FaceId, QFontSubset *> fonts;
@@ -286,6 +295,8 @@ private:
int createShadingFunction(const QGradient *gradient, int from, int to, bool reflect, bool alpha);
void writeInfo();
+ int writeXmpMetaData();
+ int writeOutputIntent();
void writePageRoot();
void writeFonts();
void embedFont(QFontSubset *font);