Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qpdfwriter.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QPDFWRITER_H
5#define QPDFWRITER_H
6
7#include <QtGui/qtguiglobal.h>
8
9#ifndef QT_NO_PDF
10
11#include <QtCore/qobject.h>
12#include <QtGui/qpagedpaintdevice.h>
13#include <QtGui/qpagelayout.h>
14
16
17class QIODevice;
19
20class Q_GUI_EXPORT QPdfWriter : public QObject, public QPagedPaintDevice
21{
23public:
24 explicit QPdfWriter(const QString &filename);
25 explicit QPdfWriter(QIODevice *device);
27
28 void setPdfVersion(PdfVersion version);
29 PdfVersion pdfVersion() const;
30
31 QString title() const;
32 void setTitle(const QString &title);
33
34 QString creator() const;
35 void setCreator(const QString &creator);
36
37 bool newPage() override;
38
39 void setResolution(int resolution);
40 int resolution() const;
41
42 void setDocumentXmpMetadata(const QByteArray &xmpMetadata);
43 QByteArray documentXmpMetadata() const;
44
45 void addFileAttachment(const QString &fileName, const QByteArray &data, const QString &mimeType = QString());
46
47 enum class ColorModel
48 {
49 RGB,
50 Grayscale,
51 CMYK,
52 Auto,
53 };
54 Q_ENUM(ColorModel)
55
56 ColorModel colorModel() const;
57 void setColorModel(ColorModel model);
58
59protected:
60 QPaintEngine *paintEngine() const override;
61 int metric(PaintDeviceMetric id) const override;
62
63private:
64 Q_DISABLE_COPY(QPdfWriter)
65 Q_DECLARE_PRIVATE(QPdfWriter)
66};
67
69
70#endif // QT_NO_PDF
71
72#endif
IOBluetoothDevice * device
\inmodule QtCore
Definition qbytearray.h:57
\inmodule QtCore \reentrant
Definition qiodevice.h:34
\inmodule QtCore
Definition qobject.h:103
\inmodule QtGui
PdfVersion
The PdfVersion enum describes the version of the PDF file that is produced by QPrinter or QPdfWriter.
\inmodule QtGui
\inmodule QtGui
Definition qpdfwriter.h:21
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
Combined button and popup list for selecting options.
const char * mimeType
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
#define Q_ENUM(x)
#define Q_OBJECT
QSqlQueryModel * model
[16]
QString title
[35]
QItemEditorCreatorBase * creator
g setTitle("&User information")
[0]