Poppler Qt6 24.12.0
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, 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 *
35 * This program is free software; you can redistribute it and/or modify
36 * it under the terms of the GNU General Public License as published by
37 * the Free Software Foundation; either version 2, or (at your option)
38 * any later version.
39 *
40 * This program is distributed in the hope that it will be useful,
41 * but WITHOUT ANY WARRANTY; without even the implied warranty of
42 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
43 * GNU General Public License for more details.
44 *
45 * You should have received a copy of the GNU General Public License
46 * along with this program; if not, write to the Free Software
47 * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
48 */
49
50#ifndef __POPPLER_QT_H__
51#define __POPPLER_QT_H__
52
53#include <functional>
54#include <memory>
55#include <vector>
56
57#include "poppler-annotation.h"
58#include "poppler-link.h"
59#include "poppler-optcontent.h"
60#include "poppler-page-transition.h"
61#include "poppler-converter.h"
62
63#include <QtCore/QByteArray>
64#include <QtCore/QDateTime>
65#include <QtCore/QIODevice>
66#include <QtCore/QSet>
67#include "poppler-export.h"
68
69class EmbFile;
70class Sound;
71class AnnotMovie;
72
76namespace Poppler {
77
78class Document;
79class DocumentData;
80
81class PageData;
82
83class FormField;
84class FormFieldSignature;
85
86class TextBoxData;
87
88class PDFConverter;
89class PSConverter;
90
91struct OutlineItemData;
92
100using PopplerDebugFunc = void (*)(const QString & /*message*/, const QVariant & /*closure*/);
101
111POPPLER_QT6_EXPORT void setDebugErrorFunction(PopplerDebugFunc debugFunction, const QVariant &closure);
112
122class POPPLER_QT6_EXPORT TextBox
123{
124 friend class Page;
125
126public:
132 TextBox(const QString &text, const QRectF &bBox);
137
141 QString text() const;
142
147 QRectF boundingBox() const;
148
155
159 QRectF charBoundingBox(int i) const;
160
164 bool hasSpaceAfter() const;
165
166private:
167 Q_DISABLE_COPY(TextBox)
168
169 TextBoxData *m_data;
170};
171
172class FontInfoData;
177class POPPLER_QT6_EXPORT FontInfo
178{
179 friend class Document;
180
181public:
185 enum Type
186 {
187 unknown,
188 Type1,
189 Type1C,
190 Type1COT,
191 Type3,
192 TrueType,
193 TrueTypeOT,
194 CIDType0,
195 CIDType0C,
196 CIDType0COT,
197 CIDTrueType,
198 CIDTrueTypeOT
199 };
200
202
205 FontInfo();
206
210 explicit FontInfo(const FontInfoData &fid);
212
216 FontInfo(const FontInfo &fi);
217
222
226 QString name() const;
227
231 QString substituteName() const;
232
237 QString file() const;
238
244 bool isEmbedded() const;
245
252 bool isSubset() const;
253
261 Type type() const;
262
271 QString typeName() const;
272
277
278private:
279 FontInfoData *m_data;
280};
281
282class FontIteratorData;
299class POPPLER_QT6_EXPORT FontIterator
300{
301 friend class Document;
302 friend class DocumentData;
303
304public:
309
314 QList<FontInfo> next();
315
320 bool hasNext() const;
321
325 int currentPage() const;
326
327private:
328 Q_DISABLE_COPY(FontIterator)
329 FontIterator(int, DocumentData *dd);
330
331 FontIteratorData *d;
332};
333
334class EmbeddedFileData;
338class POPPLER_QT6_EXPORT EmbeddedFile
339{
340 friend class DocumentData;
341 friend class AnnotationPrivate;
342
343public:
345 explicit EmbeddedFile(EmbFile *embfile);
347
352
356 QString name() const;
357
363 QString description() const;
364
370 int size() const;
371
375 QDateTime modDate() const;
376
380 QDateTime createDate() const;
381
387 QByteArray checksum() const;
388
392 QString mimeType() const;
393
397 QByteArray data();
398
402 bool isValid() const;
403
407 // QDataStream dataStream() const;
408
409private:
410 Q_DISABLE_COPY(EmbeddedFile)
411 explicit EmbeddedFile(EmbeddedFileData &dd);
412
413 EmbeddedFileData *m_embeddedFile;
414};
415
424class POPPLER_QT6_EXPORT Page
425{
426 friend class Document;
427
428public:
433
438 {
439 Rotate0 = 0,
440 Rotate90 = 1,
441 Rotate180 = 2,
442 Rotate270 = 3
443 };
444
449 {
451 Closing
452 };
453
458 {
460 RawOrderLayout
461 };
462
467 {
468 NoPainterFlags = 0x00000000,
476 DontSaveAndRestore = 0x00000001
477 };
478 Q_DECLARE_FLAGS(PainterFlags, PainterFlag)
479
480
516 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;
517
525 using RenderToImagePartialUpdateFunc = void (*)(const QImage & /*image*/, const QVariant & /*closure*/);
526
533 using ShouldRenderToImagePartialQueryFunc = bool (*)(const QVariant & /*closure*/);
534
582 QImage renderToImage(double xres, double yres, int x, int y, int w, int h, Rotation rotate, RenderToImagePartialUpdateFunc partialUpdateCallback, ShouldRenderToImagePartialQueryFunc shouldDoPartialUpdateCallback,
583 const QVariant &payload) const;
584
590 using ShouldAbortQueryFunc = bool (*)(const QVariant & /*closure*/);
591
643 QImage renderToImage(double xres, double yres, int x, int y, int w, int h, Rotation rotate, RenderToImagePartialUpdateFunc partialUpdateCallback, ShouldRenderToImagePartialQueryFunc shouldDoPartialUpdateCallback,
644 ShouldAbortQueryFunc shouldAbortRenderCallback, const QVariant &payload) const;
645
686 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;
687
694 QImage thumbnail() const;
695
703 QString text(const QRectF &rect, TextLayout textLayout) const;
704
713 QString text(const QRectF &rect) const;
714
719 {
722 PreviousResult
723 };
724
729 {
731 CaseInsensitive
732 };
733
738 {
739 NoSearchFlags = 0x00000000,
740 IgnoreCase = 0x00000001,
741 WholeWords = 0x00000002,
742 IgnoreDiacritics = 0x00000004,
745 AcrossLines = 0x00000008
748 };
749 Q_DECLARE_FLAGS(SearchFlags, SearchFlag)
750
751
761 bool search(const QString &text, double &sLeft, double &sTop, double &sRight, double &sBottom, SearchDirection direction, SearchFlags flags = NoSearchFlags, Rotation rotate = Rotate0) const;
762
775 QList<QRectF> search(const QString &text, SearchFlags flags = NoSearchFlags, Rotation rotate = Rotate0) const;
776
790 std::vector<std::unique_ptr<TextBox>> textList(Rotation rotate = Rotate0) const;
791
811 std::vector<std::unique_ptr<TextBox>> textList(Rotation rotate, ShouldAbortQueryFunc shouldAbortExtractionCallback, const QVariant &closure) const;
812
816 QSizeF pageSizeF() const;
817
821 QSize pageSize() const;
822
833 PageTransition *transition() const;
834
838 std::unique_ptr<Link> action(PageAction act) const;
839
850
855
859 void defaultCTM(double *CTM, double dpiX, double dpiY, int rotate, bool upsideDown);
860
864 std::vector<std::unique_ptr<Link>> links() const;
865
872 std::vector<std::unique_ptr<Annotation>> annotations() const;
873
882 std::vector<std::unique_ptr<Annotation>> annotations(const QSet<Annotation::SubType> &subtypes) const;
883
890 void addAnnotation(const Annotation *ann);
891
897 void removeAnnotation(const Annotation *ann);
898
902 std::vector<std::unique_ptr<FormField>> formFields() const;
903
909 double duration() const;
910
914 QString label() const;
915
919 int index() const;
920
921private:
922 Q_DISABLE_COPY(Page)
923
924 Page(DocumentData *doc, int index);
925 PageData *m_page;
926};
927
933class POPPLER_QT6_EXPORT OutlineItem
934{
935 friend class Document;
936
937public:
942 ~OutlineItem();
943
944 OutlineItem(const OutlineItem &other);
945 OutlineItem &operator=(const OutlineItem &other);
946
947 OutlineItem(OutlineItem &&other) noexcept;
948 OutlineItem &operator=(OutlineItem &&other) noexcept;
949
953 bool isNull() const;
954
958 QString name() const;
959
963 bool isOpen() const;
964
970 QSharedPointer<const LinkDestination> destination() const;
971
977 QString externalFileName() const;
978
984 QString uri() const;
985
991 bool hasChildren() const;
992
998 QVector<OutlineItem> children() const;
999
1000private:
1001 explicit OutlineItem(OutlineItemData *data);
1002 OutlineItemData *m_data;
1003};
1004
1055class POPPLER_QT6_EXPORT Document
1056{
1057 friend class Page;
1058 friend class DocumentData;
1059
1060public:
1073
1087
1092 {
1094 QPainterBackend
1096
1101 {
1102 Antialiasing = 0x00000001,
1103 TextAntialiasing = 0x00000002,
1104 TextHinting = 0x00000004,
1105 TextSlightHinting = 0x00000008,
1106 OverprintPreview = 0x00000010,
1107 ThinLineSolid = 0x00000020,
1108 ThinLineShape = 0x00000040,
1109 IgnorePaperColor = 0x00000080,
1110 HideAnnotations = 0x00000100
1112 Q_DECLARE_FLAGS(RenderHints, RenderHint)
1113
1114
1118 {
1121 XfaForm
1123
1134 void setColorDisplayProfile(void *outputProfileA);
1142 void setColorDisplayProfileName(const QString &name);
1151 void *colorRgbProfile() const;
1160 void *colorDisplayProfile() const;
1161
1176 static std::unique_ptr<Document> load(const QString &filePath, const QByteArray &ownerPassword = QByteArray(), const QByteArray &userPassword = QByteArray());
1177
1195 static std::unique_ptr<Document> load(QIODevice *device, const QByteArray &ownerPassword = QByteArray(), const QByteArray &userPassword = QByteArray());
1196
1213 static std::unique_ptr<Document> loadFromData(const QByteArray &fileContents, const QByteArray &ownerPassword = QByteArray(), const QByteArray &userPassword = QByteArray());
1214
1230 std::unique_ptr<Page> page(int index) const;
1231
1244 std::unique_ptr<Page> page(const QString &label) const;
1245
1249 int numPages() const;
1250
1257
1264
1269 Qt::LayoutDirection textDirection() const;
1270
1279 bool unlock(const QByteArray &ownerPassword, const QByteArray &userPassword);
1280
1284 bool isLocked() const;
1285
1301 QDateTime date(const QString &type) const;
1302
1308 bool setDate(const QString &key, const QDateTime &val);
1309
1313 QDateTime creationDate() const;
1314
1320 bool setCreationDate(const QDateTime &val);
1321
1325 QDateTime modificationDate() const;
1326
1332 bool setModificationDate(const QDateTime &val);
1333
1350 QString info(const QString &type) const;
1351
1357 bool setInfo(const QString &key, const QString &val);
1358
1362 QString title() const;
1363
1369 bool setTitle(const QString &val);
1370
1374 QString author() const;
1375
1381 bool setAuthor(const QString &val);
1382
1386 QString subject() const;
1387
1393 bool setSubject(const QString &val);
1394
1398 QString keywords() const;
1399
1405 bool setKeywords(const QString &val);
1406
1410 QString creator() const;
1411
1417 bool setCreator(const QString &val);
1418
1422 QString producer() const;
1423
1429 bool setProducer(const QString &val);
1430
1437
1441 QStringList infoKeys() const;
1442
1446 bool isEncrypted() const;
1447
1454 bool isLinearized() const;
1455
1460 bool okToPrint() const;
1461
1466 bool okToPrintHighRes() const;
1467
1475 bool okToChange() const;
1476
1481 bool okToCopy() const;
1482
1488 bool okToAddNotes() const;
1489
1497 bool okToFillForm() const;
1498
1505
1512
1520 bool okToAssemble() const;
1521
1524 {
1525 int major;
1526 int minor;
1527 };
1528
1536
1548 QList<FontInfo> fonts() const;
1549
1560 std::unique_ptr<FontIterator> newFontIterator(int startPage = 0) const;
1561
1565 QByteArray fontData(const FontInfo &fi) const;
1566
1575 QList<EmbeddedFile *> embeddedFiles() const;
1576
1580 bool hasEmbeddedFiles() const;
1581
1587 QVector<OutlineItem> outline() const;
1588
1597 std::unique_ptr<LinkDestination> linkDestination(const QString &name);
1598
1604 void setPaperColor(const QColor &color);
1610 QColor paperColor() const;
1611
1624
1628 static QSet<RenderBackend> availableRenderBackends();
1629
1637 void setRenderHint(RenderHint hint, bool on = true);
1641 RenderHints renderHints() const;
1642
1646 std::unique_ptr<PSConverter> psConverter() const;
1647
1651 std::unique_ptr<PDFConverter> pdfConverter() const;
1652
1656 QString metadata() const;
1657
1669
1676
1683
1690 QStringList scripts() const;
1691
1708
1715 std::unique_ptr<Link> additionalAction(DocumentAdditionalActionsType type) const;
1716
1727 bool getPdfId(QByteArray *permanentId, QByteArray *updateId) const;
1728
1733
1737 QVector<int> formCalculateOrder() const;
1738
1745 std::vector<std::unique_ptr<FormFieldSignature>> signatures() const;
1746
1753
1760 void setXRefReconstructedCallback(const std::function<void()> &callback);
1761
1766
1767private:
1768 Q_DISABLE_COPY(Document)
1769
1770 DocumentData *m_doc;
1771
1772 explicit Document(DocumentData *dataA);
1773};
1774
1778POPPLER_QT6_EXPORT QDateTime convertDate(const char *dateString);
1779
1783POPPLER_QT6_EXPORT bool isCmsAvailable();
1784
1788POPPLER_QT6_EXPORT bool isOverprintPreviewAvailable();
1789
1790class SoundData;
1798class POPPLER_QT6_EXPORT SoundObject
1799{
1800public:
1805 {
1807 Embedded
1809
1820
1824 explicit SoundObject(Sound *popplersound);
1826
1827 ~SoundObject();
1828
1833
1837 QString url() const;
1838
1842 QByteArray data() const;
1843
1847 double samplingRate() const;
1848
1852 int channels() const;
1853
1857 int bitsPerSample() const;
1858
1863
1864private:
1865 Q_DISABLE_COPY(SoundObject)
1866
1867 SoundData *m_soundData;
1868};
1869
1870class MovieData;
1874class POPPLER_QT6_EXPORT MovieObject
1875{
1876 friend class AnnotationPrivate;
1877
1878public:
1883 {
1887 PlayPalindrome
1889
1890 ~MovieObject();
1891
1895 QString url() const;
1896
1900 QSize size() const;
1901
1905 int rotation() const;
1906
1910 bool showControls() const;
1911
1916
1920 bool showPosterImage() const;
1921
1927 QImage posterImage() const;
1928
1929private:
1931 explicit MovieObject(AnnotMovie *ann);
1933
1934 Q_DISABLE_COPY(MovieObject)
1935
1936 MovieData *m_movieData;
1937};
1938
1939}
1940
1941Q_DECLARE_OPERATORS_FOR_FLAGS(Poppler::Page::PainterFlags)
1942Q_DECLARE_OPERATORS_FOR_FLAGS(Poppler::Page::SearchFlags)
1943Q_DECLARE_OPERATORS_FOR_FLAGS(Poppler::Document::RenderHints)
1944
1945#endif
Annotation class holding properties shared by all annotations.
Definition poppler-annotation.h:177
PDF document.
Definition poppler-qt6.h:1056
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:1078
@ TwoPageLeft
Display the pages two at a time, with odd-numbered pages on the left.
Definition poppler-qt6.h:1084
@ TwoColumnLeft
Display the pages in two columns, with odd-numbered pages on the left.
Definition poppler-qt6.h:1082
@ SinglePage
Display a single page.
Definition poppler-qt6.h:1080
@ NoLayout
Layout not specified.
Definition poppler-qt6.h:1079
@ TwoColumnRight
Display the pages in two columns, with odd-numbered pages on the right.
Definition poppler-qt6.h:1083
@ OneColumn
Display a single column of pages.
Definition poppler-qt6.h:1081
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
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:1092
@ SplashBackend
Splash backend.
Definition poppler-qt6.h:1093
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:1065
@ UseOutlines
Document outline visible.
Definition poppler-qt6.h:1067
@ UseNone
No mode - neither document outline nor thumbnail images are visible.
Definition poppler-qt6.h:1066
@ UseThumbs
Thumbnail images visible.
Definition poppler-qt6.h:1068
@ FullScreen
Fullscreen mode (no menubar, windows controls etc)
Definition poppler-qt6.h:1069
@ UseOC
Optional content group panel visible.
Definition poppler-qt6.h:1070
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:1101
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:1701
@ CloseDocument
Performed before closing the document.
Definition poppler-qt6.h:1702
@ PrintDocumentStart
Performed before printing the document.
Definition poppler-qt6.h:1705
@ PrintDocumentFinish
Performed after printing the document.
Definition poppler-qt6.h:1706
@ SaveDocumentFinish
Performed after saving the document.
Definition poppler-qt6.h:1704
@ SaveDocumentStart
Performed before saving the document.
Definition poppler-qt6.h:1703
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:1118
@ AcroForm
AcroForm.
Definition poppler-qt6.h:1120
@ NoForm
Document doesn't contain forms.
Definition poppler-qt6.h:1119
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
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...
Container class for an embedded file with a PDF document.
Definition poppler-qt6.h:339
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:178
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:186
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.
Iterator for reading the fonts in a document.
Definition poppler-qt6.h:300
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.
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:1875
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:1883
@ PlayRepeat
Play continuously until stopped.
Definition poppler-qt6.h:1886
@ PlayOnce
Play the movie once, closing the movie controls at the end.
Definition poppler-qt6.h:1884
@ PlayOpen
Like PlayOnce, but leaving the controls open.
Definition poppler-qt6.h:1885
PlayMode playMode() const
How to play the movie.
Model for optional content.
Definition poppler-optcontent.h:47
Item in the outline of a PDF document.
Definition poppler-qt6.h:934
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
A page in a document.
Definition poppler-qt6.h:425
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:533
Orientation
Types of orientations that are possible.
Definition poppler-qt6.h:844
@ Seascape
Seascape orientation (portrait, with 270 degrees clockwise rotation)
Definition poppler-qt6.h:847
@ Landscape
Landscape orientation (portrait, with 90 degrees clockwise rotation )
Definition poppler-qt6.h:845
@ Portrait
Normal portrait orientation.
Definition poppler-qt6.h:846
SearchFlag
Flags to modify the search behaviour.
Definition poppler-qt6.h:738
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.
std::vector< std::unique_ptr< Link > > links() const
Gets the links of the page.
int index() const
Returns the index of the page.
SearchDirection
The starting point for a search.
Definition poppler-qt6.h:719
@ FromTop
Start sorting at the top of the document.
Definition poppler-qt6.h:720
@ NextResult
Find the next result, moving "down the page".
Definition poppler-qt6.h:721
PainterFlag
Additional flags for the renderToPainter method.
Definition poppler-qt6.h:467
Rotation
The type of rotation to apply for an operation.
Definition poppler-qt6.h:438
~Page()
Destructor.
Orientation orientation() const
The orientation of the page.
SearchMode
The type of search to perform.
Definition poppler-qt6.h:729
@ CaseSensitive
Case differences cause no match in searching.
Definition poppler-qt6.h:730
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:458
@ PhysicalLayout
The text is layouted to resemble the real page layout.
Definition poppler-qt6.h:459
PageAction
The kinds of page actions.
Definition poppler-qt6.h:449
@ Opening
The action when a page is "opened".
Definition poppler-qt6.h:450
double duration() const
Returns the page duration.
void(*)(const QImage &, const QVariant &) RenderToImagePartialUpdateFunc
Partial Update renderToImage callback.
Definition poppler-qt6.h:525
QString label() const
Returns the label of the page, or a null string is the page has no label.
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:590
Container class for a sound file in a PDF document.
Definition poppler-qt6.h:1799
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:1814
@ muLaw
mu-law-encoded samples
Definition poppler-qt6.h:1817
@ Signed
Twos-complement values.
Definition poppler-qt6.h:1816
@ Raw
Raw encoding, with unspecified or unsigned values in the range [ 0, 2^B - 1 ].
Definition poppler-qt6.h:1815
SoundType
The type of sound.
Definition poppler-qt6.h:1805
@ External
The real sound file is external.
Definition poppler-qt6.h:1806
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:123
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.
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:51
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:100
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:1524