38 #ifndef __POPPLER_QT_H__ 39 #define __POPPLER_QT_H__ 41 #include "poppler-annotation.h" 42 #include "poppler-link.h" 43 #include "poppler-optcontent.h" 44 #include "poppler-page-transition.h" 46 #include <QtCore/QByteArray> 47 #include <QtCore/QDateTime> 48 #include <QtCore/QSet> 49 #include <QtXml/QDomDocument> 50 #include "poppler-export.h" 73 struct OutlineItemData;
116 TextBox(
const QString& text,
const QRectF &bBox);
125 QString text()
const;
133 QRectF boundingBox()
const;
145 QRectF charBoundingBox(
int i)
const;
150 bool hasSpaceAfter()
const;
194 FontInfo(
const FontInfoData &fid );
210 QString name()
const;
216 QString file()
const;
223 bool isEmbedded()
const;
231 bool isSubset()
const;
250 QString typeName()
const;
258 FontInfoData *m_data;
262 class FontIteratorData;
284 friend class DocumentData;
295 QList<FontInfo> next();
301 bool hasNext()
const;
306 int currentPage()
const;
316 class EmbeddedFileData;
321 friend class DocumentData;
322 friend class AnnotationPrivate;
336 QString name()
const;
343 QString description()
const;
355 QDateTime modDate()
const;
360 QDateTime createDate()
const;
367 QByteArray checksum()
const;
374 QString mimeType()
const;
386 bool isValid()
const;
397 EmbeddedFileData *m_embeddedFile;
409 class POPPLER_QT5_EXPORT
Page {
448 NoPainterFlags = 0x00000000,
456 DontSaveAndRestore = 0x00000001
458 Q_DECLARE_FLAGS( PainterFlags, PainterFlag )
498 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;
509 typedef void (*RenderToImagePartialUpdateFunc)(
const QImage & ,
const QVariant & );
519 typedef bool (*ShouldRenderToImagePartialQueryFunc)(
const QVariant & );
570 QImage renderToImage(
double xres,
double yres,
571 int x,
int y,
int w,
int h,
Rotation rotate,
572 RenderToImagePartialUpdateFunc partialUpdateCallback,
573 ShouldRenderToImagePartialQueryFunc shouldDoPartialUpdateCallback,
574 const QVariant &closure
584 typedef bool (*ShouldAbortQueryFunc)(
const QVariant & );
639 QImage renderToImage(
double xres,
double yres,
640 int x,
int y,
int w,
int h,
Rotation rotate,
641 RenderToImagePartialUpdateFunc partialUpdateCallback,
642 ShouldRenderToImagePartialQueryFunc shouldDoPartialUpdateCallback,
643 ShouldAbortQueryFunc shouldAbortRenderCallback,
644 const QVariant &closure
689 bool renderToPainter(QPainter* painter,
double xres=72.0,
double yres=72.0,
int x=-1,
int y=-1,
int w=-1,
int h=-1,
690 Rotation rotate = Rotate0, PainterFlags flags = NoPainterFlags)
const;
700 QImage thumbnail()
const;
711 QString text(
const QRectF &rect,
TextLayout textLayout)
const;
721 QString text(
const QRectF &rect)
const;
743 NoSearchFlags = 0x00000000,
744 IgnoreCase = 0x00000001,
745 WholeWords = 0x00000002,
746 IgnoreDiacritics = 0x00000004
750 Q_DECLARE_FLAGS( SearchFlags, SearchFlag )
763 Q_DECL_DEPRECATED
bool search(
const QString &text,
double &rectLeft,
double &rectTop,
double &rectRight,
double &rectBottom, SearchDirection direction, SearchMode caseSensitive, Rotation rotate = Rotate0)
const;
777 bool search(
const QString &text,
double &rectLeft,
double &rectTop,
double &rectRight,
double &rectBottom, SearchDirection direction, SearchFlags flags = NoSearchFlags, Rotation rotate = Rotate0)
const;
790 Q_DECL_DEPRECATED QList<QRectF> search(
const QString &text, SearchMode caseSensitive, Rotation rotate = Rotate0)
const;
803 QList<QRectF> search(
const QString &text, SearchFlags flags = NoSearchFlags, Rotation rotate = Rotate0)
const;
821 QList<TextBox*> textList(Rotation rotate = Rotate0)
const;
847 QList<TextBox*> textList(Rotation rotate, ShouldAbortQueryFunc shouldAbortExtractionCallback,
const QVariant &closure)
const;
852 QSizeF pageSizeF()
const;
857 QSize pageSize()
const;
876 Link *action( PageAction act )
const;
891 Orientation orientation()
const;
896 void defaultCTM(
double *CTM,
double dpiX,
double dpiY,
int rotate,
bool upsideDown);
901 QList<Link*> links()
const;
911 QList<Annotation*> annotations()
const;
926 QList<Annotation*> annotations(
const QSet<Annotation::SubType> &subtypes)
const;
943 void removeAnnotation(
const Annotation *ann );
951 QList<FormField*> formFields()
const;
960 double duration()
const;
967 QString label()
const;
979 Page(DocumentData *doc,
int index);
1008 bool isNull()
const;
1013 QString name()
const;
1018 bool isOpen()
const;
1025 QSharedPointer<const LinkDestination> destination()
const;
1032 QString externalFileName()
const;
1039 QString uri()
const;
1046 bool hasChildren()
const;
1053 QVector<OutlineItem> children()
const;
1057 OutlineItemData *m_data;
1112 friend class DocumentData;
1156 Antialiasing = 0x00000001,
1157 TextAntialiasing = 0x00000002,
1158 TextHinting = 0x00000004,
1159 TextSlightHinting = 0x00000008,
1160 OverprintPreview = 0x00000010,
1161 ThinLineSolid = 0x00000020,
1162 ThinLineShape = 0x00000040,
1163 IgnorePaperColor = 0x00000080,
1164 HideAnnotations = 0x00000100
1166 Q_DECLARE_FLAGS( RenderHints, RenderHint )
1188 void setColorDisplayProfile(
void *outputProfileA);
1198 void setColorDisplayProfileName(
const QString &name);
1206 void* colorRgbProfile()
const;
1214 void *colorDisplayProfile()
const;
1233 static Document *load(
const QString & filePath,
1234 const QByteArray &ownerPassword=QByteArray(),
1235 const QByteArray &userPassword=QByteArray());
1258 static Document *loadFromData(
const QByteArray &fileContents,
1259 const QByteArray &ownerPassword=QByteArray(),
1260 const QByteArray &userPassword=QByteArray());
1272 Page *page(
int index)
const;
1286 Page *page(
const QString &label)
const;
1291 int numPages()
const;
1298 PageMode pageMode()
const;
1305 PageLayout pageLayout()
const;
1313 Qt::LayoutDirection textDirection()
const;
1323 bool unlock(
const QByteArray &ownerPassword,
const QByteArray &userPassword);
1328 bool isLocked()
const;
1345 QDateTime date(
const QString & data )
const;
1352 bool setDate(
const QString & key,
const QDateTime & val );
1357 QDateTime creationDate()
const;
1364 bool setCreationDate(
const QDateTime & val );
1369 QDateTime modificationDate()
const;
1376 bool setModificationDate(
const QDateTime & val );
1394 QString info(
const QString & data )
const;
1401 bool setInfo(
const QString & key,
const QString & val );
1406 QString title()
const;
1413 bool setTitle(
const QString & val );
1418 QString author()
const;
1425 bool setAuthor(
const QString & val );
1430 QString subject()
const;
1437 bool setSubject(
const QString & val );
1442 QString keywords()
const;
1449 bool setKeywords(
const QString & val );
1454 QString creator()
const;
1461 bool setCreator(
const QString & val );
1466 QString producer()
const;
1473 bool setProducer(
const QString & val );
1485 QStringList infoKeys()
const;
1490 bool isEncrypted()
const;
1498 bool isLinearized()
const;
1504 bool okToPrint()
const;
1510 bool okToPrintHighRes()
const;
1519 bool okToChange()
const;
1525 bool okToCopy()
const;
1532 bool okToAddNotes()
const;
1541 bool okToFillForm()
const;
1548 bool okToCreateFormFields()
const;
1555 bool okToExtractForAccessibility()
const;
1564 bool okToAssemble()
const;
1577 void getPdfVersion(
int *major,
int *minor)
const;
1590 QList<FontInfo> fonts()
const;
1607 FontIterator* newFontIterator(
int startPage = 0 )
const;
1614 QByteArray fontData(
const FontInfo &font)
const;
1622 QList<EmbeddedFile*> embeddedFiles()
const;
1627 bool hasEmbeddedFiles()
const;
1652 QDomDocument *toc()
const;
1661 QVector<OutlineItem> outline()
const;
1678 void setPaperColor(
const QColor &color);
1684 QColor paperColor()
const;
1693 void setRenderBackend( RenderBackend backend );
1701 RenderBackend renderBackend()
const;
1708 static QSet<RenderBackend> availableRenderBackends();
1719 void setRenderHint( RenderHint hint,
bool on =
true );
1725 RenderHints renderHints()
const;
1750 QString metadata()
const;
1764 bool hasOptionalContent()
const;
1783 QStringList scripts()
const;
1797 bool getPdfId(QByteArray *permanentId, QByteArray *updateId)
const;
1804 FormType formType()
const;
1811 QVector<int> formCalculateOrder()
const;
1821 DocumentData *m_doc;
1826 class BaseConverterPrivate;
1827 class PSConverterPrivate;
1828 class PDFConverterPrivate;
1846 void setOutputFileName(
const QString &outputFileName);
1853 void setOutputDevice(QIODevice *device);
1860 virtual bool convert() = 0;
1867 NotSupportedInputFileError
1874 Error lastError()
const;
1880 BaseConverterPrivate *d_ptr;
1913 Printing = 0x00000001,
1914 StrictMargins = 0x00000002,
1915 ForceRasterization = 0x00000004,
1916 PrintToEPS = 0x00000008,
1917 HideAnnotations = 0x00000010
1919 Q_DECLARE_FLAGS( PSOptions, PSOption )
1927 void setPageList(
const QList<int> &pageList);
1932 void setTitle(
const QString &title);
1937 void setHDPI(
double hDPI);
1942 void setVDPI(
double vDPI);
1947 void setRotate(
int rotate);
1952 void setPaperWidth(
int paperWidth);
1957 void setPaperHeight(
int paperHeight);
1962 void setRightMargin(
int marginRight);
1967 void setBottomMargin(
int marginBottom);
1972 void setLeftMargin(
int marginLeft);
1977 void setTopMargin(
int marginTop);
1986 void setStrictMargins(
bool strictMargins);
1989 void setForceRasterize(
bool forceRasterize);
1996 void setPSOptions(PSOptions options);
2005 PSOptions psOptions()
const;
2014 void setPageConvertedCallback(
void (* callback)(
int page,
void *payload),
void *payload);
2016 bool convert()
override;
2038 WithChanges = 0x00000001
2040 Q_DECLARE_FLAGS( PDFOptions, PDFOption )
2050 void setPDFOptions(PDFOptions options);
2054 PDFOptions pdfOptions()
const;
2056 bool convert()
override;
2068 POPPLER_QT5_EXPORT Q_DECL_DEPRECATED QDateTime
convertDate(
char *dateString );
2075 POPPLER_QT5_EXPORT QDateTime
convertDate(
const char *dateString );
2130 SoundType soundType()
const;
2135 QString url()
const;
2140 QByteArray data()
const;
2145 double samplingRate()
const;
2150 int channels()
const;
2155 int bitsPerSample()
const;
2160 SoundEncoding soundEncoding()
const;
2165 SoundData *m_soundData;
2175 friend class AnnotationPrivate;
2192 QString url()
const;
2202 int rotation()
const;
2207 bool showControls()
const;
2212 PlayMode playMode()
const;
2218 bool showPosterImage()
const;
2226 QImage posterImage()
const;
2235 MovieData *m_movieData;
2240 Q_DECLARE_OPERATORS_FOR_FLAGS(Poppler::Page::PainterFlags)
2241 Q_DECLARE_OPERATORS_FOR_FLAGS(Poppler::Page::SearchFlags)
2242 Q_DECLARE_OPERATORS_FOR_FLAGS(Poppler::Document::RenderHints)
2243 Q_DECLARE_OPERATORS_FOR_FLAGS(Poppler::PDFConverter::PDFOptions)
2244 Q_DECLARE_OPERATORS_FOR_FLAGS(Poppler::PSConverter::PSOptions)
Converts a PDF to PDF (thus saves a copy of the document).
Definition: poppler-qt5.h:2030
Play continuously until stopped.
Definition: poppler-qt5.h:2183
Like PlayOnce, but leaving the controls open.
Definition: poppler-qt5.h:2182
PageMode
The page mode.
Definition: poppler-qt5.h:1118
bool isOverprintPreviewAvailable()
Whether the overprint preview functionality is available.
SoundType
The type of sound.
Definition: poppler-qt5.h:2106
The real sound file is external.
Definition: poppler-qt5.h:2107
TextLayout
How the text is going to be returned.
Definition: poppler-qt5.h:438
Encapsulates data that describes a link.
Definition: poppler-link.h:178
bool isCmsAvailable()
Whether the color management functions are available.
A destination.
Definition: poppler-link.h:67
Describes the physical location of text on a document page.
Definition: poppler-qt5.h:108
Annotation class holding properties shared by all annotations.
Definition: poppler-annotation.h:174
Display the pages in two columns, with odd-numbered pages on the left.
Definition: poppler-qt5.h:1134
void(* PopplerDebugFunc)(const QString &, const QVariant &)
Debug/error function.
Definition: poppler-qt5.h:84
PDF document.
Definition: poppler-qt5.h:1110
Find the next result, moving "down the page".
Definition: poppler-qt5.h:727
Raw encoding, with unspecified or unsigned values in the range [ 0, 2^B - 1 ].
Definition: poppler-qt5.h:2115
Thumbnail images visible.
Definition: poppler-qt5.h:1121
Landscape orientation (portrait, with 90 degrees clockwise rotation )
Definition: poppler-qt5.h:882
Optional content group panel visible.
Definition: poppler-qt5.h:1123
Seascape orientation (portrait, with 270 degrees clockwise rotation)
Definition: poppler-qt5.h:884
Type
The type of font.
Definition: poppler-qt5.h:170
No mode - neither document outline nor thumbnail images are visible.
Definition: poppler-qt5.h:1119
Fullscreen mode (no menubar, windows controls etc)
Definition: poppler-qt5.h:1122
Container class for a sound file in a PDF document.
Definition: poppler-qt5.h:2101
Rotation
The type of rotation to apply for an operation.
Definition: poppler-qt5.h:420
PageLayout
The page layout.
Definition: poppler-qt5.h:1130
PageAction
The kinds of page actions.
Definition: poppler-qt5.h:429
PSOption
Options for the PS export.
Definition: poppler-qt5.h:1912
RenderHint
The render hints available.
Definition: poppler-qt5.h:1155
A page in a document.
Definition: poppler-qt5.h:409
Container class for an embedded file with a PDF document.
Definition: poppler-qt5.h:320
Splash backend.
Definition: poppler-qt5.h:1146
The text is layouted to resemble the real page layout.
Definition: poppler-qt5.h:439
Play the movie once, closing the movie controls at the end.
Definition: poppler-qt5.h:2181
Container class for a movie object in a PDF document.
Definition: poppler-qt5.h:2174
RenderBackend
The render backends available.
Definition: poppler-qt5.h:1145
PlayMode
The play mode for playing the movie.
Definition: poppler-qt5.h:2180
Document doesn't contain forms.
Definition: poppler-qt5.h:1174
void setDebugErrorFunction(PopplerDebugFunc debugFunction, const QVariant &closure)
Set a new debug/error output function.
PDFOption
Options for the PDF export.
Definition: poppler-qt5.h:2037
Document outline visible.
Definition: poppler-qt5.h:1120
Display a single column of pages.
Definition: poppler-qt5.h:1133
Twos-complement values.
Definition: poppler-qt5.h:2116
Orientation
Types of orientations that are possible.
Definition: poppler-qt5.h:881
Model for optional content.
Definition: poppler-optcontent.h:49
Display a single page.
Definition: poppler-qt5.h:1132
The action when a page is "opened".
Definition: poppler-qt5.h:430
FormType
Form types.
Definition: poppler-qt5.h:1173
SearchFlag
Flags to modify the search behaviour.
Definition: poppler-qt5.h:741
Normal portrait orientation.
Definition: poppler-qt5.h:883
Definition: poppler-qt5.h:282
Container class for information about a font within a PDF document.
Definition: poppler-qt5.h:164
Display the pages two at a time, with odd-numbered pages on the left.
Definition: poppler-qt5.h:1136
Display the pages in two columns, with odd-numbered pages on the right.
Definition: poppler-qt5.h:1135
Item in the outline of a PDF document.
Definition: poppler-qt5.h:990
Layout not specified.
Definition: poppler-qt5.h:1131
QDateTime convertDate(char *dateString)
Conversion from PDF date string format to QDateTime.
SearchMode
The type of search to perform.
Definition: poppler-qt5.h:734
Base converter.
Definition: poppler-qt5.h:1836
AcroForm.
Definition: poppler-qt5.h:1175
SoundEncoding
The encoding format used for the sound.
Definition: poppler-qt5.h:2114
The Poppler Qt5 binding.
Definition: poppler-annotation.h:45
PainterFlag
Additional flags for the renderToPainter method.
Definition: poppler-qt5.h:447
SearchDirection
The starting point for a search.
Definition: poppler-qt5.h:726
mu-law-encoded samples
Definition: poppler-qt5.h:2117
Describes how a PDF file viewer shall perform the transition from one page to another.
Definition: poppler-page-transition.h:48
Definition: poppler-qt5.h:1903