Poppler Qt6 26.12.90
poppler-qt6.h
1/* poppler-qt.h: qt interface to poppler
2 * Copyright (C) 2005, Net Integration Technologies, Inc.
3 * Copyright (C) 2005, 2007, Brad Hards <bradh@frogmouth.net>
4 * Copyright (C) 2005-2015, 2017-2022, 2026, Albert Astals Cid <aacid@kde.org>
5 * Copyright (C) 2005, Stefan Kebekus <stefan.kebekus@math.uni-koeln.de>
6 * Copyright (C) 2006-2011, Pino Toscano <pino@kde.org>
7 * Copyright (C) 2009 Shawn Rutledge <shawn.t.rutledge@gmail.com>
8 * Copyright (C) 2010 Suzuki Toshiya <mpsuzuki@hiroshima-u.ac.jp>
9 * Copyright (C) 2010 Matthias Fauconneau <matthias.fauconneau@gmail.com>
10 * Copyright (C) 2011 Andreas Hartmetz <ahartmetz@gmail.com>
11 * Copyright (C) 2011 Glad Deschrijver <glad.deschrijver@gmail.com>
12 * Copyright (C) 2012, Guillermo A. Amaral B. <gamaral@kde.org>
13 * Copyright (C) 2012, Fabio D'Urso <fabiodurso@hotmail.it>
14 * Copyright (C) 2012, Tobias Koenig <tobias.koenig@kdab.com>
15 * Copyright (C) 2012, 2014, 2015, 2018, 2019 Adam Reichold <adamreichold@myopera.com>
16 * Copyright (C) 2012, 2013 Thomas Freitag <Thomas.Freitag@alfa.de>
17 * Copyright (C) 2013 Anthony Granger <grangeranthony@gmail.com>
18 * Copyright (C) 2016 Jakub Alba <jakubalba@gmail.com>
19 * Copyright (C) 2017, 2020, 2021 Oliver Sander <oliver.sander@tu-dresden.de>
20 * Copyright (C) 2017, 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info@kdab.com>. Work sponsored by the LiMux project of the city of Munich
21 * Copyright (C) 2018, 2021 Nelson Benítez León <nbenitezl@gmail.com>
22 * Copyright (C) 2019 Jan Grulich <jgrulich@redhat.com>
23 * Copyright (C) 2019 Alexander Volkov <a.volkov@rusbitech.ru>
24 * Copyright (C) 2020 Philipp Knechtges <philipp-dev@knechtges.com>
25 * Copyright (C) 2020 Katarina Behrens <Katarina.Behrens@cib.de>
26 * Copyright (C) 2020 Thorsten Behrens <Thorsten.Behrens@CIB.de>
27 * Copyright (C) 2020, 2024 Klarälvdalens Datakonsult AB, a KDAB Group company, <info@kdab.com>. Work sponsored by Technische Universität Dresden
28 * Copyright (C) 2021 Klarälvdalens Datakonsult AB, a KDAB Group company, <info@kdab.com>.
29 * Copyright (C) 2021 Mahmoud Khalil <mahmoudkhalil11@gmail.com>
30 * Copyright (C) 2021 Georgiy Sgibnev <georgiy@sgibnev.com>. Work sponsored by lab50.net.
31 * Copyright (C) 2022 Martin <martinbts@gmx.net>
32 * Copyright (C) 2023 Kevin Ottens <kevin.ottens@enioka.com>. Work sponsored by De Bortoli Wines
33 * Copyright (C) 2024 Pratham Gandhi <ppg.1382@gmail.com>
34 * Copyright (C) 2025 Stefan Brüns <stefan.bruens@rwth-aachen.de>
35 * Copyright (C) 2026 懒羊羊 <yangyanglan718@gmail.com>
36 *
37 * This program is free software; you can redistribute it and/or modify
38 * it under the terms of the GNU General Public License as published by
39 * the Free Software Foundation; either version 2, or (at your option)
40 * any later version.
41 *
42 * This program is distributed in the hope that it will be useful,
43 * but WITHOUT ANY WARRANTY; without even the implied warranty of
44 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
45 * GNU General Public License for more details.
46 *
47 * You should have received a copy of the GNU General Public License
48 * along with this program; if not, write to the Free Software
49 * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
50 */
51
52#ifndef __POPPLER_QT_H__
53#define __POPPLER_QT_H__
54
55#include <functional>
56#include <memory>
57#include <vector>
58
59#include "poppler-annotation.h"
60#include "poppler-link.h"
61#include "poppler-optcontent.h"
62#include "poppler-page-transition.h"
63#include "poppler-converter.h"
64
65#include <QtCore/QByteArray>
66#include <QtCore/QDateTime>
67#include <QtCore/QIODevice>
68#include <QtCore/QSet>
69#include "poppler-export.h"
70
71class EmbFile;
72class Sound;
73class AnnotMovie;
74
78namespace Poppler {
79
80class Document;
81class DocumentData;
82
83class PageData;
84
85class FormField;
87
88class TextBoxData;
89
90class PDFConverter;
91class PSConverter;
92
93struct OutlineItemData;
94
102using PopplerDebugFunc = void (*)(const QString & /*message*/, const QVariant & /*closure*/);
103
113POPPLER_QT6_EXPORT void setDebugErrorFunction(PopplerDebugFunc debugFunction, const QVariant &closure);
114
124class POPPLER_QT6_EXPORT TextBox
125{
126 friend class Page;
127
128public:
135 {
136 Rotate0 = 0,
137 Rotate90 = 1,
138 Rotate180 = 2,
139 Rotate270 = 3
140 };
141
147 TextBox(const QString &text, const QRectF &bBox);
152
156 QString text() const;
157
162 QRectF boundingBox() const;
163
170
174 QRectF charBoundingBox(int i) const;
175
179 bool hasSpaceAfter() const;
180
187
188private:
189 Q_DISABLE_COPY(TextBox)
190
191 TextBoxData *m_data;
192};
193
194class FontInfoData;
199class POPPLER_QT6_EXPORT FontInfo
200{
201 friend class Document;
202
203public:
207 enum Type
208 {
209 unknown,
210 Type1,
211 Type1C,
212 Type1COT,
213 Type3,
214 TrueType,
215 TrueTypeOT,
216 CIDType0,
217 CIDType0C,
218 CIDType0COT,
219 CIDTrueType,
220 CIDTrueTypeOT
221 };
222
224
227 FontInfo();
228
232 explicit FontInfo(const FontInfoData &fid);
234
238 FontInfo(const FontInfo &fi);
239
244
248 QString name() const;
249
253 QString substituteName() const;
254
259 QString file() const;
260
266 bool isEmbedded() const;
267
274 bool isSubset() const;
275
283 Type type() const;
284
293 QString typeName() const;
294
299
300private:
301 FontInfoData *m_data;
302};
303
304class FontIteratorData;
321class POPPLER_QT6_EXPORT FontIterator
322{
323 friend class Document;
324 friend class DocumentData;
325
326public:
331
336 QList<FontInfo> next();
337
342 bool hasNext() const;
343
347 int currentPage() const;
348
349private:
350 Q_DISABLE_COPY(FontIterator)
351 FontIterator(int startPage, DocumentData *dd);
352
353 FontIteratorData *d;
354};
355
356class EmbeddedFileData;
360class POPPLER_QT6_EXPORT EmbeddedFile
361{
362 friend class DocumentData;
363 friend class AnnotationPrivate;
364
365public:
367 explicit EmbeddedFile(EmbFile *embfile);
369
374
378 QString name() const;
379
385 QString description() const;
386
392 int size() const;
393
397 QDateTime modDate() const;
398
402 QDateTime createDate() const;
403
409 QByteArray checksum() const;
410
414 QString mimeType() const;
415
419 QByteArray data();
420
424 bool isValid() const;
425
429 // QDataStream dataStream() const;
430
431private:
432 Q_DISABLE_COPY(EmbeddedFile)
433 explicit EmbeddedFile(EmbeddedFileData &dd);
434
435 EmbeddedFileData *m_embeddedFile;
436};
437
446class POPPLER_QT6_EXPORT Page
447{
448 friend class Document;
449
450public:
455
460 {
465 };
466
475
485
490 {
491 NoPainterFlags = 0x00000000,
500 };
501 Q_DECLARE_FLAGS(PainterFlags, PainterFlag)
502
503
539 QImage renderToImage(double xres = 72.0, double yres = 72.0, int x = -1, int y = -1, int w = -1, int h = -1, Rotation rotate = Rotate0) const;
540
548 using RenderToImagePartialUpdateFunc = void (*)(const QImage & /*image*/, const QVariant & /*closure*/);
549
556 using ShouldRenderToImagePartialQueryFunc = bool (*)(const QVariant & /*closure*/);
557
605 QImage renderToImage(double xres, double yres, int x, int y, int w, int h, Rotation rotate, RenderToImagePartialUpdateFunc partialUpdateCallback, ShouldRenderToImagePartialQueryFunc shouldDoPartialUpdateCallback,
606 const QVariant &payload) const;
607
613 using ShouldAbortQueryFunc = bool (*)(const QVariant & /*closure*/);
614
666 QImage renderToImage(double xres, double yres, int x, int y, int w, int h, Rotation rotate, RenderToImagePartialUpdateFunc partialUpdateCallback, ShouldRenderToImagePartialQueryFunc shouldDoPartialUpdateCallback,
667 ShouldAbortQueryFunc shouldAbortRenderCallback, const QVariant &payload) const;
668
709 bool renderToPainter(QPainter *painter, double xres = 72.0, double yres = 72.0, int x = -1, int y = -1, int w = -1, int h = -1, Rotation rotate = Rotate0, PainterFlags flags = NoPainterFlags) const;
710
717 QImage thumbnail() const;
718
730 QString text(const QRectF &rect, TextLayout textLayout) const;
731
740 QString text(const QRectF &rect) const;
741
751
760
765 {
766 NoSearchFlags = 0x00000000,
767 IgnoreCase = 0x00000001,
768 WholeWords = 0x00000002,
769 IgnoreDiacritics = 0x00000004,
772 AcrossLines = 0x00000008
775 };
776 Q_DECLARE_FLAGS(SearchFlags, SearchFlag)
777
778
788 bool search(const QString &text, double &sLeft, double &sTop, double &sRight, double &sBottom, SearchDirection direction, SearchFlags flags = NoSearchFlags, Rotation rotate = Rotate0) const;
789
802 QList<QRectF> search(const QString &text, SearchFlags flags = NoSearchFlags, Rotation rotate = Rotate0) const;
803
817 std::vector<std::unique_ptr<TextBox>> textList(Rotation rotate = Rotate0) const;
818
838 std::vector<std::unique_ptr<TextBox>> textList(Rotation rotate, ShouldAbortQueryFunc shouldAbortExtractionCallback, const QVariant &closure) const;
839
843 QSizeF pageSizeF() const;
844
848 QSize pageSize() const;
849
861
865 std::unique_ptr<Link> action(PageAction act) const;
866
877
882
886 void defaultCTM(double *CTM, double dpiX, double dpiY, int rotate, bool upsideDown);
887
891 std::vector<std::unique_ptr<Link>> links() const;
892
899 std::vector<std::unique_ptr<Annotation>> annotations() const;
900
909 std::vector<std::unique_ptr<Annotation>> annotations(const QSet<Annotation::SubType> &subtypes) const;
910
917 void addAnnotation(const Annotation *ann);
918
924 void removeAnnotation(const Annotation *ann);
925
929 std::vector<std::unique_ptr<FormField>> formFields() const;
930
936 double duration() const;
937
941 QString label() const;
942
946 int index() const;
947
948private:
949 Q_DISABLE_COPY(Page)
950
951 Page(DocumentData *doc, int index);
952 PageData *m_page;
953};
954
960class POPPLER_QT6_EXPORT OutlineItem
961{
962 friend class Document;
963
964public:
969 ~OutlineItem();
970
971 OutlineItem(const OutlineItem &other);
972 OutlineItem &operator=(const OutlineItem &other);
973
974 OutlineItem(OutlineItem &&other) noexcept;
975 OutlineItem &operator=(OutlineItem &&other) noexcept;
976
980 bool isNull() const;
981
985 QString name() const;
986
990 bool isOpen() const;
991
997 QSharedPointer<const LinkDestination> destination() const;
998
1004 QString externalFileName() const;
1005
1011 QString uri() const;
1012
1018 bool hasChildren() const;
1019
1025 QVector<OutlineItem> children() const;
1026
1027private:
1028 explicit OutlineItem(OutlineItemData *data);
1029 OutlineItemData *m_data;
1030};
1031
1082class POPPLER_QT6_EXPORT Document
1083{
1084 friend class Page;
1085 friend class DocumentData;
1086
1087public:
1100
1114
1123
1128 {
1129 Antialiasing = 0x00000001,
1130 TextAntialiasing = 0x00000002,
1131 TextHinting = 0x00000004,
1132 TextSlightHinting = 0x00000008,
1133 OverprintPreview = 0x00000010,
1134 ThinLineSolid = 0x00000020,
1135 ThinLineShape = 0x00000040,
1136 IgnorePaperColor = 0x00000080,
1137 HideAnnotations = 0x00000100
1138 };
1139 Q_DECLARE_FLAGS(RenderHints, RenderHint)
1140
1141
1150
1161 void setColorDisplayProfile(void *outputProfileA);
1169 void setColorDisplayProfileName(const QString &name);
1178 void *colorRgbProfile() const;
1187 void *colorDisplayProfile() const;
1188
1203 static std::unique_ptr<Document> load(const QString &filePath, const QByteArray &ownerPassword = QByteArray(), const QByteArray &userPassword = QByteArray());
1204
1222 static std::unique_ptr<Document> load(QIODevice *device, const QByteArray &ownerPassword = QByteArray(), const QByteArray &userPassword = QByteArray());
1223
1240 static std::unique_ptr<Document> loadFromData(const QByteArray &fileContents, const QByteArray &ownerPassword = QByteArray(), const QByteArray &userPassword = QByteArray());
1241
1257 std::unique_ptr<Page> page(int index) const;
1258
1271 std::unique_ptr<Page> page(const QString &label) const;
1272
1276 int numPages() const;
1277
1284
1291
1296 Qt::LayoutDirection textDirection() const;
1297
1306 bool unlock(const QByteArray &ownerPassword, const QByteArray &userPassword);
1307
1311 bool isLocked() const;
1312
1328 QDateTime date(const QString &type) const;
1329
1335 bool setDate(const QString &key, const QDateTime &val);
1336
1340 QDateTime creationDate() const;
1341
1347 bool setCreationDate(const QDateTime &val);
1348
1352 QDateTime modificationDate() const;
1353
1359 bool setModificationDate(const QDateTime &val);
1360
1377 QString info(const QString &type) const;
1378
1384 bool setInfo(const QString &key, const QString &val);
1385
1389 QString title() const;
1390
1396 bool setTitle(const QString &val);
1397
1401 QString author() const;
1402
1408 bool setAuthor(const QString &val);
1409
1413 QString subject() const;
1414
1420 bool setSubject(const QString &val);
1421
1425 QString keywords() const;
1426
1432 bool setKeywords(const QString &val);
1433
1437 QString creator() const;
1438
1444 bool setCreator(const QString &val);
1445
1449 QString producer() const;
1450
1456 bool setProducer(const QString &val);
1457
1464
1468 QStringList infoKeys() const;
1469
1473 bool isEncrypted() const;
1474
1481 bool isLinearized() const;
1482
1487 bool okToPrint() const;
1488
1493 bool okToPrintHighRes() const;
1494
1502 bool okToChange() const;
1503
1508 bool okToCopy() const;
1509
1515 bool okToAddNotes() const;
1516
1524 bool okToFillForm() const;
1525
1532
1539
1547 bool okToAssemble() const;
1548
1551 {
1552 int major;
1553 int minor;
1554 };
1555
1563
1575 QList<FontInfo> fonts() const;
1576
1587 std::unique_ptr<FontIterator> newFontIterator(int startPage = 0) const;
1588
1592 QByteArray fontData(const FontInfo &fi) const;
1593
1602 QList<EmbeddedFile *> embeddedFiles() const;
1603
1607 bool hasEmbeddedFiles() const;
1608
1614 QVector<OutlineItem> outline() const;
1615
1624 std::unique_ptr<LinkDestination> linkDestination(const QString &name);
1625
1631 void setPaperColor(const QColor &color);
1637 QColor paperColor() const;
1638
1651
1655 static QSet<RenderBackend> availableRenderBackends();
1656
1664 void setRenderHint(RenderHint hint, bool on = true);
1668 RenderHints renderHints() const;
1669
1673 std::unique_ptr<PSConverter> psConverter() const;
1674
1678 std::unique_ptr<PDFConverter> pdfConverter() const;
1679
1683 QString metadata() const;
1684
1696
1703
1710
1717 QStringList scripts() const;
1718
1735
1742 std::unique_ptr<Link> additionalAction(DocumentAdditionalActionsType type) const;
1743
1754 bool getPdfId(QByteArray *permanentId, QByteArray *updateId) const;
1755
1760
1764 QVector<int> formCalculateOrder() const;
1765
1772 std::vector<std::unique_ptr<FormFieldSignature>> signatures() const;
1773
1780
1787 void setXRefReconstructedCallback(const std::function<void()> &callback);
1788
1793
1794private:
1795 Q_DISABLE_COPY(Document)
1796
1797 DocumentData *m_doc;
1798
1799 explicit Document(DocumentData *dataA);
1800};
1801
1805POPPLER_QT6_EXPORT QDateTime convertDate(const char *dateString);
1806
1810POPPLER_QT6_EXPORT bool isCmsAvailable();
1811
1815POPPLER_QT6_EXPORT bool isOverprintPreviewAvailable();
1816
1817class SoundData;
1825class POPPLER_QT6_EXPORT SoundObject
1826{
1827public:
1836
1847
1851 explicit SoundObject(const Sound *popplersound);
1853
1854 ~SoundObject();
1855
1860
1864 QString url() const;
1865
1869 QByteArray data() const;
1870
1874 double samplingRate() const;
1875
1879 int channels() const;
1880
1884 int bitsPerSample() const;
1885
1890
1891private:
1892 Q_DISABLE_COPY(SoundObject)
1893
1894 SoundData *m_soundData;
1895};
1896
1897class MovieData;
1901class POPPLER_QT6_EXPORT MovieObject
1902{
1903 friend class AnnotationPrivate;
1904
1905public:
1916
1917 ~MovieObject();
1918
1922 QString url() const;
1923
1927 QSize size() const;
1928
1932 int rotation() const;
1933
1937 bool showControls() const;
1938
1943
1947 bool showPosterImage() const;
1948
1954 QImage posterImage() const;
1955
1956private:
1958 explicit MovieObject(AnnotMovie *ann);
1960
1961 Q_DISABLE_COPY(MovieObject)
1962
1963 MovieData *m_movieData;
1964};
1965
1966}
1967
1968Q_DECLARE_OPERATORS_FOR_FLAGS(Poppler::Page::PainterFlags)
1969Q_DECLARE_OPERATORS_FOR_FLAGS(Poppler::Page::SearchFlags)
1970Q_DECLARE_OPERATORS_FOR_FLAGS(Poppler::Document::RenderHints)
1971
1972#endif
Annotation class holding properties shared by all annotations.
Definition poppler-annotation.h:181
PDF document.
Definition poppler-qt6.h:1083
QString subject() const
The subject of the document.
RenderHints renderHints() const
The currently set render hints.
bool isLinearized() const
Test if the document is linearised.
bool setAuthor(const QString &val)
Set the author of the document to.
static std::unique_ptr< Document > load(const QString &filePath, const QByteArray &ownerPassword=QByteArray(), const QByteArray &userPassword=QByteArray())
Load the document from a file on disk.
bool setTitle(const QString &val)
Set the title of the document to.
bool okToChange() const
Test if the permissions on the document allow it to be changed.
QString title() const
The title of the document.
std::unique_ptr< FontIterator > newFontIterator(int startPage=0) const
Creates a new FontIterator object for font scanning.
bool okToCreateFormFields() const
Test if the permissions on the document allow interactive form fields (including signature fields) to...
bool isLocked() const
Determine if the document is locked.
std::unique_ptr< PDFConverter > pdfConverter() const
Gets a new PDF converter for this document.
bool okToCopy() const
Test if the permissions on the document allow the contents to be copied / extracted.
QVector< OutlineItem > outline() const
Gets the outline of the document.
bool getPdfId(QByteArray *permanentId, QByteArray *updateId) const
The PDF identifiers.
int numPages() const
The number of pages in the document.
bool removeInfo()
Remove the document's Info dictionary.
PageLayout
The page layout.
Definition poppler-qt6.h:1105
@ TwoPageRight
Display the pages two at a time, with odd-numbered pages on the right.
Definition poppler-qt6.h:1112
@ TwoPageLeft
Display the pages two at a time, with odd-numbered pages on the left.
Definition poppler-qt6.h:1111
@ TwoColumnLeft
Display the pages in two columns, with odd-numbered pages on the left.
Definition poppler-qt6.h:1109
@ SinglePage
Display a single page.
Definition poppler-qt6.h:1107
@ NoLayout
Layout not specified.
Definition poppler-qt6.h:1106
@ TwoColumnRight
Display the pages in two columns, with odd-numbered pages on the right.
Definition poppler-qt6.h:1110
@ OneColumn
Display a single column of pages.
Definition poppler-qt6.h:1108
std::unique_ptr< LinkDestination > linkDestination(const QString &name)
Tries to resolve the named destination name.
bool hasOptionalContent() const
Test whether this document has "optional content".
QDateTime date(const QString &type) const
The date associated with the document.
bool okToAddNotes() const
Test if the permissions on the document allow annotations to be added or modified,...
QDateTime creationDate() const
The date of the creation of the document.
static std::unique_ptr< Document > load(QIODevice *device, const QByteArray &ownerPassword=QByteArray(), const QByteArray &userPassword=QByteArray())
Load the document from a device.
bool setCreator(const QString &val)
Set the creator of the document to.
void setRenderHint(RenderHint hint, bool on=true)
Sets the render hint .
bool setProducer(const QString &val)
Set the producer of the document to.
QStringList infoKeys() const
Obtain a list of the available string information keys.
void * colorDisplayProfile() const
Return the current display profile.
void setPaperColor(const QColor &color)
Sets the paper color.
RenderBackend
The render backends available.
Definition poppler-qt6.h:1119
@ SplashBackend
Splash backend.
Definition poppler-qt6.h:1120
@ QPainterBackend
Qt backend.
Definition poppler-qt6.h:1121
std::unique_ptr< PSConverter > psConverter() const
Gets a new PS converter for this document.
bool unlock(const QByteArray &ownerPassword, const QByteArray &userPassword)
Provide the passwords required to unlock the document.
QByteArray fontData(const FontInfo &fi) const
The font data if the font is an embedded one.
std::unique_ptr< Page > page(int index) const
Get a specified Page.
bool setDate(const QString &key, const QDateTime &val)
Set the Info dict date entry specified by.
PageMode
The page mode.
Definition poppler-qt6.h:1092
@ UseOutlines
Document outline visible.
Definition poppler-qt6.h:1094
@ UseAttach
Attachments panel visible.
Definition poppler-qt6.h:1098
@ UseNone
No mode - neither document outline nor thumbnail images are visible.
Definition poppler-qt6.h:1093
@ UseThumbs
Thumbnail images visible.
Definition poppler-qt6.h:1095
@ FullScreen
Fullscreen mode (no menubar, windows controls etc).
Definition poppler-qt6.h:1096
@ UseOC
Optional content group panel visible.
Definition poppler-qt6.h:1097
PdfVersion getPdfVersion() const
The version of the PDF specification that the document conforms to.
QDateTime modificationDate() const
The date of the last change in the document.
void setRenderBackend(RenderBackend backend)
Sets the backend used to render the pages.
std::unique_ptr< Page > page(const QString &label) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
RenderHint
The render hints available.
Definition poppler-qt6.h:1128
@ IgnorePaperColor
Do not compose with the paper color.
Definition poppler-qt6.h:1136
@ TextHinting
Hinting for text.
Definition poppler-qt6.h:1131
@ ThinLineShape
Enhance thin lines shape. Wins over ThinLineSolid.
Definition poppler-qt6.h:1135
@ HideAnnotations
Do not render annotations.
Definition poppler-qt6.h:1137
@ TextSlightHinting
Lighter hinting for text when combined with TextHinting.
Definition poppler-qt6.h:1132
@ OverprintPreview
Overprint preview.
Definition poppler-qt6.h:1133
@ TextAntialiasing
Antialiasing for text.
Definition poppler-qt6.h:1130
@ Antialiasing
Antialiasing for graphics.
Definition poppler-qt6.h:1129
@ ThinLineSolid
Enhance thin lines solid.
Definition poppler-qt6.h:1134
Qt::LayoutDirection textDirection() const
The predominant reading order for text as supplied by the document's viewer preferences.
QString metadata() const
Gets the metadata stream contents.
DocumentAdditionalActionsType
Describes the flags for additional document actions i.e.
Definition poppler-qt6.h:1728
@ CloseDocument
Performed before closing the document.
Definition poppler-qt6.h:1729
@ PrintDocumentStart
Performed before printing the document.
Definition poppler-qt6.h:1732
@ PrintDocumentFinish
Performed after printing the document.
Definition poppler-qt6.h:1733
@ SaveDocumentFinish
Performed after saving the document.
Definition poppler-qt6.h:1731
@ SaveDocumentStart
Performed before saving the document.
Definition poppler-qt6.h:1730
void setColorDisplayProfile(void *outputProfileA)
Set a color display profile for the current document.
bool okToPrintHighRes() const
Test if the permissions on the document allow it to be printed at high resolution.
bool okToExtractForAccessibility() const
Test if the permissions on the document allow content extraction (text and perhaps other content) for...
bool setModificationDate(const QDateTime &val)
Set the modification date of the document to.
void * colorRgbProfile() const
Return the current RGB profile.
QString author() const
The author of the document.
bool isEncrypted() const
Test if the document is encrypted.
void setColorDisplayProfileName(const QString &name)
Set a color display profile for the current document.
static QSet< RenderBackend > availableRenderBackends()
The available rendering backends.
void applyResetFormsLink(const LinkResetForm &link)
Resets the form with the details contained in the link.
QList< EmbeddedFile * > embeddedFiles() const
The documents embedded within the PDF document.
bool okToAssemble() const
Test if the permissions on the document allow it to be "assembled" - insertion, rotation and deletion...
OptContentModel * optionalContentModel()
Itemviews model for optional content.
~Document()
Destructor.
QString creator() const
The creator of the document.
bool hasEmbeddedFiles() const
Whether there are any documents embedded in this PDF document.
QString producer() const
The producer of the document.
std::vector< std::unique_ptr< FormFieldSignature > > signatures() const
Returns the signatures of this document.
PageLayout pageLayout() const
The layout that pages should be shown in when the document is first opened.
void setXRefReconstructedCallback(const std::function< void()> &callback)
Sets the document's XRef reconstruction callback, so whenever a XRef table reconstruction happens the...
bool setSubject(const QString &val)
Set the subject of the document to.
PageMode pageMode() const
The type of mode that should be used by the application when the document is opened.
FormType
Form types.
Definition poppler-qt6.h:1145
@ AcroForm
AcroForm.
Definition poppler-qt6.h:1147
@ XfaForm
Adobe XML Forms Architecture (XFA), currently unsupported.
Definition poppler-qt6.h:1148
@ NoForm
Document doesn't contain forms.
Definition poppler-qt6.h:1146
bool setCreationDate(const QDateTime &val)
Set the creation date of the document to.
FormType formType() const
Returns the type of forms contained in the document.
QList< FontInfo > fonts() const
The fonts within the PDF document.
bool xrefWasReconstructed() const
Returns whether the document's XRef table has been reconstructed or not.
QColor paperColor() const
The paper color.
QString keywords() const
The keywords of the document.
bool okToPrint() const
Test if the permissions on the document allow it to be printed.
static std::unique_ptr< Document > loadFromData(const QByteArray &fileContents, const QByteArray &ownerPassword=QByteArray(), const QByteArray &userPassword=QByteArray())
Load the document from memory.
RenderBackend renderBackend() const
The currently set render backend.
QVector< int > formCalculateOrder() const
Returns the calculate order for forms (using their id).
bool setKeywords(const QString &val)
Set the keywords of the document to.
std::unique_ptr< Link > additionalAction(DocumentAdditionalActionsType type) const
Returns the additional action of the given type for the document or 0 if no action has been defined.
QStringList scripts() const
Document-level JavaScript scripts.
QString info(const QString &type) const
Get specified information associated with the document.
bool setInfo(const QString &key, const QString &val)
Set the value of the document's Info dictionary entry specified by.
bool okToFillForm() const
Test if the permissions on the document allow interactive form fields (including signature fields) to...
bool isValid() const
Is the embedded file valid?
QString description() const
The description associated with the file, if any.
~EmbeddedFile()
Destructor.
QByteArray checksum() const
The MD5 checksum of the file.
QString name() const
The name associated with the file.
QString mimeType() const
The MIME type of the file, if known.
QDateTime createDate() const
The creation date for the embedded file, if known.
QDateTime modDate() const
The modification date for the embedded file, if known.
int size() const
The size of the file.
QByteArray data()
The data as a byte array.
Container class for information about a font within a PDF document.
Definition poppler-qt6.h:200
Type type() const
The type of font encoding.
FontInfo & operator=(const FontInfo &fi)
Standard assignment operator.
QString name() const
The name of the font.
QString typeName() const
The name of the font encoding used.
QString file() const
The path of the font file used to represent this font on this system, or a null string is the font is...
FontInfo(const FontInfo &fi)
Copy constructor.
Type
The type of font.
Definition poppler-qt6.h:208
QString substituteName() const
The name of the substitute font.
bool isSubset() const
Whether the font provided is only a subset of the full font or not.
~FontInfo()
Destructor.
bool isEmbedded() const
Whether the font is embedded in the file, or not.
int currentPage() const
Returns the current page where the iterator is.
~FontIterator()
Destructor.
bool hasNext() const
Checks whether there is at least one more page to iterate, ie returns false when the iterator is beyo...
QList< FontInfo > next()
Returns the fonts of the current page and then advances the iterator to the next page.
A form field that represents a signature.
Definition poppler-form.h:825
The base class representing a form field.
Definition poppler-form.h:91
ResetForm: an action to reset form fields.
Definition poppler-link.h:682
Container class for a movie object in a PDF document.
Definition poppler-qt6.h:1902
QString url() const
The URL of the movie to be played.
bool showControls() const
Whether show a bar with movie controls.
int rotation() const
The rotation (either 0, 90, 180, or 270 degrees clockwise) for the movie,.
bool showPosterImage() const
Returns whether a poster image should be shown if the movie is not playing.
QSize size() const
The size of the movie.
QImage posterImage() const
Returns the poster image that should be shown if the movie is not playing.
PlayMode
The play mode for playing the movie.
Definition poppler-qt6.h:1910
@ PlayPalindrome
Play forward, then backward, then again foward and so on until stopped.
Definition poppler-qt6.h:1914
@ PlayRepeat
Play continuously until stopped.
Definition poppler-qt6.h:1913
@ PlayOnce
Play the movie once, closing the movie controls at the end.
Definition poppler-qt6.h:1911
@ PlayOpen
Like PlayOnce, but leaving the controls open.
Definition poppler-qt6.h:1912
PlayMode playMode() const
How to play the movie.
Model for optional content.
Definition poppler-optcontent.h:48
QString uri() const
The URI to which the item links.
QString name() const
The name of the item which should be displayed to the user.
QVector< OutlineItem > children() const
Gets the child items of this item.
QSharedPointer< const LinkDestination > destination() const
The destination referred to by this item.
bool isOpen() const
Indicates whether the item should initially be display in an expanded or collapsed state.
OutlineItem()
Constructs a null item, i.e.
bool isNull() const
Indicates whether an item is null, i.e.
QString externalFileName() const
The external file name of the document to which the.
bool hasChildren() const
Determines if this item has any child items.
Describes how a PDF file viewer shall perform the transition from one page to another.
Definition poppler-page-transition.h:48
void defaultCTM(double *CTM, double dpiX, double dpiY, int rotate, bool upsideDown)
The default CTM.
bool(*)(const QVariant &) ShouldRenderToImagePartialQueryFunc
Partial Update query renderToImage callback.
Definition poppler-qt6.h:556
Orientation
Types of orientations that are possible.
Definition poppler-qt6.h:871
@ UpsideDown
Upside down orientation (portrait, with 180 degrees rotation).
Definition poppler-qt6.h:875
@ Seascape
Seascape orientation (portrait, with 270 degrees clockwise rotation).
Definition poppler-qt6.h:874
@ Landscape
Landscape orientation (portrait, with 90 degrees clockwise rotation ).
Definition poppler-qt6.h:872
@ Portrait
Normal portrait orientation.
Definition poppler-qt6.h:873
SearchFlag
Flags to modify the search behaviour.
Definition poppler-qt6.h:765
@ IgnoreCase
Case differences are ignored.
Definition poppler-qt6.h:767
@ WholeWords
Only whole words are matched.
Definition poppler-qt6.h:768
@ AcrossLines
Allows to match on text spanning from end of a line to the next line.
Definition poppler-qt6.h:772
@ IgnoreDiacritics
Diacritic differences (eg.
Definition poppler-qt6.h:769
bool search(const QString &text, double &sLeft, double &sTop, double &sRight, double &sBottom, SearchDirection direction, SearchFlags flags=NoSearchFlags, Rotation rotate=Rotate0) const
Returns true if the specified text was found.
std::vector< std::unique_ptr< FormField > > formFields() const
Returns the form fields on the page.
std::vector< std::unique_ptr< Annotation > > annotations() const
Returns the annotations of the page.
void addAnnotation(const Annotation *ann)
Adds an annotation to the page.
QString text(const QRectF &rect, TextLayout textLayout) const
Returns the text that is inside a specified rectangle.
std::vector< std::unique_ptr< Link > > links() const
Gets the links of the page.
QSizeF pageSizeF() const
std::unique_ptr< Link > action(PageAction act) const
Gets the page action specified, or empty unique pointer if there is no action.
PageTransition * transition() const
Returns the transition of this page.
int index() const
Returns the index of the page.
SearchDirection
The starting point for a search.
Definition poppler-qt6.h:746
@ PreviousResult
Find the previous result, moving "up the page".
Definition poppler-qt6.h:749
@ FromTop
Start sorting at the top of the document.
Definition poppler-qt6.h:747
@ NextResult
Find the next result, moving "down the page".
Definition poppler-qt6.h:748
PainterFlag
Additional flags for the renderToPainter method.
Definition poppler-qt6.h:490
@ DontSaveAndRestore
Do not save/restore the caller-owned painter.
Definition poppler-qt6.h:499
QImage thumbnail() const
Get the page thumbnail if it exists.
Rotation
The type of rotation to apply for an operation.
Definition poppler-qt6.h:460
@ Rotate270
Rotate 270 degrees clockwise (90 degrees counterclockwise).
Definition poppler-qt6.h:464
@ Rotate90
Rotate 90 degrees clockwise.
Definition poppler-qt6.h:462
@ Rotate0
Do not rotate.
Definition poppler-qt6.h:461
@ Rotate180
Rotate 180 degrees.
Definition poppler-qt6.h:463
~Page()
Destructor.
Orientation orientation() const
The orientation of the page.
SearchMode
The type of search to perform.
Definition poppler-qt6.h:756
@ CaseSensitive
Case differences cause no match in searching.
Definition poppler-qt6.h:757
@ CaseInsensitive
Case differences are ignored in matching.
Definition poppler-qt6.h:758
std::vector< std::unique_ptr< TextBox > > textList(Rotation rotate=Rotate0) const
Returns a list of text of the page.
std::vector< std::unique_ptr< Annotation > > annotations(const QSet< Annotation::SubType > &subtypes) const
Returns the annotations of the page.
TextLayout
How the text is going to be returned.
Definition poppler-qt6.h:480
@ ReadingOrder
The text is returned in reading order,.
Definition poppler-qt6.h:483
@ RawOrderLayout
The text is returned without any type of processing.
Definition poppler-qt6.h:482
@ PhysicalLayout
The text is layouted to resemble the real page layout.
Definition poppler-qt6.h:481
PageAction
The kinds of page actions.
Definition poppler-qt6.h:471
@ Closing
The action when a page is "closed".
Definition poppler-qt6.h:473
@ Opening
The action when a page is "opened".
Definition poppler-qt6.h:472
QSize pageSize() const
double duration() const
Returns the page duration.
void(*)(const QImage &, const QVariant &) RenderToImagePartialUpdateFunc
Partial Update renderToImage callback.
Definition poppler-qt6.h:548
QString label() const
Returns the label of the page, or a null string is the page has no label.
QImage renderToImage(double xres=72.0, double yres=72.0, int x=-1, int y=-1, int w=-1, int h=-1, Rotation rotate=Rotate0) const
Render the page to a QImage using the current Document renderer.
bool renderToPainter(QPainter *painter, double xres=72.0, double yres=72.0, int x=-1, int y=-1, int w=-1, int h=-1, Rotation rotate=Rotate0, PainterFlags flags=NoPainterFlags) const
Render the page to the specified QPainter using the current Document renderer.
void removeAnnotation(const Annotation *ann)
Removes an annotation from the page and destroys the annotation object.
bool(*)(const QVariant &) ShouldAbortQueryFunc
Abort query function callback.
Definition poppler-qt6.h:613
Container class for a sound file in a PDF document.
Definition poppler-qt6.h:1826
double samplingRate() const
The sampling rate of the sound.
SoundEncoding soundEncoding() const
The encoding used for the sound.
int channels() const
The number of sound channels to use to play the sound.
SoundType soundType() const
Is the sound embedded (SoundObject::Embedded) or external (SoundObject::External)?
QString url() const
The URL of the sound file to be played, in case of SoundObject::External.
SoundEncoding
The encoding format used for the sound.
Definition poppler-qt6.h:1841
@ ALaw
A-law-encoded samples.
Definition poppler-qt6.h:1845
@ muLaw
mu-law-encoded samples
Definition poppler-qt6.h:1844
@ Signed
Twos-complement values.
Definition poppler-qt6.h:1843
@ Raw
Raw encoding, with unspecified or unsigned values in the range [ 0, 2^B - 1 ].
Definition poppler-qt6.h:1842
SoundType
The type of sound.
Definition poppler-qt6.h:1832
@ External
The real sound file is external.
Definition poppler-qt6.h:1833
@ Embedded
The sound is contained in the data.
Definition poppler-qt6.h:1834
int bitsPerSample() const
The number of bits per sample value per channel.
QByteArray data() const
The data of the sound, in case of SoundObject::Embedded.
Describes the physical location of text on a document page.
Definition poppler-qt6.h:125
Rotation
Describes the rotation of the text.
Definition poppler-qt6.h:135
bool hasSpaceAfter() const
Returns whether there is a space character after this text box.
TextBox(const QString &text, const QRectF &bBox)
The default constructor sets the text and the rectangle that contains the text.
Rotation rotation() const
Returns the rotation of the text.
QString text() const
Returns the text of this text box.
~TextBox()
Destructor.
QRectF charBoundingBox(int i) const
Returns the bounding box of the i -th characted of the word.
TextBox * nextWord() const
Returns the pointer to the next text box, if there is one.
QRectF boundingBox() const
Returns the position of the text, in point, i.e., 1/72 of an inch.
The Poppler Qt6 binding.
Definition poppler-annotation.h:55
QDateTime convertDate(const char *dateString)
Conversion from PDF date string format to QDateTime.
void(*)(const QString &, const QVariant &) PopplerDebugFunc
Debug/error function.
Definition poppler-qt6.h:102
bool isOverprintPreviewAvailable()
Whether the overprint preview functionality is available.
bool isCmsAvailable()
Whether the color management functions are available.
void setDebugErrorFunction(PopplerDebugFunc debugFunction, const QVariant &closure)
Set a new debug/error output function.
The version specification of a pdf file.
Definition poppler-qt6.h:1551