Poppler Qt5  20.08.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 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  {
1169  ArthurBackend
1170  };
1171 
1178  {
1179  Antialiasing = 0x00000001,
1180  TextAntialiasing = 0x00000002,
1181  TextHinting = 0x00000004,
1182  TextSlightHinting = 0x00000008,
1183  OverprintPreview = 0x00000010,
1184  ThinLineSolid = 0x00000020,
1185  ThinLineShape = 0x00000040,
1186  IgnorePaperColor = 0x00000080,
1187  HideAnnotations = 0x00000100
1188  };
1189  Q_DECLARE_FLAGS(RenderHints, RenderHint)
1190 
1191 
1197  {
1200  XfaForm
1201  };
1202 
1215  void setColorDisplayProfile(void *outputProfileA);
1225  void setColorDisplayProfileName(const QString &name);
1236  void *colorRgbProfile() const;
1247  void *colorDisplayProfile() const;
1248 
1266  static Document *load(const QString &filePath, const QByteArray &ownerPassword = QByteArray(), const QByteArray &userPassword = QByteArray());
1267 
1292  static Document *load(QIODevice *device, const QByteArray &ownerPassword = QByteArray(), const QByteArray &userPassword = QByteArray());
1293 
1315  static Document *loadFromData(const QByteArray &fileContents, const QByteArray &ownerPassword = QByteArray(), const QByteArray &userPassword = QByteArray());
1316 
1329  Page *page(int index) const;
1330 
1343  Page *page(const QString &label) const;
1344 
1348  int numPages() const;
1349 
1356 
1363 
1370  Qt::LayoutDirection textDirection() const;
1371 
1380  bool unlock(const QByteArray &ownerPassword, const QByteArray &userPassword);
1381 
1385  bool isLocked() const;
1386 
1402  QDateTime date(const QString &type) const;
1403 
1409  bool setDate(const QString &key, const QDateTime &val);
1410 
1414  QDateTime creationDate() const;
1415 
1421  bool setCreationDate(const QDateTime &val);
1422 
1426  QDateTime modificationDate() const;
1427 
1433  bool setModificationDate(const QDateTime &val);
1434 
1451  QString info(const QString &type) const;
1452 
1458  bool setInfo(const QString &key, const QString &val);
1459 
1463  QString title() const;
1464 
1470  bool setTitle(const QString &val);
1471 
1475  QString author() const;
1476 
1482  bool setAuthor(const QString &val);
1483 
1487  QString subject() const;
1488 
1494  bool setSubject(const QString &val);
1495 
1499  QString keywords() const;
1500 
1506  bool setKeywords(const QString &val);
1507 
1511  QString creator() const;
1512 
1518  bool setCreator(const QString &val);
1519 
1523  QString producer() const;
1524 
1530  bool setProducer(const QString &val);
1531 
1537  bool removeInfo();
1538 
1542  QStringList infoKeys() const;
1543 
1547  bool isEncrypted() const;
1548 
1555  bool isLinearized() const;
1556 
1561  bool okToPrint() const;
1562 
1567  bool okToPrintHighRes() const;
1568 
1576  bool okToChange() const;
1577 
1582  bool okToCopy() const;
1583 
1589  bool okToAddNotes() const;
1590 
1598  bool okToFillForm() const;
1599 
1605  bool okToCreateFormFields() const;
1606 
1613 
1621  bool okToAssemble() const;
1622 
1634  void getPdfVersion(int *major, int *minor) const;
1635 
1647  QList<FontInfo> fonts() const;
1648 
1664  FontIterator *newFontIterator(int startPage = 0) const;
1665 
1671  QByteArray fontData(const FontInfo &fi) const;
1672 
1679  QList<EmbeddedFile *> embeddedFiles() const;
1680 
1684  bool hasEmbeddedFiles() const;
1685 
1709  Q_DECL_DEPRECATED QDomDocument *toc() const;
1710 
1718  QVector<OutlineItem> outline() const;
1719 
1728  LinkDestination *linkDestination(const QString &name);
1729 
1735  void setPaperColor(const QColor &color);
1741  QColor paperColor() const;
1742 
1759 
1765  static QSet<RenderBackend> availableRenderBackends();
1766 
1776  void setRenderHint(RenderHint hint, bool on = true);
1782  RenderHints renderHints() const;
1783 
1792 
1801 
1807  QString metadata() const;
1808 
1821  bool hasOptionalContent() const;
1822 
1831 
1840  QStringList scripts() const;
1841 
1854  bool getPdfId(QByteArray *permanentId, QByteArray *updateId) const;
1855 
1862 
1868  QVector<int> formCalculateOrder() const;
1869 
1878  QVector<FormFieldSignature *> signatures() const;
1879 
1884 
1885 private:
1886  Q_DISABLE_COPY(Document)
1887 
1888  DocumentData *m_doc;
1889 
1890  Document(DocumentData *dataA);
1891 };
1892 
1893 class BaseConverterPrivate;
1894 class PSConverterPrivate;
1895 class PDFConverterPrivate;
1903 class POPPLER_QT5_EXPORT BaseConverter
1904 {
1905  friend class Document;
1906 
1907 public:
1911  virtual ~BaseConverter();
1912 
1914  void setOutputFileName(const QString &outputFileName);
1915 
1921  void setOutputDevice(QIODevice *device);
1922 
1928  virtual bool convert() = 0;
1929 
1930  enum Error
1931  {
1932  NoError,
1933  FileLockedError,
1934  OpenOutputError,
1935  NotSupportedInputFileError
1936  };
1937 
1942  Error lastError() const;
1943 
1944 protected:
1946  BaseConverter(BaseConverterPrivate &dd);
1947  Q_DECLARE_PRIVATE(BaseConverter)
1948  BaseConverterPrivate *d_ptr;
1950 
1951 private:
1952  Q_DISABLE_COPY(BaseConverter)
1953 };
1954 
1971 class POPPLER_QT5_EXPORT PSConverter : public BaseConverter
1972 {
1973  friend class Document;
1974 
1975 public:
1982  {
1983  Printing = 0x00000001,
1984  StrictMargins = 0x00000002,
1985  ForceRasterization = 0x00000004,
1986  PrintToEPS = 0x00000008,
1987  HideAnnotations = 0x00000010
1988  };
1989  Q_DECLARE_FLAGS(PSOptions, PSOption)
1990 
1991 
1994  ~PSConverter() override;
1995 
1997  void setPageList(const QList<int> &pageList);
1998 
2002  void setTitle(const QString &title);
2003 
2007  void setHDPI(double hDPI);
2008 
2012  void setVDPI(double vDPI);
2013 
2017  void setRotate(int rotate);
2018 
2022  void setPaperWidth(int paperWidth);
2023 
2027  void setPaperHeight(int paperHeight);
2028 
2032  void setRightMargin(int marginRight);
2033 
2037  void setBottomMargin(int marginBottom);
2038 
2042  void setLeftMargin(int marginLeft);
2043 
2047  void setTopMargin(int marginTop);
2048 
2056  void setStrictMargins(bool strictMargins);
2057 
2059  void setForceRasterize(bool forceRasterize);
2060 
2066  void setPSOptions(PSOptions options);
2067 
2075  PSOptions psOptions() const;
2076 
2084  void setPageConvertedCallback(void (*callback)(int page, void *payload), void *payload);
2085 
2086  bool convert() override;
2087 
2088 private:
2089  Q_DECLARE_PRIVATE(PSConverter)
2090  Q_DISABLE_COPY(PSConverter)
2091 
2092  PSConverter(DocumentData *document);
2093 };
2094 
2100 class POPPLER_QT5_EXPORT PDFConverter : public BaseConverter
2101 {
2102  friend class Document;
2103 
2104 public:
2109  {
2110  WithChanges = 0x00000001
2111  };
2112  Q_DECLARE_FLAGS(PDFOptions, PDFOption)
2113 
2114 
2117  ~PDFConverter() override;
2118 
2122  void setPDFOptions(PDFOptions options);
2126  PDFOptions pdfOptions() const;
2127 
2128  bool convert() override;
2129 
2130 private:
2131  Q_DECLARE_PRIVATE(PDFConverter)
2132  Q_DISABLE_COPY(PDFConverter)
2133 
2134  PDFConverter(DocumentData *document);
2135 };
2136 
2140 POPPLER_QT5_EXPORT Q_DECL_DEPRECATED QDateTime convertDate(char *dateString);
2141 
2147 POPPLER_QT5_EXPORT QDateTime convertDate(const char *dateString);
2148 
2154 POPPLER_QT5_EXPORT bool isCmsAvailable();
2155 
2161 POPPLER_QT5_EXPORT bool isOverprintPreviewAvailable();
2162 
2163 class SoundData;
2173 class POPPLER_QT5_EXPORT SoundObject
2174 {
2175 public:
2180  {
2182  Embedded
2183  };
2184 
2189  {
2193  ALaw
2194  };
2195 
2197  SoundObject(Sound *popplersound);
2199 
2200  ~SoundObject();
2201 
2206 
2210  QString url() const;
2211 
2215  QByteArray data() const;
2216 
2220  double samplingRate() const;
2221 
2225  int channels() const;
2226 
2230  int bitsPerSample() const;
2231 
2236 
2237 private:
2238  Q_DISABLE_COPY(SoundObject)
2239 
2240  SoundData *m_soundData;
2241 };
2242 
2243 class MovieData;
2249 class POPPLER_QT5_EXPORT MovieObject
2250 {
2251  friend class AnnotationPrivate;
2252 
2253 public:
2258  {
2262  PlayPalindrome
2263  };
2264 
2265  ~MovieObject();
2266 
2270  QString url() const;
2271 
2275  QSize size() const;
2276 
2280  int rotation() const;
2281 
2285  bool showControls() const;
2286 
2291 
2296  bool showPosterImage() const;
2297 
2304  QImage posterImage() const;
2305 
2306 private:
2308  MovieObject(AnnotMovie *ann);
2310 
2311  Q_DISABLE_COPY(MovieObject)
2312 
2313  MovieData *m_movieData;
2314 };
2315 
2316 }
2317 
2318 Q_DECLARE_OPERATORS_FOR_FLAGS(Poppler::Page::PainterFlags)
2319 Q_DECLARE_OPERATORS_FOR_FLAGS(Poppler::Page::SearchFlags)
2320 Q_DECLARE_OPERATORS_FOR_FLAGS(Poppler::Document::RenderHints)
2321 Q_DECLARE_OPERATORS_FOR_FLAGS(Poppler::PDFConverter::PDFOptions)
2322 Q_DECLARE_OPERATORS_FOR_FLAGS(Poppler::PSConverter::PSOptions)
2323 
2324 #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:2189
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:2174
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:2258
Poppler::Document::scripts
QStringList scripts() const
Document-level JavaScript scripts.
Poppler::SoundObject::muLaw
@ muLaw
mu-law-encoded samples
Definition: poppler-qt5.h:2192
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:1199
Poppler::SoundObject::SoundType
SoundType
The type of sound.
Definition: poppler-qt5.h:2180
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:2250
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::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:2109
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:2261
Poppler::SoundObject::Signed
@ Signed
Twos-complement values.
Definition: poppler-qt5.h:2191
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:1904
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:1982
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:2101
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:1197
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:1972
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:2260
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:1198
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:2190
Poppler::FontInfo::type
Type type() const
The type of font encoding.
Poppler::Document::RenderHint
RenderHint
The render hints available.
Definition: poppler-qt5.h:1178
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:2181
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:2259
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)?