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 QImage render(
int page, QSize imageSize, QPdfDocumentRenderOptions options = QPdfDocumentRenderOptions());
98 Q_INVOKABLE QPdfSelection getSelection(
int page, QPointF start, QPointF end);
99 Q_INVOKABLE QPdfSelection getSelectionAtIndex(
int page,
int startIndex,
int maxLength);
100 Q_INVOKABLE QPdfSelection getAllText(
int page);
103 void passwordChanged();
104 void passwordRequired();
105 void statusChanged(QPdfDocument::Status status);
106 void pageCountChanged(
int pageCount);
107 void pageModelChanged();
110 friend struct QPdfBookmarkModelPrivate;
111 friend class QPdfFile;
112 friend class QPdfLinkModelPrivate;
113 friend class QPdfPageModel;
114 friend class QPdfSearchModel;
115 friend class QPdfSearchModelPrivate;
116 friend class QQuickPdfSelection;
118 QString fileName()
const;
120 Q_PRIVATE_SLOT(d,
void _q_tryLoadingWithSizeFromContentHeader())
121 Q_PRIVATE_SLOT(d,
void _q_copyFromSequentialSourceDevice())
122 QScopedPointer<QPdfDocumentPrivate> d;