summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qpdfwriter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/painting/qpdfwriter.cpp')
-rw-r--r--src/gui/painting/qpdfwriter.cpp46
1 files changed, 45 insertions, 1 deletions
diff --git a/src/gui/painting/qpdfwriter.cpp b/src/gui/painting/qpdfwriter.cpp
index bf7e2d3dca..4f70fe6ad2 100644
--- a/src/gui/painting/qpdfwriter.cpp
+++ b/src/gui/painting/qpdfwriter.cpp
@@ -55,7 +55,7 @@ public:
: QObjectPrivate()
{
engine = new QPdfEngine();
- output = 0;
+ output = nullptr;
pdfVersion = QPdfWriter::PdfVersion_1_4;
}
~QPdfWriterPrivate()
@@ -266,6 +266,50 @@ int QPdfWriter::resolution() const
return d->engine->resolution();
}
+/*!
+ \since 5.15
+
+ Sets the document metadata. This metadata is not influenced by the setTitle / setCreator methods,
+ so is up to the user to keep it consistent.
+ \a xmpMetadata contains XML formatted metadata to embed into the PDF file.
+
+ \sa documentXmpMetadata()
+*/
+
+void QPdfWriter::setDocumentXmpMetadata(const QByteArray &xmpMetadata)
+{
+ Q_D(const QPdfWriter);
+ d->engine->setDocumentXmpMetadata(xmpMetadata);
+}
+
+/*!
+ \since 5.15
+
+ Gets the document metadata, as it was provided with a call to setDocumentXmpMetadata. It will not
+ return the default metadata.
+
+ \sa setDocumentXmpMetadata()
+*/
+
+QByteArray QPdfWriter::documentXmpMetadata() const
+{
+ Q_D(const QPdfWriter);
+ return d->engine->documentXmpMetadata();
+}
+
+/*!
+ \since 5.15
+
+ Adds \a fileName attachment to the PDF with (optional) \a mimeType
+ \a data contains the raw file data to embed into the PDF file.
+*/
+
+void QPdfWriter::addFileAttachment(const QString &fileName, const QByteArray &data, const QString &mimeType)
+{
+ Q_D(QPdfWriter);
+ d->engine->addFileAttachment(fileName, data, mimeType);
+}
+
// Defined in QPagedPaintDevice but non-virtual, add QPdfWriter specific doc here
#ifdef Q_QDOC
/*!