Poppler Qt5  20.10.0
poppler-qt5.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-2020, 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 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 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  *
26  * This program is free software; you can redistribute it and/or modify
27  * it under the terms of the GNU General Public License as published by
28  * the Free Software Foundation; either version 2, or (at your option)
29  * any later version.
30  *
31  * This program is distributed in the hope that it will be useful,
32  * but WITHOUT ANY WARRANTY; without even the implied warranty of
33  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34  * GNU General Public License for more details.
35  *
36  * You should have received a copy of the GNU General Public License
37  * along with this program; if not, write to the Free Software
38  * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
39  */
40 
41 #ifndef __POPPLER_QT_H__
42 #define __POPPLER_QT_H__
43 
44 #include "poppler-annotation.h"
45 #include "poppler-link.h"
46 #include "poppler-optcontent.h"
47 #include "poppler-page-transition.h"
48 
49 #include <QtCore/QByteArray>
50 #include <QtCore/QDateTime>
51 #include <QtCore/QSet>
52 #include <QtXml/QDomDocument>
53 #include "poppler-export.h"
54 
55 class EmbFile;
56 class Sound;
57 class AnnotMovie;
58 
62 namespace Poppler {
63 
64 class Document;
65 class DocumentData;
66 
67 class PageData;
68 
69 class FormField;
70 class FormFieldSignature;
71 
72 class TextBoxData;
73 
74 class PDFConverter;
75 class PSConverter;
76 
77 struct OutlineItemData;
78 
88 typedef void (*PopplerDebugFunc)(const QString & /*message*/, const QVariant & /*closure*/);
89 
101 POPPLER_QT5_EXPORT void setDebugErrorFunction(PopplerDebugFunc debugFunction, const QVariant &closure);
102 
112 class POPPLER_QT5_EXPORT TextBox
113 {
114  friend class Page;
115 
116 public:
122  TextBox(const QString &text, const QRectF &bBox);
127 
131  QString text() const;
132 
139  QRectF boundingBox() const;
140 
146  TextBox *nextWord() const;
147 
151  QRectF charBoundingBox(int i) const;
152 
156  bool hasSpaceAfter() const;
157 
158 private:
159  Q_DISABLE_COPY(TextBox)
160 
161  TextBoxData *m_data;
162 };
163 
164 class FontInfoData;
169 class POPPLER_QT5_EXPORT FontInfo
170 {
171  friend class Document;
172 
173 public:
177  enum Type
178  {
179  unknown,
180  Type1,
181  Type1C,
182  Type1COT,
183  Type3,
184  TrueType,
185  TrueTypeOT,
186  CIDType0,
187  CIDType0C,
188  CIDType0COT,
189  CIDTrueType,
190  CIDTrueTypeOT
191  };
192 
194 
197  FontInfo();
198 
202  FontInfo(const FontInfoData &fid);
204 
208  FontInfo(const FontInfo &fi);
209 
214 
218  QString name() const;
219 
224  QString substituteName() const;
225 
230  QString file() const;
231 
237  bool isEmbedded() const;
238 
245  bool isSubset() const;
246 
254  Type type() const;
255 
264  QString typeName() const;
265 
270 
271 private:
272  FontInfoData *m_data;
273 };
274 
275 class FontIteratorData;
295 class POPPLER_QT5_EXPORT FontIterator
296 {
297  friend class Document;
298  friend class DocumentData;
299 
300 public:
305 
310  QList<FontInfo> next();
311 
316  bool hasNext() const;
317 
321  int currentPage() const;
322 
323 private:
324  Q_DISABLE_COPY(FontIterator)
325  FontIterator(int, DocumentData *dd);
326 
327  FontIteratorData *d;
328 };
329 
330 class EmbeddedFileData;
334 class POPPLER_QT5_EXPORT EmbeddedFile
335 {
336  friend class DocumentData;
337  friend class AnnotationPrivate;
338 
339 public:
341  EmbeddedFile(EmbFile *embfile);
343 
348 
352  QString name() const;
353 
359  QString description() const;
360 
366  int size() const;
367 
371  QDateTime modDate() const;
372 
376  QDateTime createDate() const;
377 
383  QByteArray checksum() const;
384 
390  QString mimeType() const;
391 
395  QByteArray data();
396 
402  bool isValid() const;
403 
407  // QDataStream dataStream() const;
408 
409 private:
410  Q_DISABLE_COPY(EmbeddedFile)
411  EmbeddedFile(EmbeddedFileData &dd);
412 
413  EmbeddedFileData *m_embeddedFile;
414 };
415 
424 class POPPLER_QT5_EXPORT Page
425 {
426  friend class Document;
427 
428 public:
432  ~Page();
433 
437  enum Rotation
438  {
439  Rotate0 = 0,
440  Rotate90 = 1,
441  Rotate180 = 2,
442  Rotate270 = 3
443  };
444 
449  {
451  Closing
452  };
453 
459  {
461  RawOrderLayout
462  };
463 
469  {
470  NoPainterFlags = 0x00000000,
471 
478  DontSaveAndRestore = 0x00000001
479  };
480  Q_DECLARE_FLAGS(PainterFlags, PainterFlag)
481 
482 
520  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;
521 
531  typedef void (*RenderToImagePartialUpdateFunc)(const QImage & /*image*/, const QVariant & /*closure*/);
532 
541  typedef bool (*ShouldRenderToImagePartialQueryFunc)(const QVariant & /*closure*/);
542 
592  QImage renderToImage(double xres, double yres, int x, int y, int w, int h, Rotation rotate, RenderToImagePartialUpdateFunc partialUpdateCallback, ShouldRenderToImagePartialQueryFunc shouldDoPartialUpdateCallback,
593  const QVariant &payload) const;
594 
602  typedef bool (*ShouldAbortQueryFunc)(const QVariant & /*closure*/);
603 
657  QImage renderToImage(double xres, double yres, int x, int y, int w, int h, Rotation rotate, RenderToImagePartialUpdateFunc partialUpdateCallback, ShouldRenderToImagePartialQueryFunc shouldDoPartialUpdateCallback,
658  ShouldAbortQueryFunc shouldAbortRenderCallback, const QVariant &payload) const;
659 
702  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;
703 
712  QImage thumbnail() const;
713 
723  QString text(const QRectF &rect, TextLayout textLayout) const;
724 
733  QString text(const QRectF &rect) const;
734 
739  {
742  PreviousResult
743  };
744 
749  {
751  CaseInsensitive
752  };
753 
758  {
759  NoSearchFlags = 0x00000000,
760  IgnoreCase = 0x00000001,
761  WholeWords = 0x00000002,
762  IgnoreDiacritics = 0x00000004
763  };
766  Q_DECLARE_FLAGS(SearchFlags, SearchFlag)
767 
768 
779  Q_DECL_DEPRECATED bool search(const QString &text, double &rectLeft, double &rectTop, double &rectRight, double &rectBottom, SearchDirection direction, SearchMode caseSensitive, Rotation rotate = Rotate0) const;
780 
793  bool search(const QString &text, double &sLeft, double &sTop, double &sRight, double &sBottom, SearchDirection direction, SearchFlags flags = NoSearchFlags, Rotation rotate = Rotate0) const;
794 
806  Q_DECL_DEPRECATED QList<QRectF> search(const QString &text, SearchMode caseSensitive, Rotation rotate = Rotate0) const;
807 
819  QList<QRectF> search(const QString &text, SearchFlags flags = NoSearchFlags, Rotation rotate = Rotate0) const;
820 
837  QList<TextBox *> textList(Rotation rotate = Rotate0) const;
838 
863  QList<TextBox *> textList(Rotation rotate, ShouldAbortQueryFunc shouldAbortExtractionCallback, const QVariant &closure) const;
864 
868  QSizeF pageSizeF() const;
869 
873  QSize pageSize() const;
874 
885  PageTransition *transition() const;
886 
892  Link *action(PageAction act) const;
893 
898  {
902  UpsideDown
903  };
904 
909 
913  void defaultCTM(double *CTM, double dpiX, double dpiY, int rotate, bool upsideDown);
914 
918  QList<Link *> links() const;
919 
928  QList<Annotation *> annotations() const;
929 
942  QList<Annotation *> annotations(const QSet<Annotation::SubType> &subtypes) const;
943 
951  void addAnnotation(const Annotation *ann);
952 
959  void removeAnnotation(const Annotation *ann);
960 
967  QList<FormField *> formFields() const;
968 
976  double duration() const;
977 
983  QString label() const;
984 
990  int index() const;
991 
992 private:
993  Q_DISABLE_COPY(Page)
994 
995  Page(DocumentData *doc, int index);
996  PageData *m_page;
997 };
998 
1006 class POPPLER_QT5_EXPORT OutlineItem
1007 {
1008  friend class Document;
1009 
1010 public:
1015  ~OutlineItem();
1016 
1017  OutlineItem(const OutlineItem &other);
1018  OutlineItem &operator=(const OutlineItem &other);
1019 
1020  OutlineItem(OutlineItem &&other) noexcept;
1021  OutlineItem &operator=(OutlineItem &&other) noexcept;
1022 
1026  bool isNull() const;
1027 
1031  QString name() const;
1032 
1036  bool isOpen() const;
1037 
1043  QSharedPointer<const LinkDestination> destination() const;
1044 
1050  QString externalFileName() const;
1051 
1057  QString uri() const;
1058 
1064  bool hasChildren() const;
1065 
1071  QVector<OutlineItem> children() const;
1072 
1073 private:
1074  OutlineItem(OutlineItemData *data);
1075  OutlineItemData *m_data;
1076 };
1077 
1128 class POPPLER_QT5_EXPORT Document
1129 {
1130  friend class Page;
1131  friend class DocumentData;
1132 
1133 public:
1138  {
1144  UseAttach
1145  };
1146 
1151  {
1158  TwoPageRight
1159  };
1160 
1167  {
1170  QPainterBackend = ArthurBackend
1171  };
1172 
1179  {
1180  Antialiasing = 0x00000001,
1181  TextAntialiasing = 0x00000002,
1182  TextHinting = 0x00000004,
1183  TextSlightHinting = 0x00000008,
1184  OverprintPreview = 0x00000010,
1185  ThinLineSolid = 0x00000020,
1186  ThinLineShape = 0x00000040,
1187  IgnorePaperColor = 0x00000080,
1188  HideAnnotations = 0x00000100
1189  };
1190  Q_DECLARE_FLAGS(RenderHints, RenderHint)
1191 
1192 
1198  {
1201  XfaForm
1202  };
1203 
1216  void setColorDisplayProfile(void *outputProfileA);
1226  void setColorDisplayProfileName(const QString &name);
1237  void *colorRgbProfile() const;
1248  void *colorDisplayProfile() const;
1249 
1267  static Document *load(const QString &filePath, const QByteArray &ownerPassword = QByteArray(), const QByteArray &userPassword = QByteArray());
1268 
1293  static Document *load(QIODevice *device, const QByteArray &ownerPassword = QByteArray(), const QByteArray &userPassword = QByteArray());
1294 
1316  static Document *loadFromData(const QByteArray &fileContents, const QByteArray &ownerPassword = QByteArray(), const QByteArray &userPassword = QByteArray());
1317 
1330  Page *page(int index) const;
1331 
1344  Page *page(const QString &label) const;
1345 
1349  int numPages() const;
1350 
1357 
1364 
1371  Qt::LayoutDirection textDirection() const;
1372 
1381  bool unlock(const QByteArray &ownerPassword, const QByteArray &userPassword);
1382 
1386  bool isLocked() const;
1387 
1403  QDateTime date(const QString &type) const;
1404 
1410  bool setDate(const QString &key, const QDateTime &val);
1411 
1415  QDateTime creationDate() const;
1416 
1422  bool setCreationDate(const QDateTime &val);
1423 
1427  QDateTime modificationDate() const;
1428 
1434  bool setModificationDate(const QDateTime &val);
1435 
1452  QString info(const QString &type) const;
1453 
1459  bool setInfo(const QString &key, const QString &val);
1460 
1464  QString title() const;
1465 
1471  bool setTitle(const QString &val);
1472 
1476  QString author() const;
1477 
1483  bool setAuthor(const QString &val);
1484 
1488  QString subject() const;
1489 
1495  bool setSubject(const QString &val);
1496 
1500  QString keywords() const;
1501 
1507  bool setKeywords(const QString &val);
1508 
1512  QString creator() const;
1513 
1519  bool setCreator(const QString &val);
1520 
1524  QString producer() const;
1525 
1531  bool setProducer(const QString &val);
1532 
1538  bool removeInfo();
1539 
1543  QStringList infoKeys() const;
1544 
1548  bool isEncrypted() const;
1549 
1556  bool isLinearized() const;
1557 
1562  bool okToPrint() const;
1563 
1568  bool okToPrintHighRes() const;
1569 
1577  bool okToChange() const;
1578 
1583  bool okToCopy() const;
1584 
1590  bool okToAddNotes() const;
1591 
1599  bool okToFillForm() const;
1600 
1606  bool okToCreateFormFields() const;
1607 
1614 
1622  bool okToAssemble() const;
1623 
1635  void getPdfVersion(int *major, int *minor) const;
1636 
1648  QList<FontInfo> fonts() const;
1649 
1665  FontIterator *newFontIterator(int startPage = 0) const;
1666 
1672  QByteArray fontData(const FontInfo &fi) const;
1673 
1680  QList<EmbeddedFile *> embeddedFiles() const;
1681 
1685  bool hasEmbeddedFiles() const;
1686 
1710  Q_DECL_DEPRECATED QDomDocument *toc() const;
1711 
1719  QVector<OutlineItem> outline() const;
1720 
1729  LinkDestination *linkDestination(const QString &name);
1730 
1736  void setPaperColor(const QColor &color);
1742  QColor paperColor() const;
1743 
1760 
1766  static QSet<RenderBackend> availableRenderBackends();
1767 
1777  void setRenderHint(RenderHint hint, bool on = true);
1783  RenderHints renderHints() const;
1784 
1793 
1802 
1808  QString metadata() const;
1809 
1822  bool hasOptionalContent() const;
1823 
1832 
1841  QStringList scripts() const;
1842 
1855  bool getPdfId(QByteArray *permanentId, QByteArray *updateId) const;
1856 
1863 
1869  QVector<int> formCalculateOrder() const;
1870 
1879  QVector<FormFieldSignature *> signatures() const;
1880 
1885 
1886 private:
1887  Q_DISABLE_COPY(Document)
1888 
1889  DocumentData *m_doc;
1890 
1891  Document(DocumentData *dataA);
1892 };
1893 
1894 class BaseConverterPrivate;
1895 class PSConverterPrivate;
1896 class PDFConverterPrivate;
1904 class POPPLER_QT5_EXPORT BaseConverter
1905 {
1906  friend class Document;
1907 
1908 public:
1912  virtual ~BaseConverter();
1913 
1915  void setOutputFileName(const QString &outputFileName);
1916 
1922  void setOutputDevice(QIODevice *device);
1923 
1929  virtual bool convert() = 0;
1930 
1931  enum Error
1932  {
1933  NoError,
1934  FileLockedError,
1935  OpenOutputError,
1936  NotSupportedInputFileError
1937  };
1938 
1943  Error lastError() const;
1944 
1945 protected:
1947  BaseConverter(BaseConverterPrivate &dd);
1948  Q_DECLARE_PRIVATE(BaseConverter)
1949  BaseConverterPrivate *d_ptr;
1951 
1952 private:
1953  Q_DISABLE_COPY(BaseConverter)
1954 };
1955 
1972 class POPPLER_QT5_EXPORT PSConverter : public BaseConverter
1973 {
1974  friend class Document;
1975 
1976 public:
1983  {
1984  Printing = 0x00000001,
1985  StrictMargins = 0x00000002,
1986  ForceRasterization = 0x00000004,
1987  PrintToEPS = 0x00000008,
1988  HideAnnotations = 0x00000010
1989  };
1990  Q_DECLARE_FLAGS(PSOptions, PSOption)
1991 
1992 
1995  ~PSConverter() override;
1996 
1998  void setPageList(const QList<int> &pageList);
1999 
2003  void setTitle(const QString &title);
2004 
2008  void setHDPI(double hDPI);
2009 
2013  void setVDPI(double vDPI);
2014 
2018  void setRotate(int rotate);
2019 
2023  void setPaperWidth(int paperWidth);
2024 
2028  void setPaperHeight(int paperHeight);
2029 
2033  void setRightMargin(int marginRight);
2034 
2038  void setBottomMargin(int marginBottom);
2039 
2043  void setLeftMargin(int marginLeft);
2044 
2048  void setTopMargin(int marginTop);
2049 
2057  void setStrictMargins(bool strictMargins);
2058 
2060  void setForceRasterize(bool forceRasterize);
2061 
2067  void setPSOptions(PSOptions options);
2068 
2076  PSOptions psOptions() const;
2077 
2085  void setPageConvertedCallback(void (*callback)(int page, void *payload), void *payload);
2086 
2087  bool convert() override;
2088 
2089 private:
2090  Q_DECLARE_PRIVATE(PSConverter)
2091  Q_DISABLE_COPY(PSConverter)
2092 
2093  PSConverter(DocumentData *document);
2094 };
2095 
2101 class POPPLER_QT5_EXPORT PDFConverter : public BaseConverter
2102 {
2103  friend class Document;
2104 
2105 public:
2110  {
2111  WithChanges = 0x00000001
2112  };
2113  Q_DECLARE_FLAGS(PDFOptions, PDFOption)
2114 
2115 
2118  ~PDFConverter() override;
2119 
2123  void setPDFOptions(PDFOptions options);
2127  PDFOptions pdfOptions() const;
2128 
2129  bool convert() override;
2130 
2131 private:
2132  Q_DECLARE_PRIVATE(PDFConverter)
2133  Q_DISABLE_COPY(PDFConverter)
2134 
2135  PDFConverter(DocumentData *document);
2136 };
2137 
2141 POPPLER_QT5_EXPORT Q_DECL_DEPRECATED QDateTime convertDate(char *dateString);
2142 
2148 POPPLER_QT5_EXPORT QDateTime convertDate(const char *dateString);
2149 
2155 POPPLER_QT5_EXPORT bool isCmsAvailable();
2156 
2162 POPPLER_QT5_EXPORT bool isOverprintPreviewAvailable();
2163 
2164 class SoundData;
2174 class POPPLER_QT5_EXPORT SoundObject
2175 {
2176 public:
2181  {
2183  Embedded
2184  };
2185 
2190  {
2194  ALaw
2195  };
2196 
2198  SoundObject(Sound *popplersound);
2200 
2201  ~SoundObject();
2202 
2207 
2211  QString url() const;
2212 
2216  QByteArray data() const;
2217 
2221  double samplingRate() const;
2222 
2226  int channels() const;
2227 
2231  int bitsPerSample() const;
2232 
2237 
2238 private:
2239  Q_DISABLE_COPY(SoundObject)
2240 
2241  SoundData *m_soundData;
2242 };
2243 
2244 class MovieData;
2250 class POPPLER_QT5_EXPORT MovieObject
2251 {
2252  friend class AnnotationPrivate;
2253 
2254 public:
2259  {
2263  PlayPalindrome
2264  };
2265 
2266  ~MovieObject();
2267 
2271  QString url() const;
2272 
2276  QSize size() const;
2277 
2281  int rotation() const;
2282 
2286  bool showControls() const;
2287 
2292 
2297  bool showPosterImage() const;
2298 
2305  QImage posterImage() const;
2306 
2307 private:
2309  MovieObject(AnnotMovie *ann);
2311 
2312  Q_DISABLE_COPY(MovieObject)
2313 
2314  MovieData *m_movieData;
2315 };
2316 
2317 }
2318 
2319 Q_DECLARE_OPERATORS_FOR_FLAGS(Poppler::Page::PainterFlags)
2320 Q_DECLARE_OPERATORS_FOR_FLAGS(Poppler::Page::SearchFlags)
2321 Q_DECLARE_OPERATORS_FOR_FLAGS(Poppler::Document::RenderHints)
2322 Q_DECLARE_OPERATORS_FOR_FLAGS(Poppler::PDFConverter::PDFOptions)
2323 Q_DECLARE_OPERATORS_FOR_FLAGS(Poppler::PSConverter::PSOptions)
2324 
2325 #endif
Poppler::FontInfo::substituteName
QString substituteName() const
The name of the substitute font.
Poppler::Document::pageMode
PageMode pageMode() const
The type of mode that should be used by the application when the document is opened.
Poppler::PSConverter::setRotate
void setRotate(int rotate)
Sets the rotate.
Poppler::BaseConverter::setOutputDevice
void setOutputDevice(QIODevice *device)
Sets the output device.
Poppler::OutlineItem::hasChildren
bool hasChildren() const
Determines if this item has any child items.
Poppler::MovieObject::url
QString url() const
The URL of the movie to be played.
Poppler::SoundObject::SoundEncoding
SoundEncoding
The encoding format used for the sound.
Definition: poppler-qt5.h:2190
Poppler::FontInfo::FontInfo
FontInfo(const FontInfo &fi)
Copy constructor.
Poppler::Document::title
QString title() const
The title of the document.
Poppler::Page::SearchDirection
SearchDirection
The starting point for a search.
Definition: poppler-qt5.h:739
Poppler::Document::okToAssemble
bool okToAssemble() const
Test if the permissions on the document allow it to be "assembled" - insertion, rotation and deletion...
Poppler::MovieObject::posterImage
QImage posterImage() const
Returns the poster image that should be shown if the movie is not playing.
Poppler::Page::CaseSensitive
@ CaseSensitive
Case differences cause no match in searching.
Definition: poppler-qt5.h:750
Poppler::Document::colorRgbProfile
void * colorRgbProfile() const
Return the current RGB profile.
Poppler::PSConverter::setForceRasterize
void setForceRasterize(bool forceRasterize)
Defines if the page will be rasterized to an image before printing.
Poppler::FontIterator::hasNext
bool hasNext() const
Checks whether there is at least one more page to iterate, ie returns false when the iterator is beyo...
Poppler::SoundObject::url
QString url() const
The URL of the sound file to be played, in case of SoundObject::External.
Poppler::Page::addAnnotation
void addAnnotation(const Annotation *ann)
Adds an annotation to the page.
Poppler::Document::setModificationDate
bool setModificationDate(const QDateTime &val)
Set the modification date of the document to.
Poppler::Document::info
QString info(const QString &type) const
Poppler::FontInfo::Type
Type
The type of font.
Definition: poppler-qt5.h:178
Poppler::PSConverter::setVDPI
void setVDPI(double vDPI)
Sets the vertical DPI.
Poppler::Document::hasOptionalContent
bool hasOptionalContent() const
Test whether this document has "optional content".
Poppler::TextBox::nextWord
TextBox * nextWord() const
Returns the pointer to the next text box, if there is one.
Poppler::SoundObject
Container class for a sound file in a PDF document.
Definition: poppler-qt5.h:2175
Poppler::Document::hasEmbeddedFiles
bool hasEmbeddedFiles() const
Whether there are any documents embedded in this PDF document.
Poppler::PopplerDebugFunc
void(* PopplerDebugFunc)(const QString &, const QVariant &)
Debug/error function.
Definition: poppler-qt5.h:88
Poppler::Document::formType
FormType formType() const
Returns the type of forms contained in the document.
Poppler::EmbeddedFile::name
QString name() const
The name associated with the file.
Poppler::MovieObject::showPosterImage
bool showPosterImage() const
Returns whether a poster image should be shown if the movie is not playing.
Poppler::PSConverter::setTopMargin
void setTopMargin(int marginTop)
Sets the output top margin.
Poppler::Document::UseNone
@ UseNone
No mode - neither document outline nor thumbnail images are visible.
Definition: poppler-qt5.h:1139
Poppler::Document::NoLayout
@ NoLayout
Layout not specified.
Definition: poppler-qt5.h:1152
Poppler::Document::infoKeys
QStringList infoKeys() const
Obtain a list of the available string information keys.
Poppler::isCmsAvailable
bool isCmsAvailable()
Whether the color management functions are available.
Poppler::FontInfo
Container class for information about a font within a PDF document.
Definition: poppler-qt5.h:170
Poppler::Document::OneColumn
@ OneColumn
Display a single column of pages.
Definition: poppler-qt5.h:1154
Poppler::Page::SearchMode
SearchMode
The type of search to perform.
Definition: poppler-qt5.h:749
Poppler::PSConverter::setPageList
void setPageList(const QList< int > &pageList)
Sets the list of pages to print.
Poppler::PSConverter::setPageConvertedCallback
void setPageConvertedCallback(void(*callback)(int page, void *payload), void *payload)
Sets a function that will be called each time a page is converted.
Poppler::Annotation
Annotation class holding properties shared by all annotations.
Definition: poppler-annotation.h:172
Poppler::Document::paperColor
QColor paperColor() const
The paper color.
Poppler::Document::load
static Document * load(QIODevice *device, const QByteArray &ownerPassword=QByteArray(), const QByteArray &userPassword=QByteArray())
Load the document from a device.
Poppler::MovieObject::playMode
PlayMode playMode() const
How to play the movie.
Poppler::EmbeddedFile::~EmbeddedFile
~EmbeddedFile()
Destructor.
Poppler::FontInfo::~FontInfo
~FontInfo()
Destructor.
Poppler::Page::PhysicalLayout
@ PhysicalLayout
The text is layouted to resemble the real page layout.
Definition: poppler-qt5.h:460
Poppler::EmbeddedFile::isValid
bool isValid() const
Is the embedded file valid?
Poppler::PSConverter::setPSOptions
void setPSOptions(PSOptions options)
Sets the options for the PS export.
Poppler::FontInfo::name
QString name() const
The name of the font.
Poppler::FontIterator::next
QList< FontInfo > next()
Returns the fonts of the current page and then advances the iterator to the next page.
Poppler::FontInfo::operator=
FontInfo & operator=(const FontInfo &fi)
Standard assignment operator.
Poppler::isOverprintPreviewAvailable
bool isOverprintPreviewAvailable()
Whether the overprint preview functionality is available.
Poppler::Document::loadFromData
static Document * loadFromData(const QByteArray &fileContents, const QByteArray &ownerPassword=QByteArray(), const QByteArray &userPassword=QByteArray())
Load the document from memory.
Poppler::Document::okToExtractForAccessibility
bool okToExtractForAccessibility() const
Test if the permissions on the document allow content extraction (text and perhaps other content) for...
Poppler::Document::signatures
QVector< FormFieldSignature * > signatures() const
Returns the signatures of this document.
Poppler::TextBox
Describes the physical location of text on a document page.
Definition: poppler-qt5.h:113
Poppler::Document::creator
QString creator() const
The creator of the document.
Poppler::Document::availableRenderBackends
static QSet< RenderBackend > availableRenderBackends()
The available rendering backends.
Poppler::Page::label
QString label() const
Returns the label of the page, or a null string is the page has no label.
Poppler::FontIterator::currentPage
int currentPage() const
Returns the current page where the iterator is.
Poppler::MovieObject::rotation
int rotation() const
The rotation (either 0, 90, 180, or 270 degrees clockwise) for the movie,.
Poppler::MovieObject::PlayMode
PlayMode
The play mode for playing the movie.
Definition: poppler-qt5.h:2259
Poppler::Document::scripts
QStringList scripts() const
Document-level JavaScript scripts.
Poppler::SoundObject::muLaw
@ muLaw
mu-law-encoded samples
Definition: poppler-qt5.h:2193
Poppler::Document::okToCopy
bool okToCopy() const
Test if the permissions on the document allow the contents to be copied / extracted.
Poppler::EmbeddedFile::modDate
QDateTime modDate() const
The modification date for the embedded file, if known.
Poppler::Document::getPdfVersion
void getPdfVersion(int *major, int *minor) const
The version of the PDF specification that the document conforms to.
Poppler::SoundObject::channels
int channels() const
The number of sound channels to use to play the sound.
Poppler::Document::setColorDisplayProfile
void setColorDisplayProfile(void *outputProfileA)
Set a color display profile for the current document.
Poppler::Page::Seascape
@ Seascape
Seascape orientation (portrait, with 270 degrees clockwise rotation)
Definition: poppler-qt5.h:901
Poppler::Document::outline
QVector< OutlineItem > outline() const
Gets the outline of the document.
Poppler::Document::setTitle
bool setTitle(const QString &val)
Set the title of the document to.
Poppler::Document::okToPrintHighRes
bool okToPrintHighRes() const
Test if the permissions on the document allow it to be printed at high resolution.
Poppler::OutlineItem::destination
QSharedPointer< const LinkDestination > destination() const
The destination referred to by this item.
Poppler::Document::pageLayout
PageLayout pageLayout() const
The layout that pages should be shown in when the document is first opened.
Poppler::Document::AcroForm
@ AcroForm
AcroForm.
Definition: poppler-qt5.h:1200
Poppler::SoundObject::SoundType
SoundType
The type of sound.
Definition: poppler-qt5.h:2181
Poppler::EmbeddedFile::data
QByteArray data()
The data as a byte array.
Poppler::Document::page
Page * page(const QString &label) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Poppler::PSConverter::~PSConverter
~PSConverter() override
Destructor.
Poppler::OutlineItem::OutlineItem
OutlineItem()
Constructs a null item, i.e.
Poppler::SoundObject::soundEncoding
SoundEncoding soundEncoding() const
The encoding used for the sound.
Poppler::EmbeddedFile::mimeType
QString mimeType() const
The MIME type of the file, if known.
Poppler::Document::colorDisplayProfile
void * colorDisplayProfile() const
Return the current display profile.
Poppler::Page::SearchFlag
SearchFlag
Flags to modify the search behaviour.
Definition: poppler-qt5.h:758
Poppler::Document::okToAddNotes
bool okToAddNotes() const
Test if the permissions on the document allow annotations to be added or modified,...
Poppler::Document::pdfConverter
PDFConverter * pdfConverter() const
Gets a new PDF converter for this document.
Poppler::Document::unlock
bool unlock(const QByteArray &ownerPassword, const QByteArray &userPassword)
Provide the passwords required to unlock the document.
Poppler::Document::removeInfo
bool removeInfo()
Remove the document's Info dictionary.
Poppler::Page::annotations
QList< Annotation * > annotations() const
Returns the annotations of the page.
Poppler::MovieObject
Container class for a movie object in a PDF document.
Definition: poppler-qt5.h:2251
Poppler::Document::PageMode
PageMode
The page mode.
Definition: poppler-qt5.h:1138
Poppler::Document::setPaperColor
void setPaperColor(const QColor &color)
Sets the paper color.
Poppler::Document::ArthurBackend
@ ArthurBackend
Definition: poppler-qt5.h:1169
Poppler::Document::SinglePage
@ SinglePage
Display a single page.
Definition: poppler-qt5.h:1153
Poppler::Document::renderBackend
RenderBackend renderBackend() const
The currently set render backend.
Poppler::BaseConverter::~BaseConverter
virtual ~BaseConverter()
Destructor.
Poppler::Page::Opening
@ Opening
The action when a page is "opened".
Definition: poppler-qt5.h:450
Poppler::FontInfo::typeName
QString typeName() const
The name of the font encoding used.
Poppler::TextBox::charBoundingBox
QRectF charBoundingBox(int i) const
Returns the bounding box of the i -th characted of the word.
Poppler::PSConverter::setRightMargin
void setRightMargin(int marginRight)
Sets the output right margin.
Poppler::Document::isEncrypted
bool isEncrypted() const
Test if the document is encrypted.
Poppler::Document::newFontIterator
FontIterator * newFontIterator(int startPage=0) const
Creates a new FontIterator object for font scanning.
Poppler::BaseConverter::convert
virtual bool convert()=0
Does the conversion.
Poppler::TextBox::~TextBox
~TextBox()
Destructor.
Poppler::OutlineItem::uri
QString uri() const
The URI to which the item links.
Poppler::OutlineItem::isOpen
bool isOpen() const
Indicates whether the item should initially be display in an expanded or collapsed state.
Poppler::Document::RenderBackend
RenderBackend
The render backends available.
Definition: poppler-qt5.h:1167
Poppler::TextBox::TextBox
TextBox(const QString &text, const QRectF &bBox)
The default constructor sets the text and the rectangle that contains the text.
Poppler::Document::getPdfId
bool getPdfId(QByteArray *permanentId, QByteArray *updateId) const
The PDF identifiers.
Poppler::PSConverter::setHDPI
void setHDPI(double hDPI)
Sets the horizontal DPI.
Poppler::Document::setSubject
bool setSubject(const QString &val)
Set the subject of the document to.
Poppler::PSConverter::setBottomMargin
void setBottomMargin(int marginBottom)
Sets the output bottom margin.
Poppler::Document::fontData
QByteArray fontData(const FontInfo &fi) const
The font data if the font is an embedded one.
Poppler::setDebugErrorFunction
void setDebugErrorFunction(PopplerDebugFunc debugFunction, const QVariant &closure)
Set a new debug/error output function.
Poppler::Document
PDF document.
Definition: poppler-qt5.h:1129
Poppler::Document::UseThumbs
@ UseThumbs
Thumbnail images visible.
Definition: poppler-qt5.h:1141
Poppler::Page::defaultCTM
void defaultCTM(double *CTM, double dpiX, double dpiY, int rotate, bool upsideDown)
The default CTM.
Poppler::TextBox::hasSpaceAfter
bool hasSpaceAfter() const
Returns whether there is a space character after this text box.
Poppler::SoundObject::bitsPerSample
int bitsPerSample() const
The number of bits per sample value per channel.
Poppler::FontInfo::file
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...
Poppler::OutlineItem::isNull
bool isNull() const
Indicates whether an item is null, i.e.
Poppler::TextBox::boundingBox
QRectF boundingBox() const
Returns the position of the text, in point, i.e., 1/72 of an inch.
Poppler::Document::metadata
QString metadata() const
Gets the metadata stream contents.
Poppler::Document::creationDate
QDateTime creationDate() const
The date of the creation of the document.
Poppler::Document::page
Page * page(int index) const
Get a specified Page.
Poppler::PDFConverter::PDFOption
PDFOption
Options for the PDF export.
Definition: poppler-qt5.h:2110
Poppler::Document::isLocked
bool isLocked() const
Determine if the document is locked.
Poppler::Document::textDirection
Qt::LayoutDirection textDirection() const
The predominant reading order for text as supplied by the document's viewer preferences.
Poppler::LinkDestination
A destination.
Definition: poppler-link.h:69
Poppler::Document::setInfo
bool setInfo(const QString &key, const QString &val)
Set the value of the document's Info dictionary entry specified by.
Poppler::Page::index
int index() const
Returns the index of the page.
Poppler::Page::~Page
~Page()
Destructor.
Poppler::MovieObject::PlayRepeat
@ PlayRepeat
Play continuously until stopped.
Definition: poppler-qt5.h:2262
Poppler::SoundObject::Signed
@ Signed
Twos-complement values.
Definition: poppler-qt5.h:2192
Poppler::TextBox::text
QString text() const
Returns the text of this text box.
Poppler::Document::TwoPageLeft
@ TwoPageLeft
Display the pages two at a time, with odd-numbered pages on the left.
Definition: poppler-qt5.h:1157
Poppler::Page
A page in a document.
Definition: poppler-qt5.h:425
Poppler::PDFConverter::setPDFOptions
void setPDFOptions(PDFOptions options)
Sets the options for the PDF export.
Poppler::FontIterator
Iterator for reading the fonts in a document.
Definition: poppler-qt5.h:296
Poppler::FontInfo::isEmbedded
bool isEmbedded() const
Whether the font is embedded in the file, or not.
Poppler::Document::SplashBackend
@ SplashBackend
Splash backend.
Definition: poppler-qt5.h:1168
Poppler::PSConverter::convert
bool convert() override
Does the conversion.
Poppler::Document::psConverter
PSConverter * psConverter() const
Gets a new PS converter for this document.
Poppler::OutlineItem::children
QVector< OutlineItem > children() const
Gets the child items of this item.
Poppler::Document::author
QString author() const
The author of the document.
Poppler::Document::setKeywords
bool setKeywords(const QString &val)
Set the keywords of the document to.
Poppler::OutlineItem::name
QString name() const
The name of the item which should be displayed to the user.
Poppler::Document::keywords
QString keywords() const
The keywords of the document.
Poppler::Document::optionalContentModel
OptContentModel * optionalContentModel()
Itemviews model for optional content.
Poppler::PSConverter::setStrictMargins
void setStrictMargins(bool strictMargins)
Defines if margins have to be strictly followed (even if that means changing aspect ratio),...
Poppler::Document::setColorDisplayProfileName
void setColorDisplayProfileName(const QString &name)
Set a color display profile for the current document.
Poppler::Page::orientation
Orientation orientation() const
The orientation of the page.
Poppler::PageTransition
Describes how a PDF file viewer shall perform the transition from one page to another.
Definition: poppler-page-transition.h:48
Poppler::MovieObject::size
QSize size() const
The size of the movie.
Poppler::Page::Rotation
Rotation
The type of rotation to apply for an operation.
Definition: poppler-qt5.h:438
Poppler::BaseConverter
Base converter.
Definition: poppler-qt5.h:1905
Poppler::Page::TextLayout
TextLayout
How the text is going to be returned.
Definition: poppler-qt5.h:459
Poppler::BaseConverter::lastError
Error lastError() const
Returns the last error.
Poppler::EmbeddedFile::checksum
QByteArray checksum() const
The MD5 checksum of the file.
Poppler::Document::UseOutlines
@ UseOutlines
Document outline visible.
Definition: poppler-qt5.h:1140
Poppler::EmbeddedFile::size
int size() const
The size of the file.
Poppler::PSConverter::PSOption
PSOption
Options for the PS export.
Definition: poppler-qt5.h:1983
Poppler::Document::toc
QDomDocument * toc() const
Gets the table of contents (TOC) of the Document.
Poppler::PDFConverter
Converts a PDF to PDF (thus saves a copy of the document).
Definition: poppler-qt5.h:2102
Poppler::Page::Orientation
Orientation
Types of orientations that are possible.
Definition: poppler-qt5.h:898
Poppler::Page::Portrait
@ Portrait
Normal portrait orientation.
Definition: poppler-qt5.h:900
Poppler::Page::NextResult
@ NextResult
Find the next result, moving "down the page".
Definition: poppler-qt5.h:741
Poppler::Document::modificationDate
QDateTime modificationDate() const
The date of the last change in the document.
Poppler::Page::removeAnnotation
void removeAnnotation(const Annotation *ann)
Removes an annotation from the page and destroys the annotation object.
Poppler::MovieObject::showControls
bool showControls() const
Whether show a bar with movie controls.
Poppler::OutlineItem::externalFileName
QString externalFileName() const
The external file name of the document to which the.
Poppler::Document::embeddedFiles
QList< EmbeddedFile * > embeddedFiles() const
The documents embedded within the PDF document.
Poppler::Document::FormType
FormType
Form types.
Definition: poppler-qt5.h:1198
Poppler::SoundObject::samplingRate
double samplingRate() const
The sampling rate of the sound.
Poppler::PSConverter::setTitle
void setTitle(const QString &title)
Sets the title of the PS Document.
Poppler::EmbeddedFile
Container class for an embedded file with a PDF document.
Definition: poppler-qt5.h:335
Poppler::Document::~Document
~Document()
Destructor.
Poppler::OptContentModel
Model for optional content.
Definition: poppler-optcontent.h:49
Poppler::Document::okToCreateFormFields
bool okToCreateFormFields() const
Test if the permissions on the document allow interactive form fields (including signature fields) to...
Poppler::Page::PainterFlag
PainterFlag
Additional flags for the renderToPainter method.
Definition: poppler-qt5.h:469
Poppler::PSConverter
Converts a PDF to PS.
Definition: poppler-qt5.h:1973
Poppler::Document::producer
QString producer() const
The producer of the document.
Poppler::MovieObject::PlayOpen
@ PlayOpen
Like PlayOnce, but leaving the controls open.
Definition: poppler-qt5.h:2261
Poppler::PDFConverter::convert
bool convert() override
Does the conversion.
Poppler::Document::renderHints
RenderHints renderHints() const
The currently set render hints.
Poppler::Document::subject
QString subject() const
The subject of the document.
Poppler::Document::linkDestination
LinkDestination * linkDestination(const QString &name)
Tries to resolve the named destination name.
Poppler::EmbeddedFile::createDate
QDateTime createDate() const
The creation date for the embedded file, if known.
Poppler::Document::okToFillForm
bool okToFillForm() const
Test if the permissions on the document allow interactive form fields (including signature fields) to...
Poppler::Document::UseOC
@ UseOC
Optional content group panel visible.
Definition: poppler-qt5.h:1143
Poppler::Document::PageLayout
PageLayout
The page layout.
Definition: poppler-qt5.h:1151
Poppler::Document::setCreationDate
bool setCreationDate(const QDateTime &val)
Set the creation date of the document to.
Poppler::FontIterator::~FontIterator
~FontIterator()
Destructor.
Poppler::Document::setCreator
bool setCreator(const QString &val)
Set the creator of the document to.
Poppler::PDFConverter::~PDFConverter
~PDFConverter() override
Destructor.
Poppler::Document::FullScreen
@ FullScreen
Fullscreen mode (no menubar, windows controls etc)
Definition: poppler-qt5.h:1142
Poppler::PDFConverter::pdfOptions
PDFOptions pdfOptions() const
The currently set options for the PDF export.
Poppler::Page::links
QList< Link * > links() const
Gets the links of the page.
Poppler::Document::date
QDateTime date(const QString &type) const
Poppler::Document::NoForm
@ NoForm
Document doesn't contain forms.
Definition: poppler-qt5.h:1199
Poppler::Page::annotations
QList< Annotation * > annotations(const QSet< Annotation::SubType > &subtypes) const
Returns the annotations of the page.
Poppler::SoundObject::Raw
@ Raw
Raw encoding, with unspecified or unsigned values in the range [ 0, 2^B - 1 ].
Definition: poppler-qt5.h:2191
Poppler::FontInfo::type
Type type() const
The type of font encoding.
Poppler::Document::RenderHint
RenderHint
The render hints available.
Definition: poppler-qt5.h:1179
Poppler::Document::setDate
bool setDate(const QString &key, const QDateTime &val)
Set the Info dict date entry specified by.
Poppler::Document::okToPrint
bool okToPrint() const
Test if the permissions on the document allow it to be printed.
Poppler::Page::Landscape
@ Landscape
Landscape orientation (portrait, with 90 degrees clockwise rotation )
Definition: poppler-qt5.h:899
Poppler::Document::setProducer
bool setProducer(const QString &val)
Set the producer of the document to.
Poppler::FontInfo::isSubset
bool isSubset() const
Whether the font provided is only a subset of the full font or not.
Poppler::Document::load
static Document * load(const QString &filePath, const QByteArray &ownerPassword=QByteArray(), const QByteArray &userPassword=QByteArray())
Load the document from a file on disk.
Poppler::Page::FromTop
@ FromTop
Start sorting at the top of the document.
Definition: poppler-qt5.h:740
Poppler::Page::formFields
QList< FormField * > formFields() const
Returns the form fields on the page The caller gets the ownership of the returned objects.
Poppler::Document::okToChange
bool okToChange() const
Test if the permissions on the document allow it to be changed.
Poppler::Document::TwoColumnRight
@ TwoColumnRight
Display the pages in two columns, with odd-numbered pages on the right.
Definition: poppler-qt5.h:1156
Poppler::Document::setRenderBackend
void setRenderBackend(RenderBackend backend)
Sets the backend used to render the pages.
Poppler::PSConverter::setPaperHeight
void setPaperHeight(int paperHeight)
Sets the output paper height.
Poppler::OutlineItem
Item in the outline of a PDF document.
Definition: poppler-qt5.h:1007
Poppler::Page::PageAction
PageAction
The kinds of page actions.
Definition: poppler-qt5.h:449
Poppler::SoundObject::External
@ External
The real sound file is external.
Definition: poppler-qt5.h:2182
Poppler::Document::formCalculateOrder
QVector< int > formCalculateOrder() const
Returns the calculate order for forms (using their id)
Poppler::MovieObject::PlayOnce
@ PlayOnce
Play the movie once, closing the movie controls at the end.
Definition: poppler-qt5.h:2260
Poppler::Document::isLinearized
bool isLinearized() const
Test if the document is linearised.
Poppler::Page::duration
double duration() const
Returns the page duration.
Poppler::SoundObject::data
QByteArray data() const
The data of the sound, in case of SoundObject::Embedded.
Poppler::convertDate
QDateTime convertDate(char *dateString)
Conversion from PDF date string format to QDateTime.
Poppler
The Poppler Qt5 binding.
Definition: poppler-annotation.h:45
Poppler::EmbeddedFile::description
QString description() const
The description associated with the file, if any.
Poppler::Document::fonts
QList< FontInfo > fonts() const
The fonts within the PDF document.
Poppler::BaseConverter::setOutputFileName
void setOutputFileName(const QString &outputFileName)
Sets the output file name.
Poppler::PSConverter::setPaperWidth
void setPaperWidth(int paperWidth)
Sets the output paper width.
Poppler::PSConverter::setLeftMargin
void setLeftMargin(int marginLeft)
Sets the output left margin.
Poppler::Document::numPages
int numPages() const
The number of pages in the document.
Poppler::Document::TwoColumnLeft
@ TwoColumnLeft
Display the pages in two columns, with odd-numbered pages on the left.
Definition: poppler-qt5.h:1155
Poppler::Document::setAuthor
bool setAuthor(const QString &val)
Set the author of the document to.
Poppler::Document::setRenderHint
void setRenderHint(RenderHint hint, bool on=true)
Sets the render hint .
Poppler::PSConverter::psOptions
PSOptions psOptions() const
The currently set options for the PS export.
Poppler::SoundObject::soundType
SoundType soundType() const
Is the sound embedded (SoundObject::Embedded) or external (SoundObject::External)?