24 Q_PROPERTY(
int pageCount READ pageCount NOTIFY pageCountChanged FINAL)
25 Q_PROPERTY(QString password READ password WRITE setPassword NOTIFY passwordChanged FINAL)
26 Q_PROPERTY(Status status READ status NOTIFY statusChanged FINAL)
27 Q_PROPERTY(QAbstractListModel* pageModel READ pageModel NOTIFY pageModelChanged FINAL)
46 UnsupportedSecurityScheme
50 enum class MetaDataField {
62 enum class PageModelRole {
69 QPdfDocument() : QPdfDocument(
nullptr) {}
70 explicit QPdfDocument(QObject *parent);
71 ~QPdfDocument() override;
73 Error load(
const QString &fileName);
75 Status status()
const;
77 void load(QIODevice *device);
78 void setPassword(
const QString &password);
79 QString password()
const;
81 QVariant metaData(MetaDataField field)
const;
87 int pageCount()
const;
89 Q_INVOKABLE QSizeF pagePointSize(
int page)
const;
91 Q_INVOKABLE QString pageLabel(
int page);
92 Q_INVOKABLE
int pageIndexForLabel(
const QString &label);
94 QAbstractListModel *pageModel();
96#if QT_VERSION < QT_VERSION_CHECK(7
, 0
, 0
)
97 QImage render(
int page, QSize imageSize, QPdfDocumentRenderOptions options = QPdfDocumentRenderOptions());
98 QImage render(
int page, QSize imageSize, QPdfDocumentRenderOptions options,
99 QImage::Format format,
const QColor &fillColor);
101 QImage render(
int page, QSize imageSize, QPdfDocumentRenderOptions options = {},
102 QImage::Format format = QImage::Format_ARGB32,
103 const QColor &fillColor = Qt::transparent);
106 Q_INVOKABLE QPdfSelection getSelection(
int page, QPointF start, QPointF end);
107 Q_INVOKABLE QPdfSelection getSelectionAtIndex(
int page,
int startIndex,
int maxLength);
108 Q_INVOKABLE QPdfSelection getAllText(
int page);
111 void passwordChanged();
112 void passwordRequired();
113 void statusChanged(QPdfDocument::Status status);
114 void pageCountChanged(
int pageCount);
115 void pageModelChanged();
118 friend struct QPdfBookmarkModelPrivate;
119 friend class QPdfFile;
120 friend class QPdfLinkModelPrivate;
121 friend class QPdfPageModel;
122 friend class QPdfSearchModel;
123 friend class QPdfSearchModelPrivate;
124 friend class QQuickPdfSelection;
126 QString fileName()
const;
128 Q_PRIVATE_SLOT(d,
void _q_tryLoadingWithSizeFromContentHeader())
129 Q_PRIVATE_SLOT(d,
void _q_copyFromSequentialSourceDevice())
130 QScopedPointer<QPdfDocumentPrivate> d;