././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1651726107.0315058 python-poppler-qt5-21.3.0/0000775000175000017500000000000014234653433015257 5ustar00wilbertwilbert././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1651725847.0 python-poppler-qt5-21.3.0/ChangeLog0000644000175000017500000000150314234653027017025 0ustar00wilbertwilbertChangeLog of python-poppler-qt5 Version 21.3.0 -- May 5th, 2022 * Fix #43: Building 21.1.0 fails with unsupported function return type by Ben Greiner (thanks!) Version 21.1.0 -- January 7th, 2021 * Most new Qt5 api methods added upto poppler-qt5 21.01 (WB) * Deprecated C API calls updated (woodlandhunter) * Add support for building with SIP v5 (#41, Dmitry Shachnev) Version 0.75.0 -- November 22nd, 2019 * add LinkOCGState Version 0.74.0 -- September 18th 2019 * Enable C++11 support in setup.py (Alex Ball) * Fix build error on MacOSX (Davide Liessi) * Added more methods in Poppler Qt5 api (WB) Version 0.24.0 -- Feb 2015 * Initial release, converted from the python-poppler-qt4 code. * Disabled the methods that use QDomNode, QDomDocument and QDomElement types, those are unfortunately not supported by PyQt5. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1610021331.0 python-poppler-qt5-21.3.0/INSTALL0000644000175000017500000000334313775574723016326 0ustar00wilbertwilbertInstallation: ============= python-poppler-qt5 installs a single Python module named 'popplerqt5'. The setup script uses distutils. Use the following commands to build and install the module: python setup.py build python setup.py install To install in /usr instead of /usr/local: python setup.py install --prefix /usr You can also use the newer way of installing using pip: python -m pip install . Troubleshooting: ================ The setup script uses pkg-config to determine the version of the installed poppler-qt5 library. Methods or classes that are not in the installed poppler- qt5 library will then also be disabled in the Python binding. If your system does not provide pkg-config, you can manually specify the poppler version to use with the --poppler-version option, e.g.: python setup.py build_ext --poppler-version=0.14.0 Note that for these options to work you need the 'build_ext' command rather than the 'build' command. You may then also need the --include-dirs and --library-dirs options to the build_ext command if the correct poppler-qt5 header files and libraries can't be found. See the output of python setup.py --help build_ext for more options. If you have a Debian-based system such as Ubuntu, and you get the error message "ImportError: No module named popplerqt5", try: python setup.py install --install-layout=deb See the distutils documentation for more install options. Dependencies: ============= - sip 4.9.1 or newer - poppler-qt5 0.12.0 or newer (poppler-qt5 is part of poppler) - Qt5 - PyQt5 - Python (tested with 2.6) To build the popplerqt5 module, header files of Qt5 and poppler-qt5 and sip files of PyQt5 are needed (sometimes packaged separately in corresponding -dev packages). ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1424531781.0 python-poppler-qt5-21.3.0/LICENSE0000644000175000017500000000146412472120505016256 0ustar00wilbertwilbertThis binding is licensed under the GNU LGPL. Copyright (c) 2009-2010 Wilbert Berendsen (www.wilbertberendsen.nl) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1610032862.0 python-poppler-qt5-21.3.0/MANIFEST.in0000644000175000017500000000025013775623336017020 0ustar00wilbertwilbertinclude README.rst INSTALL LICENSE TODO ChangeLog include MANIFEST.in setup.cfg include *.py include *.sip include demo/*.py include version.sip.in exclude version.sip ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1651726107.0315058 python-poppler-qt5-21.3.0/PKG-INFO0000664000175000017500000000620414234653433016356 0ustar00wilbertwilbertMetadata-Version: 2.1 Name: python-poppler-qt5 Version: 21.3.0 Summary: A Python binding to Poppler-Qt5 Home-page: https://github.com/frescobaldi/python-poppler-qt5 Maintainer: Wilbert Berendsen Maintainer-email: wbsoft@xs4all.nl License: LGPL Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL) Classifier: Operating System :: MacOS :: MacOS X Classifier: Operating System :: Microsoft :: Windows Classifier: Operating System :: POSIX Classifier: Programming Language :: Python :: 3 Classifier: Topic :: Multimedia :: Graphics :: Viewers License-File: LICENSE ================== python-poppler-qt5 ================== A Python binding for libpoppler-qt5 that aims for completeness and for being actively maintained. Created and maintained by Wilbert Berendsen , with help of other contributors, especially where it concerns supporting many platforms and build systems. Thanks for everyone's help! Homepage: https://pypi.python.org/pypi/python-poppler-qt5/ Usage:: import popplerqt5 d = popplerqt5.Poppler.Document.load('file.pdf') Documentation ------------- The Python API closely follows the Poppler Qt5 C++ interface library API, documented at https://poppler.freedesktop.org/api/qt5/ . Note: Releases of PyQt5 < 5.4 currently do not support the QtXml module, all methods that use the QDomDocument, QDomElement and QDomNode types are disabled. This concerns the ``Document::toc()`` method and some constructors and the ``store()`` methods in the ``Annotation`` subclasses. So, using PyQt5 >= 5.4 is recommended. Wherever the C++ API requires ``QList``, ``QSet`` or ``QLinkedList``, any Python sequence can be used. API calls that return ``QList``, ``QSet`` or ``QLinkedList`` all return Python lists. There are a few other differences: ``Poppler::Document::getPdfVersion(int *major, int *minor)`` can simply be called as ``d.getPdfVersion()``, (where ``d`` is a ``Poppler::Document`` instance); it will return a tuple of two integers (major, minor). ``Poppler::Document`` has ``__len__`` and ``__getitem__`` methods, corresponding to ``numPages()`` and ``page(int num)``. ``Poppler::FontIterator`` (returned by ``Poppler::Document::newFontIterator``) is also a Python iterable (e.g. has ``__iter__()`` and ``__next__()`` methods). So although you can use:: it = document.newFontIterator() while it.hasNext(): fonts = it.next() # list of FontInfo objects ... you can also use the more Pythonic:: for fonts in document.newFontIterator(): ... In addition to the Poppler namespace, there are two toplevel module functions: ``popplerqt5.version()`` returns the version of the ``python-poppler-qt5`` package as a tuple of ints, e.g. ``(0, 18, 2)``. ``popplerqt5.poppler_version()`` returns the version of the linked Poppler-Qt5 library as a tuple of ints, e.g. ``(0, 24, 5)``. This is determined at build time. If at build time the Poppler-Qt5 version could not be determined and was not specified, an empty tuple might be returned. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1610026672.0 python-poppler-qt5-21.3.0/README.rst0000664000175000017500000000466313775607260016765 0ustar00wilbertwilbert================== python-poppler-qt5 ================== A Python binding for libpoppler-qt5 that aims for completeness and for being actively maintained. Created and maintained by Wilbert Berendsen , with help of other contributors, especially where it concerns supporting many platforms and build systems. Thanks for everyone's help! Homepage: https://pypi.python.org/pypi/python-poppler-qt5/ Usage:: import popplerqt5 d = popplerqt5.Poppler.Document.load('file.pdf') Documentation ------------- The Python API closely follows the Poppler Qt5 C++ interface library API, documented at https://poppler.freedesktop.org/api/qt5/ . Note: Releases of PyQt5 < 5.4 currently do not support the QtXml module, all methods that use the QDomDocument, QDomElement and QDomNode types are disabled. This concerns the ``Document::toc()`` method and some constructors and the ``store()`` methods in the ``Annotation`` subclasses. So, using PyQt5 >= 5.4 is recommended. Wherever the C++ API requires ``QList``, ``QSet`` or ``QLinkedList``, any Python sequence can be used. API calls that return ``QList``, ``QSet`` or ``QLinkedList`` all return Python lists. There are a few other differences: ``Poppler::Document::getPdfVersion(int *major, int *minor)`` can simply be called as ``d.getPdfVersion()``, (where ``d`` is a ``Poppler::Document`` instance); it will return a tuple of two integers (major, minor). ``Poppler::Document`` has ``__len__`` and ``__getitem__`` methods, corresponding to ``numPages()`` and ``page(int num)``. ``Poppler::FontIterator`` (returned by ``Poppler::Document::newFontIterator``) is also a Python iterable (e.g. has ``__iter__()`` and ``__next__()`` methods). So although you can use:: it = document.newFontIterator() while it.hasNext(): fonts = it.next() # list of FontInfo objects ... you can also use the more Pythonic:: for fonts in document.newFontIterator(): ... In addition to the Poppler namespace, there are two toplevel module functions: ``popplerqt5.version()`` returns the version of the ``python-poppler-qt5`` package as a tuple of ints, e.g. ``(0, 18, 2)``. ``popplerqt5.poppler_version()`` returns the version of the linked Poppler-Qt5 library as a tuple of ints, e.g. ``(0, 24, 5)``. This is determined at build time. If at build time the Poppler-Qt5 version could not be determined and was not specified, an empty tuple might be returned. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1568834529.0 python-poppler-qt5-21.3.0/TODO0000644000175000017500000000067113540501741015742 0ustar00wilbertwilbertTODO: DONE: - make demo.py working with PyQt5 - Poppler::Document::newFontIterator() is usable as Python iterable - Poppler::HighlightAnnotation::Quad.points has been fixed - support Poppler::InkAnnotation::inkPaths() and setInkPaths() - cast returned lists of objects like Document::links() to their respective types - convert to and from QLinkedList - test Python versions other than 2.6: 3.2.3 works - add some examples: demo.py added ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1651726107.0275059 python-poppler-qt5-21.3.0/demo/0000775000175000017500000000000014234653433016203 5ustar00wilbertwilbert././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1548063781.0 python-poppler-qt5-21.3.0/demo/demo.py0000664000175000017500000000203213421312045017462 0ustar00wilbertwilbertimport sys from PyQt5 import QtGui, QtWidgets import popplerqt5 usage = """ Demo to load a PDF and display the first page. Usage: python demo.py file.pdf """ def pdf_view(filename): """Return a Scrollarea showing the first page of the specified PDF file.""" label = QtWidgets.QLabel() doc = popplerqt5.Poppler.Document.load(filename) doc.setRenderHint(popplerqt5.Poppler.Document.Antialiasing) doc.setRenderHint(popplerqt5.Poppler.Document.TextAntialiasing) page = doc.page(0) image = page.renderToImage() label.setPixmap(QtGui.QPixmap.fromImage(image)) area = QtWidgets.QScrollArea() area.setWidget(label) area.setWindowTitle(filename) return area def main(): app = QtWidgets.QApplication(sys.argv) argv = QtWidgets.QApplication.arguments() if len(argv) < 2: sys.stderr.write(usage) sys.exit(2) filename = argv[-1] view = pdf_view(filename) view.show() sys.exit(app.exec_()) if __name__ == "__main__": main() ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1459488030.0 python-poppler-qt5-21.3.0/demo/merge-annotations.py0000664000175000017500000000337512677402436022223 0ustar00wilbertwilbert#!/usr/bin/env python2.7 import popplerqt5 import PyQt5.QtXml import argparse import tempfile import shutil def merge(target, src): dom=PyQt5.QtXml.QDomDocument() for pg_index in range(min(target.numPages(),src.numPages())): p_tgt = target.page(pg_index) p_src = src.page(pg_index) for a in p_src.annotations(): if not has_annotation(p_tgt,a): a_el = dom.createElement("annotation") popplerqt5.Poppler.AnnotationUtils.storeAnnotation(a,a_el,dom) a_tgt = popplerqt5.Poppler.AnnotationUtils.createAnnotation(a_el) p_tgt.addAnnotation(a_tgt) def has_annotation(page,a): for pa in page.annotations(): if pa.uniqueName() == a.uniqueName(): return True return False def save_pdf(pdf_doc,filename): c = pdf_doc.pdfConverter() c.setOutputFileName(filename) c.setPDFOptions(c.WithChanges) c.convert() def load_pdf(filename): return popplerqt5.Poppler.Document.load(filename) if __name__ == "__main__": parser = argparse.ArgumentParser(description='A simple utility for merging pdf annotations') parser.add_argument('file', help='the files to merge annotations from', nargs="+") parser.add_argument('--output', help='the file to save annotations to (if not present, will save into the first file)') args = parser.parse_args() tgt = load_pdf(args.file[0]) for f in args.file[1:]: src = load_pdf(f) merge(tgt,src) if args.output: save_pdf(tgt,args.output) else: tmp_h,tmp_path = tempfile.mkstemp("pdf") save_pdf(tgt,tmp_path) del tgt shutil.move(tmp_path,args.file[0]) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1568818412.0 python-poppler-qt5-21.3.0/poppler-annotation.sip0000664000175000017500000007542613540442354021640 0ustar00wilbertwilbertnamespace Poppler { class AnnotationUtils { %Docstring Helper class for (recursive) Annotation retrieval/storage. %End %TypeHeaderCode #include #include %End public: %If(QTXML_AVAILABLE) static Poppler::Annotation * createAnnotation( const QDomElement & annElement ); %Docstring Restore an ``Annotation`` (with revisions if needed) from the DOM element ``annElement``. Returns the complete Annotation or None if element is invalid. %End static void storeAnnotation( const Poppler::Annotation * ann, QDomElement & annElement, QDomDocument & document ); static QDomElement findChildElement( const QDomNode & parentNode, const QString & name ); %End }; // class AnnotationUtils class Annotation { %Docstring Annotation class holding properties shared by all annotations. %End %TypeHeaderCode #include #include %End public: enum SubType { AText = 1, ALine = 2, AGeom = 3, AHighlight = 4, AStamp = 5, AInk = 6, ALink = 7, ACaret = 8, AFileAttachment = 9, ASound = 10, AMovie = 11, %If(POPPLER_V0_20_0 -) AScreen = 12, %End %If(POPPLER_V0_22_0 -) AWidget = 13, %End %If(POPPLER_V0_36_0 -) ARichMedia = 14, %End A_BASE = 0 }; enum Flag { Hidden = 1, FixedSize = 2, FixedRotation = 4, DenyPrint = 8, DenyWrite = 16, DenyDelete = 32, ToggleHidingOnMouse = 64, External = 128 }; enum LineStyle { Solid = 1, Dashed = 2, Beveled = 4, Inset = 8, Underline = 16 }; enum LineEffect { NoEffect = 1, Cloudy = 2 }; enum RevScope { %If(POPPLER_V0_20_0 -) Root = 0, %End Reply = 1, Group = 2, Delete = 4 }; enum RevType { None = 1, Marked = 2, Unmarked = 4, Accepted = 8, Rejected = 16, Cancelled = 32, Completed = 64 }; QString author() const; void setAuthor( const QString &author ); QString contents() const; void setContents( const QString &contents ); QString uniqueName() const; void setUniqueName( const QString &uniqueName ); QDateTime modificationDate() const; void setModificationDate( const QDateTime &date ); QDateTime creationDate() const; void setCreationDate( const QDateTime &date ); int flags() const; void setFlags( int flags ); QRectF boundary() const; void setBoundary( const QRectF &boundary ); %If(POPPLER_V0_20_0 -) class Style { public: Style(); Style( const Poppler::Annotation::Style &other ); //Style& operator=( const Style &other ); ~Style(); // appearance properties QColor color() const; // black void setColor(const QColor &color); double opacity() const; // 1.0 void setOpacity(double opacity); // pen properties double width() const; // 1.0 void setWidth(double width); Poppler::Annotation::LineStyle lineStyle() const; // LineStyle::Solid void setLineStyle(Poppler::Annotation::LineStyle style); double xCorners() const; // 0.0 void setXCorners(double radius); double yCorners() const; // 0.0 void setYCorners(double radius); const QVector& dashArray() const; // [ 3 ] void setDashArray(const QVector &array); // pen effects Poppler::Annotation::LineEffect lineEffect() const; // LineEffect::NoEffect void setLineEffect(Poppler::Annotation::LineEffect effect); double effectIntensity() const; // 1.0 void setEffectIntensity(double intens); }; Poppler::Annotation::Style style() const; void setStyle( const Poppler::Annotation::Style& style ); %End %If(POPPLER_V0_20_0 -) class Popup { %Docstring Container class for Annotation pop-up window information %End public: Popup(); Popup( const Poppler::Annotation::Popup &other ); //Popup& operator=( const Popup &other ); ~Popup(); // window state (Hidden, FixedRotation, Deny* flags allowed) int flags() const; // -1 (never initialized) -> 0 (if inited and shown) void setFlags( int flags ); // geometric properties QRectF geometry() const; // no default void setGeometry( const QRectF &geom ); // window contens/override properties QString title() const; // '' text in the titlebar (overrides author) void setTitle( const QString &title ); QString summary() const; // '' short description (displayed if not empty) void setSummary( const QString &summary ); QString text() const; // '' text for the window (overrides annot->contents) void setText( const QString &text ); }; Poppler::Annotation::Popup popup() const; void setPopup( const Poppler::Annotation::Popup& popup ); %Docstring Warning: Currently does nothing %End %End %If(POPPLER_V0_20_0 -) RevScope revisionScope() const; // Root RevType revisionType() const; // None %End %If(POPPLER_V0_20_0 -) /** * Returns the revisions of this annotation * * \note The caller owns the returned annotations and they should * be deleted when no longer required. * * \since 0.20 */ QList revisions() const; %End /** * The type of the annotation. */ virtual SubType subType() const = 0; /** * Destructor. */ virtual ~Annotation(); %If(POPPLER_V0_22_0 -) /** * Describes the flags from an annotations 'AA' dictionary. * * This flag is used by the additionalAction() method for ScreenAnnotation * and WidgetAnnotation. * * \since 0.22 */ enum AdditionalActionType { CursorEnteringAction, ///< Performed when the cursor enters the annotation's active area CursorLeavingAction, ///< Performed when the cursor exists the annotation's active area MousePressedAction, ///< Performed when the mouse button is pressed inside the annotation's active area MouseReleasedAction, ///< Performed when the mouse button is released inside the annotation's active area FocusInAction, ///< Performed when the annotation receives the input focus FocusOutAction, ///< Performed when the annotation loses the input focus PageOpeningAction, ///< Performed when the page containing the annotation is opened PageClosingAction, ///< Performed when the page containing the annotation is closed PageVisibleAction, ///< Performed when the page containing the annotation becomes visible PageInvisibleAction ///< Performed when the page containing the annotation becomes invisible }; %End protected: %If(QTXML_AVAILABLE) void storeBaseAnnotationProperties( QDomNode & parentNode, QDomDocument & document ) const; %End private: Annotation(const Poppler::Annotation&); %If(QTXML_AVAILABLE) virtual void store( QDomNode & parentNode, QDomDocument & document ) const; %End %If(- POPPLER_V0_36_0) %ConvertToSubClassCode switch (sipCpp->subType()) { case Poppler::Annotation::AText: sipType = sipType_Poppler_TextAnnotation; break; case Poppler::Annotation::ALine: sipType = sipType_Poppler_LineAnnotation; break; case Poppler::Annotation::AGeom: sipType = sipType_Poppler_GeomAnnotation; break; case Poppler::Annotation::AHighlight: sipType = sipType_Poppler_HighlightAnnotation; break; case Poppler::Annotation::AStamp: sipType = sipType_Poppler_StampAnnotation; break; case Poppler::Annotation::AInk: sipType = sipType_Poppler_InkAnnotation; break; case Poppler::Annotation::ALink: sipType = sipType_Poppler_LinkAnnotation; break; case Poppler::Annotation::ACaret: sipType = sipType_Poppler_CaretAnnotation; break; case Poppler::Annotation::AFileAttachment: sipType = sipType_Poppler_FileAttachmentAnnotation; break; case Poppler::Annotation::ASound: sipType = sipType_Poppler_SoundAnnotation; break; case Poppler::Annotation::AMovie: sipType = sipType_Poppler_MovieAnnotation; break; case Poppler::Annotation::AScreen: sipType = sipType_Poppler_ScreenAnnotation; break; case Poppler::Annotation::AWidget: sipType = sipType_Poppler_WidgetAnnotation; break; default: sipType = sipType_Poppler_Annotation; } %End %End %If(POPPLER_V0_36_0 -) %ConvertToSubClassCode switch (sipCpp->subType()) { case Poppler::Annotation::AText: sipType = sipType_Poppler_TextAnnotation; break; case Poppler::Annotation::ALine: sipType = sipType_Poppler_LineAnnotation; break; case Poppler::Annotation::AGeom: sipType = sipType_Poppler_GeomAnnotation; break; case Poppler::Annotation::AHighlight: sipType = sipType_Poppler_HighlightAnnotation; break; case Poppler::Annotation::AStamp: sipType = sipType_Poppler_StampAnnotation; break; case Poppler::Annotation::AInk: sipType = sipType_Poppler_InkAnnotation; break; case Poppler::Annotation::ALink: sipType = sipType_Poppler_LinkAnnotation; break; case Poppler::Annotation::ACaret: sipType = sipType_Poppler_CaretAnnotation; break; case Poppler::Annotation::AFileAttachment: sipType = sipType_Poppler_FileAttachmentAnnotation; break; case Poppler::Annotation::ASound: sipType = sipType_Poppler_SoundAnnotation; break; case Poppler::Annotation::AMovie: sipType = sipType_Poppler_MovieAnnotation; break; case Poppler::Annotation::AScreen: sipType = sipType_Poppler_ScreenAnnotation; break; case Poppler::Annotation::AWidget: sipType = sipType_Poppler_WidgetAnnotation; break; case Poppler::Annotation::ARichMedia: sipType = sipType_Poppler_RichMediaAnnotation; break; default: sipType = sipType_Poppler_Annotation; } %End %End }; // class Annotation class TextAnnotation : Poppler::Annotation { %Docstring Annotation containing text. A text annotation is an object showing some text directly on the page, or linked to the contents using an icon shown on a page. %End %TypeHeaderCode #include #include %End public: // local enums enum TextType { Linked, InPlace }; enum InplaceIntent { Unknown, Callout, TypeWriter }; TextAnnotation( TextType type ); virtual ~TextAnnotation(); virtual SubType subType() const; /** The type of text annotation represented by this object */ TextType textType() const; /** The name of the icon for this text annotation. Standard names for text annotation icons are: - Comment - Help - Insert - Key - NewParagraph - Note (this is the default icon to use) - Paragraph */ QString textIcon() const; /** Set the name of the icon to use for this text annotation. \sa textIcon for the list of standard names */ void setTextIcon( const QString &icon ); QFont textFont() const; void setTextFont( const QFont &font ); int inplaceAlign() const; void setInplaceAlign( int align ); QPointF calloutPoint( int id ) const; %If(POPPLER_V0_20_0 -) QVector calloutPoints() const; void setCalloutPoints( const QVector &points ); %End InplaceIntent inplaceIntent() const; void setInplaceIntent( InplaceIntent intent ); private: %If(QTXML_AVAILABLE) TextAnnotation( const QDomNode &node ); virtual void store( QDomNode &parentNode, QDomDocument &document ) const; %End void setTextType( TextType type ); }; // class TextAnnotation class LineAnnotation : Poppler::Annotation { %Docstring Polygon/polyline annotation. This annotation represents a polygon (or polyline) to be drawn on a page. %End %TypeHeaderCode #include #include %End public: // local enums %If(POPPLER_V0_20_0 -) enum LineType { StraightLine, Polyline }; %End enum TermStyle { Square, Circle, Diamond, OpenArrow, ClosedArrow, None, Butt, ROpenArrow, RClosedArrow, Slash }; enum LineIntent { Unknown, Arrow, Dimension, PolygonCloud }; %If(POPPLER_V0_20_0 -) LineAnnotation( LineType type ); %End virtual ~LineAnnotation(); virtual SubType subType() const; %If(POPPLER_V0_20_0 -) LineType lineType() const; %End QLinkedList linePoints() const; void setLinePoints( const QLinkedList &points ); TermStyle lineStartStyle() const; void setLineStartStyle( TermStyle style ); TermStyle lineEndStyle() const; void setLineEndStyle( TermStyle style ); bool isLineClosed() const; void setLineClosed( bool closed ); QColor lineInnerColor() const; void setLineInnerColor( const QColor &color ); double lineLeadingForwardPoint() const; void setLineLeadingForwardPoint( double point ); double lineLeadingBackPoint() const; void setLineLeadingBackPoint( double point ); bool lineShowCaption() const; void setLineShowCaption( bool show ); LineIntent lineIntent() const; void setLineIntent( LineIntent intent ); private: %If(QTXML_AVAILABLE) LineAnnotation( const QDomNode &node ); virtual void store( QDomNode &parentNode, QDomDocument &document ) const; %End void setLineType( LineType type ); }; // class LineAnnotation class GeomAnnotation : Poppler::Annotation { %Docstring Geometric annotation. The geometric annotation represents a geometric figure, like a rectangle or an ellipse. %End %TypeHeaderCode #include #include %End public: GeomAnnotation(); virtual ~GeomAnnotation(); virtual SubType subType() const; // common enums enum GeomType { InscribedSquare, InscribedCircle }; GeomType geomType() const; void setGeomType( GeomType style ); QColor geomInnerColor() const; void setGeomInnerColor( const QColor &color ); private: %If(QTXML_AVAILABLE) GeomAnnotation( const QDomNode &node ); virtual void store( QDomNode &parentNode, QDomDocument &document ) const; %End }; // class GeomAnnotation class HighlightAnnotation : Poppler::Annotation { %Docstring Text highlight annotation. The highlight annotation represents some areas of text being "highlighted". %End %TypeHeaderCode #include #include %End public: HighlightAnnotation(); virtual ~HighlightAnnotation(); virtual SubType subType() const; /** The type of highlight */ enum HighlightType { Highlight, Squiggly, Underline, StrikeOut, }; /** Structure corresponding to a QuadPoints array. This matches a quadrilateral that describes the area around a word (or set of words) that are to be highlighted. */ struct Quad { QPointF * points { %GetCode sipPy = PyList_New(4); PyObject* obj; for (SIP_SSIZE_T i = 0; i < 4; ++i) { QPointF *point = new QPointF(sipCpp->points[i]); obj = sipConvertFromNewType(point, sipType_QPointF, NULL); PyList_SET_ITEM(sipPy, i, obj); } %End %SetCode SIP_SSIZE_T len; if (!PySequence_Check(sipPy) || (len = PySequence_Size(sipPy)) != 4) sipErr = 1; else { for (SIP_SSIZE_T i = 0; i < 4; ++i) { PyObject *itm = PySequence_ITEM(sipPy, i); bool ok = (itm && sipCanConvertToType(itm, sipType_QPointF, SIP_NOT_NONE)); Py_XDECREF(itm); if (!ok) { sipErr = 1; break; } } } if (sipErr == 1) PyErr_SetString(PyExc_ValueError, "Quad.points must be a sequence of exactly 4 QPointF() instances"); else { int iserr = 0; for (SIP_SSIZE_T i = 0; i < 4; ++i) { PyObject *itm = PySequence_ITEM(sipPy, i); QPointF *point = reinterpret_cast(sipConvertToType(itm, sipType_QPointF, 0, 0, 0, &iserr)); sipCpp->points[i] = *point; Py_DECREF(itm); } } %End }; bool capStart; bool capEnd; double feather; }; /** The type (style) of highlighting to use for this area or these areas. */ HighlightType highlightType() const; /** Set the type of highlighting to use for the given area or areas. */ void setHighlightType( HighlightType type ); /** The list of areas to highlight. */ QList< Poppler::HighlightAnnotation::Quad > highlightQuads() const; /** Set the areas to highlight. */ void setHighlightQuads( const QList< Poppler::HighlightAnnotation::Quad > &quads ); private: %If(QTXML_AVAILABLE) HighlightAnnotation( const QDomNode &node ); virtual void store( QDomNode &parentNode, QDomDocument &document ) const; %End }; // class HighlightAnnotation class StampAnnotation : Poppler::Annotation { %Docstring Stamp annotation. A simple annotation drawing a stamp on a page. %End %TypeHeaderCode #include #include %End public: StampAnnotation(); virtual ~StampAnnotation(); virtual SubType subType() const; /** The name of the icon for this stamp annotation. Standard names for stamp annotation icons are: - Approved - AsIs - Confidential - Departmental - Draft (this is the default icon type) - Experimental - Expired - Final - ForComment - ForPublicRelease - NotApproved - NotForPublicRelease - Sold - TopSecret */ QString stampIconName() const; /** Set the icon type for this stamp annotation. \sa stampIconName for the list of standard icon names */ void setStampIconName( const QString &name ); private: %If(QTXML_AVAILABLE) StampAnnotation( const QDomNode &node ); virtual void store( QDomNode &parentNode, QDomDocument &document ) const; %End }; // class StampAnnotation class InkAnnotation : Poppler::Annotation { %Docstring Ink Annotation. Annotation representing an ink path on a page. %End %TypeHeaderCode #include #include %End public: InkAnnotation(); virtual ~InkAnnotation(); virtual SubType subType() const; QList< QLinkedList > inkPaths() const; void setInkPaths( const QList< QLinkedList > &paths ); private: %If(QTXML_AVAILABLE) InkAnnotation( const QDomNode &node ); virtual void store( QDomNode &parentNode, QDomDocument &document ) const; %End }; // class InkAnnotation class LinkAnnotation : Poppler::Annotation { %Docstring Link Annotation. Annotation representing a link on a page. %End %TypeHeaderCode #include #include %End public: virtual ~LinkAnnotation(); virtual SubType subType() const; // local enums enum HighlightMode { None, Invert, Outline, Push }; %If(POPPLER_V0_20_0 -) Poppler::Link* linkDestination() const; void setLinkDestination( Poppler::Link *link ); %End HighlightMode linkHighlightMode() const; void setLinkHighlightMode( HighlightMode mode ); QPointF linkRegionPoint( int id ) const; void setLinkRegionPoint( int id, const QPointF &point ); private: LinkAnnotation(); %If(QTXML_AVAILABLE) LinkAnnotation( const QDomNode &node ); virtual void store( QDomNode &parentNode, QDomDocument &document ) const; %End }; // class LinkAnnotation class CaretAnnotation : Poppler::Annotation { %Docstring Caret annotation. The caret annotation represents a symbol to indicate the presence of text. %End %TypeHeaderCode #include #include %End public: CaretAnnotation(); virtual ~CaretAnnotation(); virtual SubType subType() const; /** * The symbols for the caret annotation. */ enum CaretSymbol { None, P }; CaretSymbol caretSymbol() const; void setCaretSymbol( CaretSymbol symbol ); private: %If(QTXML_AVAILABLE) CaretAnnotation( const QDomNode &node ); virtual void store( QDomNode &parentNode, QDomDocument &document ) const; %End }; // class CaretAnnotation class FileAttachmentAnnotation : Poppler::Annotation { %Docstring File attachment annotation. The file attachment annotation represents a file embedded in the document. %End %TypeHeaderCode #include #include %End public: virtual ~FileAttachmentAnnotation(); virtual SubType subType() const; /** * Returns the name of the icon of this annotation. */ QString fileIconName() const; /** * Sets a new name for the icon of this annotation. */ void setFileIconName( const QString &icon ); /** * Returns the EmbeddedFile of this annotation. */ Poppler::EmbeddedFile* embeddedFile() const; /** * Sets a new EmbeddedFile for this annotation. * * \note FileAttachmentAnnotation takes ownership of the object */ void setEmbeddedFile( Poppler::EmbeddedFile *ef ); private: FileAttachmentAnnotation(); %If(QTXML_AVAILABLE) FileAttachmentAnnotation( const QDomNode &node ); virtual void store( QDomNode &parentNode, QDomDocument &document ) const; %End }; // class FileAttachmentAnnotation class SoundAnnotation : Poppler::Annotation { %Docstring Sound annotation. The sound annotation represents a sound to be played when activated. %End %TypeHeaderCode #include #include %End public: virtual ~SoundAnnotation(); virtual SubType subType() const; /** * Returns the name of the icon of this annotation. */ QString soundIconName() const; /** * Sets a new name for the icon of this annotation. */ void setSoundIconName( const QString &icon ); /** * Returns the SoundObject of this annotation. */ Poppler::SoundObject* sound() const; /** * Sets a new SoundObject for this annotation. * * \note SoundAnnotation takes ownership of the object */ void setSound( Poppler::SoundObject *ef ); private: SoundAnnotation(); %If(QTXML_AVAILABLE) SoundAnnotation( const QDomNode &node ); virtual void store( QDomNode &parentNode, QDomDocument &document ) const; %End }; // class SoundAnnotation class MovieAnnotation : Poppler::Annotation { %Docstring Movie annotation. The movie annotation represents a movie to be played when activated. %End %TypeHeaderCode #include #include %End public: virtual ~MovieAnnotation(); virtual SubType subType() const; /** * Returns the MovieObject of this annotation. */ Poppler::MovieObject* movie() const; /** * Sets a new MovieObject for this annotation. * * \note MovieAnnotation takes ownership of the object */ void setMovie( Poppler::MovieObject *movie ); /** * Returns the title of the movie of this annotation. */ QString movieTitle() const; /** * Sets a new title for the movie of this annotation. */ void setMovieTitle( const QString &title ); private: MovieAnnotation(); %If(QTXML_AVAILABLE) MovieAnnotation( const QDomNode &node ); virtual void store( QDomNode &parentNode, QDomDocument &document ) const; %End }; // class MovieAnnotation class ScreenAnnotation : Poppler::Annotation { %Docstring Screen annotation. The screen annotation represents a screen to be played when activated. %End %TypeHeaderCode #include #include %End public: virtual ~ScreenAnnotation(); virtual SubType subType() const; /** * Returns the LinkRendition of this annotation. */ Poppler::LinkRendition* action() const; /** * Sets a new LinkRendition for this annotation. * * \note ScreenAnnotation takes ownership of the object */ void setAction( Poppler::LinkRendition *action ); /** * Returns the title of the screen of this annotation. */ QString screenTitle() const; /** * Sets a new title for the screen of this annotation. */ void setScreenTitle( const QString &title ); /** * Returns the additional action of the given @p type fo the annotation or * @c 0 if no action has been defined. * * \since 0.22 */ %If(POPPLER_V0_22_0 -) Poppler::Link* additionalAction( AdditionalActionType type ) const; %End private: ScreenAnnotation(); %If(QTXML_AVAILABLE) virtual void store( QDomNode &parentNode, QDomDocument &document ) const; // stub %End }; // class ScreenAnnotation class WidgetAnnotation : Poppler::Annotation { %Docstring Widget annotation. The widget annotation represents a widget (form field) on a page. Note: this class is just provided for consistency of the annotation API, use the FormField classes to get all the form-related information. %End %TypeHeaderCode #include #include %End public: virtual ~WidgetAnnotation(); virtual SubType subType() const; /** * Returns the additional action of the given @p type fo the annotation or * @c 0 if no action has been defined. * * \since 0.22 */ %If(POPPLER_V0_22_0 -) Poppler::Link* additionalAction( AdditionalActionType type ) const; %End private: WidgetAnnotation(); %If(QTXML_AVAILABLE) virtual void store( QDomNode &parentNode, QDomDocument &document ) const; // stub %End }; // class WidgetAnnotation %If(POPPLER_V0_36_0 -) class RichMediaAnnotation : Poppler::Annotation { %TypeHeaderCode #include #include %End public: ~RichMediaAnnotation(); SubType subType() const; class Params { public: ~Params(); /** * Returns the parameters for the flash player. */ QString flashVars() const; private: Params(); Params(const Poppler::RichMediaAnnotation::Params&); }; class Instance { public: enum Type { Type3D, ///< A 3D media file. TypeFlash, ///< A Flash media file. TypeSound, ///< A sound media file. TypeVideo ///< A video media file. }; ~Instance(); Type type() const; Poppler::RichMediaAnnotation::Params* params() const; private: Instance(); Instance(const Poppler::RichMediaAnnotation::Instance&); }; class Configuration { public: enum Type { Type3D, ///< A 3D media file. TypeFlash, ///< A Flash media file. TypeSound, ///< A sound media file. TypeVideo ///< A video media file. }; ~Configuration(); Type type() const; QString name() const; QList< Poppler::RichMediaAnnotation::Instance* > instances() const; private: Configuration(); Configuration(const Poppler::RichMediaAnnotation::Configuration&); }; class Asset { public: ~Asset(); QString name() const; EmbeddedFile* embeddedFile() const; private: Asset(); Asset(const Poppler::RichMediaAnnotation::Asset&); }; class Content { public: ~Content(); QList< Poppler::RichMediaAnnotation::Configuration* > configurations() const; QList< Poppler::RichMediaAnnotation::Asset* > assets() const; private: Content(); Content(const Poppler::RichMediaAnnotation::Content&); }; class Activation { public: enum Condition { PageOpened, ///< Activate when page is opened. PageVisible, ///< Activate when page becomes visible. UserAction ///< Activate when user interacts with the annotation. }; ~Activation(); Condition condition() const; private: Activation(); Activation(const Poppler::RichMediaAnnotation::Activation&); }; class Deactivation { public: enum Condition { PageClosed, ///< Deactivate when page is closed. PageInvisible, ///< Deactivate when page becomes invisible. UserAction ///< Deactivate when user interacts with the annotation. }; Condition condition() const; ~Deactivation(); private: Deactivation(); Deactivation(const Poppler::RichMediaAnnotation::Deactivation&); }; class Settings { public: Poppler::RichMediaAnnotation::Activation* activation() const; Poppler::RichMediaAnnotation::Deactivation* deactivation() const; ~Settings(); private: Settings(); Settings(const Poppler::RichMediaAnnotation::Settings&); }; Poppler::RichMediaAnnotation::Settings* settings() const; Poppler::RichMediaAnnotation::Content* content() const; private: RichMediaAnnotation(); }; // class RichMediaAnnotation %End }; // namespace Poppler /* kate: indent-width 4; space-indent on; hl c++; indent-mode cstyle; */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1568785551.0 python-poppler-qt5-21.3.0/poppler-convert.sip0000644000175000017500000000420613540342217021125 0ustar00wilbertwilbertnamespace Poppler { class BaseConverter { %TypeHeaderCode #include %End public: virtual ~BaseConverter(); void setOutputFileName(const QString &outputFileName); void setOutputDevice(QIODevice *device); virtual bool convert() = 0; enum Error { NoError, FileLockedError, OpenOutputError, NotSupportedInputFileError, }; Error lastError() const; private: BaseConverter(const Poppler::BaseConverter&); }; // class BaseConverter class PSConverter : Poppler::BaseConverter { %TypeHeaderCode #include %End public: enum PSOption { Printing = 0x00000001, StrictMargins = 0x00000002, ForceRasterization = 0x00000004, %If(POPPLER_V0_20_0 -) PrintToEPS = 0x00000008, HideAnnotations = 0x00000010, %End }; typedef QFlags PSOptions; ~PSConverter(); void setPageList(const QList &pageList); void setTitle(const QString &title); void setHDPI(double hDPI); void setVDPI(double vDPI); void setRotate(int rotate); void setPaperWidth(int paperWidth); void setPaperHeight(int paperHeight); void setRightMargin(int marginRight); void setBottomMargin(int marginBottom); void setLeftMargin(int marginLeft); void setTopMargin(int marginTop); void setStrictMargins(bool strictMargins); void setForceRasterize(bool forceRasterize); void setPSOptions(PSOptions options); PSOptions psOptions() const; bool convert(); private: PSConverter(const Poppler::PSConverter&); }; // class PSConverter class PDFConverter : Poppler::BaseConverter { %TypeHeaderCode #include %End public: enum PDFOption { WithChanges = 0x00000001, }; typedef QFlags PDFOptions; virtual ~PDFConverter(); void setPDFOptions(PDFOptions options); PDFOptions pdfOptions() const; bool convert(); private: PDFConverter(const Poppler::PDFConverter&); }; // class PDFConverter }; // namespace Poppler /* kate: indent-width 4; space-indent on; hl c++; indent-mode cstyle; */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1610029526.0 python-poppler-qt5-21.3.0/poppler-document.sip0000644000175000017500000001247613775614726021314 0ustar00wilbertwilbertnamespace Poppler { class Document { %TypeHeaderCode #include %End public: %If(POPPLER_V0_22_0 -) enum FormType { NoForm, AcroForm, XfaForm, }; %End enum PageMode { UseNone, UseOutlines, UseThumbs, FullScreen, UseOC, UseAttach, }; enum PageLayout { NoLayout, SinglePage, OneColumn, TwoColumnLeft, TwoColumnRight, TwoPageLeft, TwoPageRight, }; enum RenderBackend { SplashBackend, ArthurBackend, }; enum RenderHint { Antialiasing = 0x00000001, TextAntialiasing = 0x00000002, TextHinting = 0x00000004, TextSlightHinting = 0x00000008, %If(POPPLER_V0_22_0 -) OverprintPreview = 0x00000010, %End %If(POPPLER_V0_24_0 -) ThinLineSolid = 0x00000020, ThinLineShape = 0x00000040, %End %If(POPPLER_V0_36_0 -) IgnorePaperColor = 0x00000080, %End %If(POPPLER_V0_60_0 -) HideAnnotations = 0x00000100, %End }; typedef QFlags RenderHints; void setColorDisplayProfile(void *outputProfileA); void setColorDisplayProfileName(const QString &name); void* colorRgbProfile() const; void* colorDisplayProfile() const; static Poppler::Document *load(const QString & filePath, const QByteArray &ownerPassword=QByteArray(), const QByteArray &userPassword=QByteArray()) /Factory, ReleaseGIL/; %If(POPPLER_V0_85_0 -) static Poppler::Document *load (QIODevice *device, const QByteArray &ownerPassword=QByteArray(), const QByteArray &userPassword=QByteArray()) /Factory, ReleaseGIL/; %End static Poppler::Document *loadFromData(const QByteArray &fileContents, const QByteArray &ownerPassword=QByteArray(), const QByteArray &userPassword=QByteArray()) /Factory, ReleaseGIL/; Poppler::Page *page(int index) const /Factory/; Poppler::Page *__getitem__(int index) const /Factory/; %MethodCode SIP_SSIZE_T i = sipConvertFromSequenceIndex(a0, sipCpp->numPages()); if (i < 0) sipIsErr = 1; else sipRes = sipCpp->page((int)i); %End Poppler::Page *page(const QString &label) const /Factory/; int numPages() const /__len__/; int __bool__() const; %MethodCode sipRes = 1; %End PageMode pageMode() const; PageLayout pageLayout() const; %If(POPPLER_V0_28_0 -) Qt::LayoutDirection textDirection() const; %End bool unlock(const QByteArray &ownerPassword, const QByteArray &userPassword); bool isLocked() const; QDateTime date( const QString & data ) const; bool setDate( const QString & key, const QDateTime & val ); QDateTime creationDate() const; bool setCreationDate( const QDateTime & val ); QDateTime modificationDate() const; bool setModificationDate( const QDateTime & val ); QString info( const QString & data ) const; bool setInfo( const QString & key, const QString & val ); QString title() const; bool setTitle( const QString & val ); QString author() const; bool setAuthor( const QString & val ); QString subject() const; bool setSubject( const QString & val ); QString keywords() const; bool setKeywords( const QString & val ); QString creator() const; bool setCreator( const QString & val ); QString producer() const; bool setProducer( const QString & val ); QStringList infoKeys() const; bool removeInfo(); bool isEncrypted() const; bool isLinearized() const; bool okToPrint() const; bool okToPrintHighRes() const; bool okToChange() const; bool okToCopy() const; bool okToAddNotes() const; bool okToFillForm() const; bool okToCreateFormFields() const; bool okToExtractForAccessibility() const; bool okToAssemble() const; void getPdfVersion(int *major, int *minor) const; QList fonts() const /ReleaseGIL/; Poppler::FontIterator* newFontIterator( int startPage = 0 ) const /Factory/; QByteArray fontData(const Poppler::FontInfo &font) const; QList embeddedFiles() const; bool hasEmbeddedFiles() const; %If(QTXML_AVAILABLE) QDomDocument *toc() const; %End Poppler::LinkDestination *linkDestination( const QString &name ) /Factory, ReleaseGIL/; void setPaperColor(const QColor &color); QColor paperColor() const; void setRenderBackend( RenderBackend backend ); RenderBackend renderBackend() const; static QSet availableRenderBackends(); void setRenderHint( RenderHint hint, bool on = true ); RenderHints renderHints() const; Poppler::PSConverter *psConverter() const /Factory/; Poppler::PDFConverter *pdfConverter() const /Factory/; QString metadata() const; bool hasOptionalContent() const; Poppler::OptContentModel *optionalContentModel() /Factory/; QStringList scripts() const; bool getPdfId(QByteArray *permanentId, QByteArray *updateId) const; %If(POPPLER_V0_22_0 -) FormType formType() const; %End %If(POPPLER_V0_60_0 -) QVector formCalculateOrder() const; %End private: Document(); Document(const Poppler::Document &); }; // class Document }; // namespace Poppler ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1424531781.0 python-poppler-qt5-21.3.0/poppler-embedded-file.sip0000644000175000017500000000102312472120505022102 0ustar00wilbertwilbertnamespace Poppler { class EmbeddedFile { %TypeHeaderCode #include %End public: // EmbeddedFile(EmbFile *embfile); ~EmbeddedFile(); QString name() const; QString description() const; int size() const; QDateTime modDate() const; QDateTime createDate() const; QByteArray checksum() const; QString mimeType() const; QByteArray data(); bool isValid() const; private: EmbeddedFile(const Poppler::EmbeddedFile&); }; // class EmbeddedFile }; // namespace Poppler ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1424531781.0 python-poppler-qt5-21.3.0/poppler-font-info.sip0000644000175000017500000000123712472120505021342 0ustar00wilbertwilbertnamespace Poppler { class FontInfo { %TypeHeaderCode #include %End public: enum Type { unknown, Type1, Type1C, Type1COT, Type3, TrueType, TrueTypeOT, CIDType0, CIDType0C, CIDType0COT, CIDTrueType, CIDTrueTypeOT, }; FontInfo(); // FontInfo( const FontInfoData &fid ); FontInfo( const Poppler::FontInfo &fi ); ~FontInfo(); QString name() const; QString file() const; bool isEmbedded() const; bool isSubset() const; Type type() const; QString typeName() const; }; // class FontInfo }; // namespace Poppler ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1424531781.0 python-poppler-qt5-21.3.0/poppler-font-iterator.sip0000644000175000017500000000133712472120505022241 0ustar00wilbertwilbertnamespace Poppler { class FontIterator { %TypeHeaderCode #include %End public: ~FontIterator(); QList next(); bool hasNext() const; int currentPage() const; Poppler::FontIterator * __iter__(); %MethodCode sipRes = sipCpp; %End SIP_PYOBJECT __next__(); %MethodCode if (sipCpp->hasNext()) { QList next = sipCpp->next(); sipRes = sipConvertFromType(&next, sipFindType("QList"), Py_None); } else { PyErr_SetNone(PyExc_StopIteration); } %End private: FontIterator(const Poppler::FontIterator&); // FontIterator( int, DocumentData *dd ); }; // class FontIterator }; // namespace Poppler ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1610030019.0 python-poppler-qt5-21.3.0/poppler-form.sip0000644000175000017500000002310713775615703020426 0ustar00wilbertwilbertnamespace Poppler { class FormField { %TypeHeaderCode #include #include %End public: enum FormType { FormButton, FormText, FormChoice, FormSignature, }; virtual ~FormField(); virtual FormType type() const = 0; QRectF rect() const; int id() const; QString name() const; %If(POPPLER_V0_51_0 -) void setName(const QString &name) const; %End %If(POPPLER_V0_20_0 -) QString fullyQualifiedName() const; %End QString uiName() const; %If(POPPLER_V0_79_0 -) bool isPrintable () const; void setPrintable (bool value); %End bool isReadOnly() const; bool isVisible() const; %If(POPPLER_V0_64_0 -) void setReadOnly (bool value); void setVisible (bool value); %End Poppler::Link* activationAction() const; %If(POPPLER_V0_53_0 -) enum AdditionalActionType { FieldModified, ///< A JavaScript action to be performed when the user modifies the field FormatField, ///< A JavaScript action to be performed before the field is formatted to display its value ValidateField, ///< A JavaScript action to be performed when the field value changes CalculateField, ///< A JavaScript action to be performed when the field needs to be recalculated }; Link* additionalAction(AdditionalActionType type) const; %End private: FormField(const Poppler::FormField&); %ConvertToSubClassCode switch (sipCpp->type()) { case Poppler::FormField::FormButton: sipType = sipType_Poppler_FormFieldButton; break; case Poppler::FormField::FormText: sipType = sipType_Poppler_FormFieldText; break; case Poppler::FormField::FormChoice: sipType = sipType_Poppler_FormFieldChoice; break; default: sipType = sipType_Poppler_FormField; } %End }; // class FormField class FormFieldButton : Poppler::FormField { %TypeHeaderCode #include #include %End public: enum ButtonType { Push, CheckBox, Radio, }; // FormFieldButton(DocumentData *doc, ::Page *p, ::FormWidgetButton *w); virtual ~FormFieldButton(); virtual FormType type() const; ButtonType buttonType() const; QString caption() const; %If(POPPLER_V0_79_0 -) FormFieldIcon icon () const; void setIcon (const FormFieldIcon &icon); %End bool state() const; void setState( bool state ); QList siblings() const; private: FormFieldButton(const Poppler::FormFieldButton&); }; // class FormFieldButton class FormFieldText : Poppler::FormField { %TypeHeaderCode #include #include %End public: enum TextType { Normal, Multiline, FileSelect, }; // FormFieldText(DocumentData *doc, ::Page *p, ::FormWidgetText *w); virtual ~FormFieldText(); virtual FormType type() const; TextType textType() const; QString text() const; void setText( const QString& text ); bool isPassword() const; bool isRichText() const; int maximumLength() const; Qt::Alignment textAlignment() const; bool canBeSpellChecked() const; double getFontSize() const; void setFontSize(int fontSize); private: FormFieldText(const Poppler::FormFieldText&); }; // class FormFieldText class FormFieldChoice : Poppler::FormField { %TypeHeaderCode #include #include %End public: enum ChoiceType { ComboBox, ListBox, }; // FormFieldChoice(DocumentData *doc, ::Page *p, ::FormWidgetChoice *w); virtual ~FormFieldChoice(); virtual FormType type() const; ChoiceType choiceType() const; QStringList choices() const; %If(POPPLER_V0_87_0 -) QVector< QPair< QString, QString > > choicesWithExportValues () const; %End bool isEditable() const; bool multiSelect() const; QList currentChoices() const; void setCurrentChoices( const QList &choice ); %If(POPPLER_V0_22_0 -) QString editChoice() const; void setEditChoice(const QString& text); %End Qt::Alignment textAlignment() const; bool canBeSpellChecked() const; private: FormFieldChoice(const Poppler::FormFieldChoice&); }; // class FormFieldChoice %If(POPPLER_V0_51_0 -) class SignatureValidationInfo { %TypeHeaderCode #include #include #include %End public: enum SignatureStatus { SignatureValid, ///< The signature is cryptographically valid. SignatureInvalid, ///< The signature is cryptographically invalid. SignatureDigestMismatch, ///< The document content was changed after the signature was applied. SignatureDecodingError, ///< The signature CMS/PKCS7 structure is malformed. SignatureGenericError, ///< The signature could not be verified. SignatureNotFound, ///< The requested signature is not present in the document. SignatureNotVerified ///< The signature is not yet verified. }; enum CertificateStatus { CertificateTrusted, ///< The certificate is considered trusted. CertificateUntrustedIssuer, ///< The issuer of this certificate has been marked as untrusted by the user. CertificateUnknownIssuer, ///< The certificate trust chain has not finished in a trusted root certificate. CertificateRevoked, ///< The certificate was revoked by the issuing certificate authority. CertificateExpired, ///< The signing time is outside the validity bounds of this certificate. CertificateGenericError, ///< The certificate could not be verified. CertificateNotVerified ///< The certificate is not yet verified. }; %If(POPPLER_V0_58_0 -) enum HashAlgorithm { HashAlgorithmUnknown, HashAlgorithmMd2, HashAlgorithmMd5, HashAlgorithmSha1, HashAlgorithmSha256, HashAlgorithmSha384, HashAlgorithmSha512, HashAlgorithmSha224 }; %End %If(POPPLER_V0_74_0 -) CertificateInfo certificateInfo () const; %End SignatureStatus signatureStatus() const; CertificateStatus certificateStatus() const; QString signerName() const; %If(POPPLER_V0_58_0 -) QString signerSubjectDN() const; HashAlgorithm hashAlgorithm() const; time_t signingTime() const; QByteArray signature() const; QList signedRangeBounds() const; bool signsTotalDocument() const; private: SignatureValidationInfo(const SignatureValidationInfo &other); //SignatureValidationInfo &operator=(const SignatureValidationInfo &other); %End }; // class SignatureValidationInfo class FormFieldSignature : Poppler::FormField { %TypeHeaderCode #include #include %End public: %If(POPPLER_V0_58_0 -) enum SignatureType { AdbePkcs7sha1, AdbePkcs7detached, EtsiCAdESdetached }; %End enum ValidateOptions { ValidateVerifyCertificate = 1, ///< Validate the certificate. ValidateForceRevalidation = 2, ///< Force revalidation of the certificate. }; private: //FormFieldSignature(DocumentData *doc, ::Page *p, ::FormWidgetSignature *w); //~FormFieldSignature(); FormFieldSignature(const Poppler::FormFieldSignature&); FormType type() const; %If(POPPLER_V0_58_0 -) SignatureType signatureType() const; %End SignatureValidationInfo validate(ValidateOptions opt) const; %If(POPPLER_V0_58_0 -) SignatureValidationInfo validate(int opt, const QDateTime& validationTime) const; %End }; // FormFieldSignature %End // POPPLER_V0_51_0 %If(POPPLER_V0_74_0 -) class CertificateInfo { %TypeHeaderCode #include #include %End public: enum EntityInfoKey { CommonName, DistinguishedName, EmailAddress, Organization }; enum KeyUsageExtension { KuDigitalSignature = 0x80, KuNonRepudiation = 0x40, KuKeyEncipherment = 0x20, KuDataEncipherment = 0x10, KuKeyAgreement = 0x08, KuKeyCertSign = 0x04, KuClrSign = 0x02, KuEncipherOnly = 0x01, KuNone = 0x00 }; // next line is how to convert Q_DECLARE_FLAGS for enums to sip :-) typedef QFlags KeyUsageExtensions; enum PublicKeyType { RsaKey, DsaKey, EcKey, OtherKey }; QByteArray certificateData () const; %If(POPPLER_V21_01_0 -) bool checkPassword (const QString &password) const; %End bool isNull () const; bool isSelfSigned () const; QString issuerInfo (EntityInfoKey key) const; KeyUsageExtensions keyUsageExtensions () const; %If(POPPLER_V21_01_0 -) QString nickName () const; %End //CertificateInfo & operator= (const CertificateInfo &other); // XXX Syntax error QByteArray publicKey () const; int publicKeyStrength () const; PublicKeyType publicKeyType () const; QByteArray serialNumber () const; QString subjectInfo (EntityInfoKey key) const; QDateTime validityEnd () const; QDateTime validityStart () const; int version () const; // copy constructor CertificateInfo (const CertificateInfo &other); }; // class CertificateInfo %End // POPPLER_V0_74_0 - %If(POPPLER_V0_79_0 -) class FormFieldIcon { %TypeHeaderCode #include #include %End public: FormFieldIcon (const FormFieldIcon &ffIcon); //FormFieldIcon (FormFieldIconData *data); //FormFieldIcon & operator= (const FormFieldIcon &ffIcon); // XXX Syntax error }; // FormFieldIcon %End // POPPLER_V0_79_0 - }; // namespace Poppler /* kate: indent-width 4; space-indent on; hl c++; indent-mode cstyle; */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1424681801.0 python-poppler-qt5-21.3.0/poppler-link-destination.sip0000644000175000017500000000212212472565511022723 0ustar00wilbertwilbertnamespace Poppler { class LinkDestination { %Docstring A destination. The LinkDestination class represent a "destination" (in terms of visual viewport to be displayed) for ``Poppler.LinkGoto`` links, and items in the table of contents (TOC) of a document. Coordinates are in 0..1 range. %End %TypeHeaderCode #include #include %End public: enum Kind { destXYZ = 1, destFit = 2, destFitH = 3, destFitV = 4, destFitR = 5, destFitB = 6, destFitBH = 7, destFitBV = 8, }; LinkDestination(const QString &description); LinkDestination(const Poppler::LinkDestination &other); ~LinkDestination(); Kind kind() const; int pageNumber() const; double left() const; double bottom() const; double right() const; double top() const; double zoom() const; bool isChangeLeft() const; bool isChangeTop() const; bool isChangeZoom() const; QString toString() const; QString destinationName() const; }; // class LinkDestination }; // namespace Poppler ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1568834112.0 python-poppler-qt5-21.3.0/poppler-link.sip0000644000175000017500000001512613540501100020371 0ustar00wilbertwilbertnamespace Poppler { class Link { %TypeHeaderCode #include #include %End public: Link( const QRectF &linkArea ); enum LinkType { None, Goto, Execute, Browse, Action, Sound, Movie, Rendition, JavaScript, %If(POPPLER_V0_50_0 -) OCGState, %End }; virtual LinkType linkType() const; virtual ~Link(); QRectF linkArea() const; private: Link(const Poppler::Link&); %ConvertToSubClassCode switch (sipCpp->linkType()) { case Poppler::Link::Goto: sipType = sipType_Poppler_LinkGoto; break; case Poppler::Link::Execute: sipType = sipType_Poppler_LinkExecute; break; case Poppler::Link::Browse: sipType = sipType_Poppler_LinkBrowse; break; case Poppler::Link::Action: sipType = sipType_Poppler_LinkAction; break; case Poppler::Link::Sound: sipType = sipType_Poppler_LinkSound; break; case Poppler::Link::Movie: sipType = sipType_Poppler_LinkMovie; break; case Poppler::Link::Rendition: sipType = sipType_Poppler_LinkRendition; break; case Poppler::Link::JavaScript: sipType = sipType_Poppler_LinkJavaScript; break; default: sipType = sipType_Poppler_Link; } %End }; // class Link class LinkGoto : Poppler::Link { %TypeHeaderCode #include #include %End public: LinkGoto( const QRectF &linkArea, QString extFileName, const Poppler::LinkDestination & destination ); ~LinkGoto(); bool isExternal() const; QString fileName() const; Poppler::LinkDestination destination() const; LinkType linkType() const; private: LinkGoto(const Poppler::LinkGoto&); }; // class LinkGoto class LinkExecute : Poppler::Link { %TypeHeaderCode #include #include %End public: QString fileName() const; QString parameters() const; LinkExecute( const QRectF &linkArea, const QString & file, const QString & params ); ~LinkExecute(); LinkType linkType() const; private: LinkExecute(const Poppler::LinkExecute&); }; // class LinkExecute class LinkBrowse : Poppler::Link { %TypeHeaderCode #include #include %End public: QString url() const; LinkBrowse( const QRectF &linkArea, const QString &url ); ~LinkBrowse(); LinkType linkType() const; private: LinkBrowse(const Poppler::LinkBrowse&); }; // class LinkBrowse class LinkAction : Poppler::Link { %TypeHeaderCode #include #include %End public: enum ActionType { PageFirst = 1, PagePrev = 2, PageNext = 3, PageLast = 4, HistoryBack = 5, HistoryForward = 6, Quit = 7, Presentation = 8, EndPresentation = 9, Find = 10, GoToPage = 11, Close = 12, Print = 13, }; ActionType actionType() const; LinkAction( const QRectF &linkArea, ActionType actionType ); ~LinkAction(); LinkType linkType() const; private: LinkAction(const Poppler::LinkAction&); }; // class LinkAction class LinkSound : Poppler::Link { %TypeHeaderCode #include #include %End public: LinkSound( const QRectF &linkArea, double volume, bool sync, bool repeat, bool mix, Poppler::SoundObject *sound ); virtual ~LinkSound(); LinkType linkType() const; double volume() const; bool synchronous() const; bool repeat() const; bool mix() const; Poppler::SoundObject *sound() const; private: LinkSound(const Poppler::LinkSound&); }; // class LinkSound %If(POPPLER_V0_22_0 -) class LinkRendition : Poppler::Link { %TypeHeaderCode #include #include %End public: enum RenditionAction { NoRendition, PlayRendition, StopRendition, PauseRendition, ResumeRendition }; //LinkRendition( const QRectF &linkArea, Poppler::MediaRendition *rendition, int operation, const QString &script, const Ref &annotationReference ); virtual ~LinkRendition(); LinkType linkType() const; MediaRendition *rendition() const; RenditionAction action() const; QString script() const; bool isReferencedAnnotation( const Poppler::ScreenAnnotation *annotation ) const; private: LinkRendition(const Poppler::LinkRendition&); }; // class LinkRendition %End class LinkJavaScript : Poppler::Link { %TypeHeaderCode #include #include %End public: LinkJavaScript( const QRectF &linkArea, const QString &js ); virtual ~LinkJavaScript(); LinkType linkType() const; QString script() const; private: LinkJavaScript(const Poppler::LinkJavaScript&); }; // class LinkJavaScript class LinkMovie : Poppler::Link { %Docstring Movie: a movie to be played. %End %TypeHeaderCode #include #include %End public: /** * Describes the operation to be performed on the movie. */ enum Operation { Play, Stop, Pause, Resume }; /** * Create a new Movie link. * * \param linkArea the active area of the link * \param operation the operation to be performed on the movie * \param annotationTitle the title of the movie annotation identifying the movie to be played * \param annotationReference the object reference of the movie annotation identifying the movie to be played * * Note: This constructor is supposed to be used by Poppler::Page only. */ //LinkMovie( const QRectF &linkArea, Operation operation, const QString &annotationTitle, const Ref &annotationReference ); /** * Destructor. */ ~LinkMovie(); LinkType linkType() const; /** * Returns the operation to be performed on the movie. */ Operation operation() const; /** * Returns whether the given @p annotation is the referenced movie annotation for this movie @p link. */ bool isReferencedAnnotation( const Poppler::MovieAnnotation *annotation ) const; private: LinkMovie(const Poppler::LinkMovie&); }; // class LinkMovie %If(POPPLER_V0_50_0 -) class LinkOCGState : Poppler::Link { LinkType linkType() const; private: LinkOCGState(const Poppler::LinkOCGState&); }; // class LinkOCGState %End }; // namespace Poppler /* kate: indent-width 4; space-indent on; hl c++; indent-mode cstyle; */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1568815148.0 python-poppler-qt5-21.3.0/poppler-media.sip0000644000175000017500000000130613540434054020523 0ustar00wilbertwilbert%If(POPPLER_V0_22_0 -) namespace Poppler { class MediaRendition { %TypeHeaderCode #include #include %End public: ~MediaRendition(); bool isValid() const; QString contentType() const; QString fileName() const; bool isEmbedded() const; QByteArray data() const; bool autoPlay() const; bool showControls() const; float repeatCount() const; QSize size() const; private: MediaRendition(Poppler::MediaRendition *rendition); MediaRendition(const Poppler::MediaRendition&); }; // class MediaRendition }; // namespace Poppler %End /* kate: indent-width 4; space-indent on; hl c++; indent-mode cstyle; */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1424531781.0 python-poppler-qt5-21.3.0/poppler-movie-object.sip0000644000175000017500000000072512472120505022027 0ustar00wilbertwilbertnamespace Poppler { class MovieObject { %TypeHeaderCode #include %End public: enum PlayMode { PlayOnce, PlayOpen, PlayRepeat, PlayPalindrome, }; ~MovieObject(); QString url() const; QSize size() const; int rotation() const; bool showControls() const; PlayMode playMode() const; private: MovieObject(const Poppler::MovieObject&); }; // class MovieObject }; // namespace Poppler ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1568834027.0 python-poppler-qt5-21.3.0/poppler-opt-content-model.sip0000644000175000017500000000172213540500753023016 0ustar00wilbertwilbertnamespace Poppler { class OptContentModel : QAbstractItemModel { %TypeHeaderCode #include #include %End public: virtual ~OptContentModel(); QModelIndex index(int row, int column, const QModelIndex &parent) const; QModelIndex parent(const QModelIndex &child) const; int rowCount(const QModelIndex &parent = QModelIndex()) const; int columnCount(const QModelIndex &parent) const; QVariant data(const QModelIndex &index, int role) const; virtual bool setData ( const QModelIndex & index, const QVariant & value, int role = Qt::EditRole ); Qt::ItemFlags flags ( const QModelIndex & index ) const; virtual QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const; %If(POPPLER_V0_50_0 -) void applyLink( LinkOCGState *link ); %End private: OptContentModel(const Poppler::OptContentModel&); }; // class OptContentModel }; // namespace Poppler ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1424531781.0 python-poppler-qt5-21.3.0/poppler-page-transition.sip0000644000175000017500000000172112472120505022545 0ustar00wilbertwilbertnamespace Poppler { class PageTransition { %TypeHeaderCode #include #include %End public: enum Type { Replace = 0, Split, Blinds, Box, Wipe, Dissolve, Glitter, Fly, Push, Cover, Uncover, Fade, }; enum Alignment { Horizontal = 0, Vertical, }; enum Direction { Inward = 0, Outward, }; // PageTransition(const PageTransitionParams ¶ms); PageTransition(const Poppler::PageTransition &pt); ~PageTransition(); Type type() const; int duration() const; Alignment alignment() const; Direction direction() const; int angle() const; double scale() const; bool isRectangular() const; }; // class PageTransition }; // namespace Poppler /* kate: indent-width 4; space-indent on; hl c++; indent-mode cstyle; */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1568791754.0 python-poppler-qt5-21.3.0/poppler-page.sip0000644000175000017500000000630013540356312020357 0ustar00wilbertwilbertnamespace Poppler { class Page { %TypeHeaderCode #include %End public: ~Page(); enum Rotation { Rotate0 = 0, Rotate90 = 1, Rotate180 = 2, Rotate270 = 3, }; enum PageAction { Opening, Closing, }; enum TextLayout { PhysicalLayout, RawOrderLayout, }; enum PainterFlag { DontSaveAndRestore = 0x00000001, }; typedef QFlags PainterFlags; 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 /ReleaseGIL/; 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 = 0) const /ReleaseGIL/; QImage thumbnail() const; QString text(const QRectF &rect, TextLayout textLayout) const; QString text(const QRectF &rect) const; enum SearchDirection { FromTop, NextResult, PreviousResult, }; enum SearchMode { CaseSensitive, CaseInsensitive, }; %If(POPPLER_V0_31_0 -) enum SearchFlag { %If(POPPLER_V0_63_0 -) NoSearchFlags = 0x00000000, %End IgnoreCase = 0x00000001, WholeWords = 0x00000002, %If(POPPLER_V0_74_0 -) IgnoreDiacritics = 0x00000004, %End }; typedef QFlags SearchFlags; %End bool search(const QString &text, double &rectLeft, double &rectTop, double &rectRight, double &rectBottom, SearchDirection direction, SearchMode caseSensitive, Rotation rotate = Rotate0) const /Deprecated, ReleaseGIL/; bool search(const QString &text, double &rectLeft, double &rectTop, double &rectRight, double &rectBottom, SearchDirection direction, SearchFlags flags = 0, Rotation rotate = Rotate0) const /ReleaseGIL/; %If(POPPLER_V0_22_0 -) QList search(const QString &text, SearchMode caseSensitive, Rotation rotate = Rotate0) const /Deprecated, ReleaseGIL/; %End %If(POPPLER_V0_31_0 -) QList search(const QString &text, SearchFlags flags = 0, Rotation rotate = Rotate0) const /ReleaseGIL/; %End QList textList(Rotation rotate = Rotate0) const; QSizeF pageSizeF() const; QSize pageSize() const; Poppler::PageTransition *transition() const; Poppler::Link *action( PageAction act ) const; enum Orientation { Landscape, Portrait, Seascape, UpsideDown, }; Orientation orientation() const; void defaultCTM(double *CTM, double dpiX, double dpiY, int rotate, bool upsideDown); QList links() const; QList annotations() const /Factory/; %If(POPPLER_V0_28_0 -) QList annotations(const QSet &subtypes) const /Factory/; %End %If(POPPLER_V0_20_0 -) void addAnnotation( const Annotation *ann ); void removeAnnotation( const Annotation *ann ); %End QList formFields() const; double duration() const; QString label() const; private: Page(); Page( const Poppler::Page & ); }; // class Page }; // namespace Poppler ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1610020827.0 python-poppler-qt5-21.3.0/poppler-qt5.sip0000664000175000017500000000234113775573733020201 0ustar00wilbertwilbert%Module(name=popplerqt5) /* * Bindings for Poppler-Qt5 to Python * Maintained by Wilbert Berendsen */ %Feature QTXML_AVAILABLE %Import QtCore/QtCoremod.sip %Import QtGui/QtGuimod.sip %If(QTXML_AVAILABLE) %Import QtXml/QtXmlmod.sip %End %Include timeline.sip %ModuleHeaderCode #include %End %Include version.sip // auto-generated by the project.py script %Include types.sip %Include poppler-annotation.sip %Include poppler-convert.sip %Include poppler-document.sip %Include poppler-embedded-file.sip %Include poppler-font-info.sip %Include poppler-font-iterator.sip %Include poppler-form.sip %Include poppler-link.sip %Include poppler-link-destination.sip %Include poppler-media.sip %Include poppler-movie-object.sip %Include poppler-opt-content-model.sip %Include poppler-page.sip %Include poppler-page-transition.sip %Include poppler-sound-object.sip %Include poppler-text-box.sip namespace Poppler { // Functions in Poppler bool isCmsAvailable(); %If(POPPLER_V0_22_0 -) bool isOverprintPreviewAvailable(); %End %If(POPPLER_V0_64_0 -) QDateTime convertDate (const char *dateString); %End }; // namespace Poppler /* kate: indent-width 4; space-indent on; hl c++; indent-mode cstyle; */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1424531781.0 python-poppler-qt5-21.3.0/poppler-sound-object.sip0000644000175000017500000000120212472120505022027 0ustar00wilbertwilbertnamespace Poppler { class SoundObject { %TypeHeaderCode #include %End public: enum SoundType { External, Embedded, }; enum SoundEncoding { Raw, Signed, muLaw, ALaw, }; // SoundObject(Sound *popplersound); ~SoundObject(); SoundType soundType() const; QString url() const; QByteArray data() const; double samplingRate() const; int channels() const; int bitsPerSample() const; SoundEncoding soundEncoding() const; private: SoundObject(const Poppler::SoundObject&); }; // class SoundObject }; // namespace Poppler ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1424531781.0 python-poppler-qt5-21.3.0/poppler-text-box.sip0000644000175000017500000000066212472120505021216 0ustar00wilbertwilbertnamespace Poppler { class TextBox { %TypeHeaderCode #include %End public: TextBox(const QString& text, const QRectF &bBox); ~TextBox(); QString text() const; QRectF boundingBox() const; Poppler::TextBox *nextWord() const; QRectF charBoundingBox(int i) const; bool hasSpaceAfter() const; private: TextBox(const Poppler::TextBox&); }; // class TextBox }; // namespace Poppler ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1619549615.0 python-poppler-qt5-21.3.0/project.py0000664000175000017500000000634314042056657017307 0ustar00wilbertwilbert"""The build configuration file for Python-Poppler-Qt5, used by sip.""" from os.path import join import re import subprocess from pyqtbuild import PyQtBindings, PyQtProject from sipbuild import Option import PyQt5 class PythonPopplerQt5(PyQtProject): """The Project class.""" def __init__(self): super().__init__() self.bindings_factories = [PopplerQt5Bindings] def update(self, tool): """Allows SIP to find PyQt5 .sip files.""" super().update(tool) self.sip_include_dirs.append(join(PyQt5.__path__[0], 'bindings')) class PopplerQt5Bindings(PyQtBindings): """The Poppler-Qt5 Bindings class.""" def __init__(self, project): super().__init__(project, name='Poppler-Qt5', sip_file='poppler-qt5.sip', qmake_QT=['xml']) def get_options(self): """Our custom options that a user can pass to sip-build.""" options = super().get_options() options.append( Option('poppler_version', help='version of the poppler library', metavar='VERSION')) return options @staticmethod def run_pkg_config(option): output = subprocess.check_output( ['pkg-config', option, 'poppler-qt5'], universal_newlines=True) return output.rstrip() def apply_user_defaults(self, tool): # Set include_dirs, library_dirs and libraries based on pkg-config data cflags = self.run_pkg_config('--cflags-only-I').split() libs = self.run_pkg_config('--libs').split() self.include_dirs.extend( flag[2:] for flag in cflags if flag.startswith('-I')) self.library_dirs.extend( flag[2:] for flag in libs if flag.startswith('-L')) self.libraries.extend( flag[2:] for flag in libs if flag.startswith('-l')) # Generate version.sip file if self.poppler_version is not None: poppler_qt5_version = self.poppler_version else: poppler_qt5_version = self.run_pkg_config('--modversion') poppler_qt5_version = tuple(map(int, poppler_qt5_version.split('.'))) python_poppler_qt5_version = self.project.version_str.split('.') format_dict = { 'vlen': 'i' * len(python_poppler_qt5_version), 'vargs': ', '.join(python_poppler_qt5_version), 'pvlen': 'i' * len(poppler_qt5_version), 'pvargs': ', '.join(map(str, poppler_qt5_version)), } with open('version.sip.in') as template_file: version_sip_template = template_file.read() with open('version.sip', 'w') as version_file: version_file.write(version_sip_template.format(**format_dict)) # Add Poppler version tag if poppler_qt5_version: with open('timeline.sip') as timeline_file: timeline = timeline_file.read() for match in re.finditer(r'POPPLER_V(\d+)_(\d+)_(\d+)', timeline): if poppler_qt5_version < tuple(map(int, match.group(1, 2, 3))): break tag = match.group() else: tag = 'POPPLER_V0_20_0' self.tags.append(tag) super().apply_user_defaults(tool) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1614873994.0 python-poppler-qt5-21.3.0/pyproject.toml0000664000175000017500000000176314020202612020160 0ustar00wilbertwilbert[build-system] requires = ["sip >=5", "PyQt-builder", "PyQt5"] build-backend = "sipbuild.api" [tool.sip.metadata] name = "python-poppler-qt5" version = "21.3.0" summary = "A Python binding to Poppler-Qt5" description-file = "README.rst" home-page = "https://github.com/frescobaldi/python-poppler-qt5" maintainer = "Wilbert Berendsen" maintainer-email = "wbsoft@xs4all.nl" license = "LGPL" classifier = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", "Programming Language :: Python :: 3", "Topic :: Multimedia :: Graphics :: Viewers" ] requires-dist = "PyQt5" [tool.sip.project] sip-files-dir = "." sdist-excludes = [ "version.sip", ".git/*", ".git/*/*", ".git/*/*/*", ".git/*/*/*/*", ".git/*/*/*/*/*", ".git/*/*/*/*/*/*", ".git/*/*/*/*/*/*/*" ] ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1651726107.0315058 python-poppler-qt5-21.3.0/python_poppler_qt5.egg-info/0000775000175000017500000000000014234653433022624 5ustar00wilbertwilbert././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1651726106.0 python-poppler-qt5-21.3.0/python_poppler_qt5.egg-info/PKG-INFO0000644000175000017500000000620414234653432023720 0ustar00wilbertwilbertMetadata-Version: 2.1 Name: python-poppler-qt5 Version: 21.3.0 Summary: A Python binding to Poppler-Qt5 Home-page: https://github.com/frescobaldi/python-poppler-qt5 Maintainer: Wilbert Berendsen Maintainer-email: wbsoft@xs4all.nl License: LGPL Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL) Classifier: Operating System :: MacOS :: MacOS X Classifier: Operating System :: Microsoft :: Windows Classifier: Operating System :: POSIX Classifier: Programming Language :: Python :: 3 Classifier: Topic :: Multimedia :: Graphics :: Viewers License-File: LICENSE ================== python-poppler-qt5 ================== A Python binding for libpoppler-qt5 that aims for completeness and for being actively maintained. Created and maintained by Wilbert Berendsen , with help of other contributors, especially where it concerns supporting many platforms and build systems. Thanks for everyone's help! Homepage: https://pypi.python.org/pypi/python-poppler-qt5/ Usage:: import popplerqt5 d = popplerqt5.Poppler.Document.load('file.pdf') Documentation ------------- The Python API closely follows the Poppler Qt5 C++ interface library API, documented at https://poppler.freedesktop.org/api/qt5/ . Note: Releases of PyQt5 < 5.4 currently do not support the QtXml module, all methods that use the QDomDocument, QDomElement and QDomNode types are disabled. This concerns the ``Document::toc()`` method and some constructors and the ``store()`` methods in the ``Annotation`` subclasses. So, using PyQt5 >= 5.4 is recommended. Wherever the C++ API requires ``QList``, ``QSet`` or ``QLinkedList``, any Python sequence can be used. API calls that return ``QList``, ``QSet`` or ``QLinkedList`` all return Python lists. There are a few other differences: ``Poppler::Document::getPdfVersion(int *major, int *minor)`` can simply be called as ``d.getPdfVersion()``, (where ``d`` is a ``Poppler::Document`` instance); it will return a tuple of two integers (major, minor). ``Poppler::Document`` has ``__len__`` and ``__getitem__`` methods, corresponding to ``numPages()`` and ``page(int num)``. ``Poppler::FontIterator`` (returned by ``Poppler::Document::newFontIterator``) is also a Python iterable (e.g. has ``__iter__()`` and ``__next__()`` methods). So although you can use:: it = document.newFontIterator() while it.hasNext(): fonts = it.next() # list of FontInfo objects ... you can also use the more Pythonic:: for fonts in document.newFontIterator(): ... In addition to the Poppler namespace, there are two toplevel module functions: ``popplerqt5.version()`` returns the version of the ``python-poppler-qt5`` package as a tuple of ints, e.g. ``(0, 18, 2)``. ``popplerqt5.poppler_version()`` returns the version of the linked Poppler-Qt5 library as a tuple of ints, e.g. ``(0, 24, 5)``. This is determined at build time. If at build time the Poppler-Qt5 version could not be determined and was not specified, an empty tuple might be returned. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1651726106.0 python-poppler-qt5-21.3.0/python_poppler_qt5.egg-info/SOURCES.txt0000644000175000017500000000132414234653432024505 0ustar00wilbertwilbertChangeLog INSTALL LICENSE MANIFEST.in README.rst TODO poppler-annotation.sip poppler-convert.sip poppler-document.sip poppler-embedded-file.sip poppler-font-info.sip poppler-font-iterator.sip poppler-form.sip poppler-link-destination.sip poppler-link.sip poppler-media.sip poppler-movie-object.sip poppler-opt-content-model.sip poppler-page-transition.sip poppler-page.sip poppler-qt5.sip poppler-sound-object.sip poppler-text-box.sip project.py pyproject.toml setup.cfg setup.py timeline.sip types.sip version.sip.in demo/demo.py demo/merge-annotations.py python_poppler_qt5.egg-info/PKG-INFO python_poppler_qt5.egg-info/SOURCES.txt python_poppler_qt5.egg-info/dependency_links.txt python_poppler_qt5.egg-info/top_level.txt././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1651726106.0 python-poppler-qt5-21.3.0/python_poppler_qt5.egg-info/dependency_links.txt0000644000175000017500000000000114234653432026667 0ustar00wilbertwilbert ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1651726106.0 python-poppler-qt5-21.3.0/python_poppler_qt5.egg-info/top_level.txt0000644000175000017500000000001314234653432025345 0ustar00wilbertwilbertpopplerqt5 ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1651726107.0315058 python-poppler-qt5-21.3.0/setup.cfg0000664000175000017500000000010214234653433017071 0ustar00wilbertwilbert[sdist] force-manifest = 1 [egg_info] tag_build = tag_date = 0 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1614873988.0 python-poppler-qt5-21.3.0/setup.py0000664000175000017500000003141214020202604016751 0ustar00wilbertwilbert#! python project = dict( name = 'python-poppler-qt5', version = '21.3.0', description = 'A Python binding to Poppler-Qt5', long_description = ( 'A Python binding to Poppler-Qt5 that aims for ' 'completeness and for being actively maintained. ' 'Using this module you can access the contents of PDF files ' 'inside PyQt5 applications.' ), maintainer = 'Wilbert Berendsen', maintainer_email = 'wbsoft@xs4all.nl', url = 'https://github.com/frescobaldi/python-poppler-qt5', license = 'LGPL', classifiers = [ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)', 'Operating System :: MacOS :: MacOS X', 'Operating System :: Microsoft :: Windows', 'Operating System :: POSIX', 'Programming Language :: Python :: 3', 'Topic :: Multimedia :: Graphics :: Viewers', ], cmdclass={} ) import os import re import shlex import subprocess import sys import platform try: from setuptools import setup, Extension except ImportError: from distutils.core import setup, Extension import sipdistutils ### this circumvents a bug in sip < 4.14.2, where the file() builtin is used ### instead of open() try: import builtins try: builtins.file except AttributeError: builtins.file = open except ImportError: pass ### end def check_qtxml(): """Return True if PyQt5.QtXml can be imported. in some early releases of PyQt5, QtXml was missing because it was thought QtXml was deprecated. """ import PyQt5 try: import PyQt5.QtXml except ImportError: return False return True def pkg_config(package, attrs=None, include_only=False): """parse the output of pkg-config for a package. returns the given or a new dictionary with one or more of these keys 'include_dirs', 'library_dirs', 'libraries'. Every key is a list of paths, so that it can be used with distutils Extension objects. """ if attrs is None: attrs = {} cmd = ['pkg-config'] if include_only: cmd += ['--cflags-only-I'] else: cmd += ['--cflags', '--libs'] cmd.append(package) try: output = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0] except OSError: return attrs flag_map = {'-I': 'include_dirs', '-L': 'library_dirs', '-l': 'libraries'} # for python3 turn bytes back to string if sys.version_info[0] > 2: output = output.decode('utf-8') for flag in shlex.split(output): option, path = flag[:2], flag[2:] if option in flag_map: l = attrs.setdefault(flag_map[option], []) if path not in l: l.append(path) return attrs def pkg_config_version(package): """Returns the version of the given package as a tuple of ints.""" cmd = ['pkg-config', '--modversion', package] try: output = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0] # for python3 turn bytes back to string if sys.version_info[0] > 2: output = output.decode('utf-8') return tuple(map(int, re.findall(r'\d+', output))) except OSError: sys.stderr.write("Can't determine version of %s\n" % package) ext_args = {} ext_args['extra_compile_args'] = ['-std=c++11'] pkg_config('poppler-qt5', ext_args) if 'libraries' not in ext_args: ext_args['libraries'] = ['poppler-qt5'] # hack to provide our options to sip on its invocation: build_ext_base = sipdistutils.build_ext class build_ext(build_ext_base): description = "Builds the popplerqt5 module." user_options = build_ext_base.user_options + [ ('poppler-version=', None, "version of the poppler library"), ('qmake-bin=', None, "Path to qmake binary"), ('sip-bin=', None, "Path to sip binary"), ('qt-include-dir=', None, "Path to Qt headers"), ('pyqt-sip-dir=', None, "Path to PyQt's SIP files"), ('pyqt-sip-flags=', None, "SIP flags used to generate PyQt bindings") ] def initialize_options (self): build_ext_base.initialize_options(self) self.poppler_version = None self.qmake_bin = 'qmake' self.sip_bin = None self.qt_include_dir = None self.pyqt_sip_dir = None self.pyqt_sip_flags = None def finalize_options (self): build_ext_base.finalize_options(self) if not self.qt_include_dir: self.qt_include_dir = self.__find_qt_include_dir() if not self.pyqt_sip_dir: self.pyqt_sip_dir = self.__find_pyqt_sip_dir() if not self.pyqt_sip_flags: self.pyqt_sip_flags = self.__find_pyqt_sip_flags() if not self.qt_include_dir: raise SystemExit('Could not find Qt5 headers. ' 'Please specify via --qt-include-dir=') if not self.pyqt_sip_dir: raise SystemExit('Could not find PyQt SIP files. ' 'Please specify containing directory via ' '--pyqt-sip-dir=') if not self.pyqt_sip_flags: raise SystemExit('Could not find PyQt SIP flags. ' 'Please specify via --pyqt-sip-flags=') self.include_dirs += (self.qt_include_dir, os.path.join(self.qt_include_dir, 'QtCore'), os.path.join(self.qt_include_dir, 'QtGui'), os.path.join(self.qt_include_dir, 'QtXml')) if self.poppler_version is not None: self.poppler_version = tuple(map(int, re.findall(r'\d+', self.poppler_version))) def __find_qt_include_dir(self): if self.pyqtconfig: return self.pyqtconfig.qt_inc_dir try: qt_version = subprocess.check_output([self.qmake_bin, '-query', 'QT_VERSION']) qt_version = qt_version.strip().decode("ascii") except (OSError, subprocess.CalledProcessError) as e: raise SystemExit('Failed to determine Qt version (%s).' % e) if not qt_version.startswith("5."): raise SystemExit('Unsupported Qt version (%s). ' 'Try specifying the path to qmake manually via ' '--qmake-bin=' % qt_version) try: result = subprocess.check_output([self.qmake_bin, '-query', 'QT_INSTALL_HEADERS']) return result.strip().decode(sys.getfilesystemencoding()) except (OSError, subprocess.CalledProcessError) as e: raise SystemExit('Failed to determine location of Qt headers (%s).' % e) def __find_pyqt_sip_dir(self): if self.pyqtconfig: return self.pyqtconfig.pyqt_sip_dir import sipconfig return os.path.join(sipconfig.Configuration().default_sip_dir, 'PyQt5') def __find_pyqt_sip_flags(self): if self.pyqtconfig: return self.pyqtconfig.pyqt_sip_flags from PyQt5 import QtCore return QtCore.PYQT_CONFIGURATION.get('sip_flags', '') @property def pyqtconfig(self): if not hasattr(self, '_pyqtconfig'): try: from PyQt5 import pyqtconfig self._pyqtconfig = pyqtconfig.Configuration() except ImportError: self._pyqtconfig = None return self._pyqtconfig def write_version_sip(self, poppler_qt5_version, python_poppler_qt5_version): """Write a version.sip file. The file contains code to make version information accessible from the popplerqt5 Python module. """ with open('version.sip', 'w') as f: f.write(version_sip_template.format( vlen = 'i' * len(python_poppler_qt5_version), vargs = ', '.join(map(format, python_poppler_qt5_version)), pvlen = 'i' * len(poppler_qt5_version), pvargs = ', '.join(map(format, poppler_qt5_version)))) def _find_sip(self): """override _find_sip to allow for manually speficied sip path.""" return self.sip_bin or build_ext_base._find_sip(self) def _sip_compile(self, sip_bin, source, sbf): # First check manually specified poppler version ver = self.poppler_version or pkg_config_version('poppler-qt5') or () # our own version: version = tuple(map(int, re.findall(r'\d+', project['version']))) # make those accessible from the popplerqt5 module: self.write_version_sip(ver, version) # Disable features if older poppler-qt5 version is found. # See the defined tags in %Timeline{} in timeline.sip. tag = 'POPPLER_V0_20_0' if ver: with open("timeline.sip", "r") as f: for m in re.finditer(r'POPPLER_V(\d+)_(\d+)_(\d+)', f.read()): if ver < tuple(map(int, m.group(1, 2, 3))): break tag = m.group() cmd = [sip_bin] if hasattr(self, 'sip_opts'): cmd += self.sip_opts if hasattr(self, '_sip_sipfiles_dir'): cmd += ['-I', self._sip_sipfiles_dir()] if tag: cmd += ['-t', tag] if not check_qtxml(): cmd += ["-x", "QTXML_AVAILABLE"] # mark QtXml not supported cmd += [ "-c", self.build_temp, "-b", sbf, "-I", self.pyqt_sip_dir] # find the PyQt5 stuff cmd += shlex.split(self.pyqt_sip_flags) # use same SIP flags as for PyQt5 cmd.append(source) self.spawn(cmd) if platform.system() == 'Windows': # Enforce libraries to link against on Windows ext_args['libraries'] = ['poppler-qt5', 'Qt5Core', 'Qt5Gui', 'Qt5Xml'] class bdist_support(): def __find_poppler_dll(self): paths = os.environ['PATH'].split(";") poppler_dll = None for path in paths: dll_path_candidate = os.path.join(path, "poppler-qt5.dll") if os.path.exists(dll_path_candidate): return dll_path_candidate return None def _copy_poppler_dll(self): poppler_dll = self.__find_poppler_dll() if poppler_dll is None: self.warn("Could not find poppler-qt5.dll in any of the folders listed in the PATH environment variable.") return False self.mkpath(self.bdist_dir) self.copy_file(poppler_dll, os.path.join(self.bdist_dir, "python-poppler5.dll")) return True import distutils.command.bdist_msi class bdist_msi(distutils.command.bdist_msi.bdist_msi, bdist_support): def run(self): if not self._copy_poppler_dll(): return distutils.command.bdist_msi.bdist_msi.run(self) project['cmdclass']['bdist_msi'] = bdist_msi import distutils.command.bdist_wininst class bdist_wininst(distutils.command.bdist_wininst.bdist_wininst, bdist_support): def run(self): if not self._copy_poppler_dll(): return distutils.command.bdist_wininst.bdist_wininst.run(self) project['cmdclass']['bdist_wininst'] = bdist_wininst import distutils.command.bdist_dumb class bdist_dumb(distutils.command.bdist_dumb.bdist_dumb, bdist_support): def run(self): if not self._copy_poppler_dll(): return distutils.command.bdist_dumb.bdist_dumb.run(self) project['cmdclass']['bdist_dumb'] = bdist_dumb try: # Attempt to patch bdist_egg if the setuptools/distribute extension is installed import setuptools.command.bdist_egg class bdist_egg(setuptools.command.bdist_egg.bdist_egg, bdist_support): def run(self): if not self._copy_poppler_dll(): return setuptools.command.bdist_egg.bdist_egg.run(self) project['cmdclass']['bdist_egg'] = bdist_egg except ImportError: pass version_sip_template = r"""// Generated by setup.py -- Do not edit PyObject *version(); %Docstring The version of the popplerqt5 python module. %End PyObject *poppler_version(); %Docstring The version of the Poppler library. %End %ModuleCode PyObject *version() {{ return Py_BuildValue("({vlen})", {vargs}); }}; PyObject *poppler_version() {{ return Py_BuildValue("({pvlen})", {pvargs}); }}; %End """ ### use full README.rst as long description with open('README.rst', 'rb') as f: project["long_description"] = f.read().decode('utf-8') project['cmdclass']['build_ext'] = build_ext setup( ext_modules = [Extension("popplerqt5", ["poppler-qt5.sip"], **ext_args)], **project ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1610029956.0 python-poppler-qt5-21.3.0/timeline.sip0000664000175000017500000000063713775615604017617 0ustar00wilbertwilbert%Timeline { POPPLER_V0_20_0 POPPLER_V0_22_0 POPPLER_V0_24_0 POPPLER_V0_24_5 POPPLER_V0_28_0 POPPLER_V0_30_0 POPPLER_V0_31_0 POPPLER_V0_36_0 POPPLER_V0_50_0 POPPLER_V0_51_0 POPPLER_V0_53_0 POPPLER_V0_58_0 POPPLER_V0_60_0 POPPLER_V0_63_0 POPPLER_V0_64_0 POPPLER_V0_74_0 POPPLER_V0_79_0 POPPLER_V0_85_0 POPPLER_V0_87_0 POPPLER_V21_01_0 } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1614873802.0 python-poppler-qt5-21.3.0/types.sip0000664000175000017500000002106414020202312017116 0ustar00wilbertwilbert/* * Various conversions that are not made by PyQt5 default. */ /** * Convert QSet * from any Python sequence and to a Python list. */ %MappedType QSet { %TypeHeaderCode #include %End %ConvertFromTypeCode // Create the list. PyObject *l; if ((l = PyList_New(sipCpp->size())) == NULL) return NULL; // Set the list elements. QSet set = *sipCpp; int i = 0; foreach (Poppler::Document::RenderBackend value, set) { PyObject *obj = PyLong_FromLong ((long) value); if (obj == NULL || PyList_SetItem(l, i, obj) < 0) { Py_DECREF(l); if (obj) Py_DECREF(obj); return NULL; } Py_DECREF(obj); i++; } return l; %End %ConvertToTypeCode // Check the type if that is all that is required. if (sipIsErr == NULL) { if (!PySequence_Check(sipPy)) return 0; return 1; } QSet *qs = new QSet; for (int i = 0; i < PySequence_Size(sipPy); ++i) { Poppler::Document::RenderBackend t = (Poppler::Document::RenderBackend)PyLong_AsLong(PySequence_ITEM (sipPy, i)); *qs << t; } *sipCppPtr = qs; return sipGetState(sipTransferObj); %End }; /** * Convert QLinkedList from any sequence and to a Python list. */ template %MappedType QLinkedList { %TypeHeaderCode #include %End %ConvertFromTypeCode // Create the list. PyObject *l; if ((l = PyList_New(sipCpp->size())) == NULL) return NULL; // Set the list elements. TYPE item; QLinkedList::iterator i; int index = 0; for (i = sipCpp->begin(); i != sipCpp->end(); ++i) { TYPE *t = new TYPE(*i); PyObject *tobj; if ((tobj = sipConvertFromNewType(t, sipType_TYPE, sipTransferObj)) == NULL) { Py_DECREF(l); delete t; return NULL; } PyList_SET_ITEM(l, index, tobj); ++index; } return l; %End %ConvertToTypeCode SIP_SSIZE_T len; // Check the type if that is all that is required. if (sipIsErr == NULL) { if (!PySequence_Check(sipPy) || (len = PySequence_Size(sipPy)) < 0) return 0; for (SIP_SSIZE_T i = 0; i < len; ++i) { PyObject *itm = PySequence_ITEM(sipPy, i); bool ok = (itm && sipCanConvertToType(itm, sipType_TYPE, SIP_NOT_NONE)); Py_XDECREF(itm); if (!ok) return 0; } return 1; } QLinkedList *qll = new QLinkedList; len = PySequence_Size(sipPy); for (SIP_SSIZE_T i = 0; i < len; ++i) { PyObject *itm = PySequence_ITEM(sipPy, i); int state; TYPE *t = reinterpret_cast(sipConvertToType(itm, sipType_TYPE, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr)); Py_DECREF(itm); if (*sipIsErr) { sipReleaseType(t, sipType_TYPE, state); delete qll; return 0; } qll->append(*t); sipReleaseType(t, sipType_TYPE, state); } *sipCppPtr = qll; return sipGetState(sipTransferObj); %End }; /** * Convert QList> */ template %MappedType QList< QLinkedList > { %TypeHeaderCode #include #include %End %ConvertFromTypeCode // Create the list. PyObject *l; if ((l = PyList_New(sipCpp->size())) == NULL) return NULL; const sipTypeDef* qlinkedlist_type = sipFindType("QLinkedList"); // Set the list elements. for (int i = 0; i < sipCpp->size(); ++i) { QLinkedList* t = new QLinkedList(sipCpp->at(i)); PyObject *tobj; if ((tobj = sipConvertFromType(t, qlinkedlist_type, sipTransferObj)) == NULL) { Py_DECREF(l); delete t; return NULL; } PyList_SET_ITEM(l, i, tobj); } return l; %End %ConvertToTypeCode const sipTypeDef* qlinkedlist_type = sipFindType("QLinkedList"); // Check the type if that is all that is required. if (sipIsErr == NULL) { if (!PySequence_Check(sipPy)) return 0; for (int i = 0; i < PySequence_Size(sipPy); ++i) if (!sipCanConvertToType(PySequence_ITEM(sipPy, i), qlinkedlist_type, SIP_NOT_NONE)) return 0; return 1; } QList< QLinkedList > *ql = new QList< QLinkedList >; for (int i = 0; i < PySequence_Size(sipPy); ++i) { int state; QLinkedList * t = reinterpret_cast< QLinkedList * >(sipConvertToType(PySequence_ITEM(sipPy, i), qlinkedlist_type, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr)); if (*sipIsErr) { sipReleaseType(t, qlinkedlist_type, state); delete ql; return 0; } ql->append(*t); sipReleaseType(t, qlinkedlist_type, state); } *sipCppPtr = ql; return sipGetState(sipTransferObj); %End }; /** * Convert time_t to and from long integer */ %MappedType time_t { %TypeHeaderCode #include %End %ConvertFromTypeCode PyObject* pTime; pTime = PyLong_FromLong(*sipCpp); return pTime; %End %ConvertToTypeCode if (sipIsErr == NULL) { return PyLong_Check(sipPy); } if (sipPy == Py_None) { *sipCppPtr = new time_t(); return 1; } if (PyLong_Check(sipPy)) { *sipCppPtr = new time_t(PyLong_AsLong(sipPy)); return 1; } return 0; %End }; /** * Convert to and from QList */ %MappedType QList { %TypeHeaderCode #include %End %ConvertFromTypeCode // Create the list. PyObject *l; if ((l = PyList_New(sipCpp->size())) == NULL) return NULL; // Set the list elements. QList::iterator it = sipCpp->begin(); for (int i = 0; it != sipCpp->end(); ++it, ++i) { PyObject *tobj; if ((tobj = PyLong_FromLongLong(*it)) == NULL) { Py_DECREF(l); return NULL; } PyList_SET_ITEM(l, i, tobj); } return l; %End %ConvertToTypeCode // Check the type if that is all that is required. if (sipIsErr == NULL) return PyList_Check(sipPy); QList *qlist = new QList; for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) { *qlist << PyLong_AsLongLong(PyList_GET_ITEM(sipPy, i)); } *sipCppPtr = qlist; return sipGetState(sipTransferObj); %End }; /** * Convert QVector< QPair > * from and to a Python list of a 2-item tuple */ template %MappedType QVector< QPair > { %TypeHeaderCode #include #include %End %ConvertFromTypeCode // Create the list. PyObject *l; if ((l = PyList_New(sipCpp->size())) == NULL) return NULL; // Set the list elements. for (int i = 0; i < sipCpp->size(); ++i) { QPair* p = new QPair(sipCpp->at(i)); PyObject *ptuple = PyTuple_New(2); PyObject *pfirst; PyObject *psecond; TYPE *sfirst = new TYPE(p->first); if ((pfirst = sipConvertFromType(sfirst, sipType_TYPE, sipTransferObj)) == NULL) { Py_DECREF(l); Py_DECREF(ptuple); return NULL; } PyTuple_SET_ITEM(ptuple, 0, pfirst); TYPE *ssecond = new TYPE(p->second); if ((psecond = sipConvertFromType(ssecond, sipType_TYPE, sipTransferObj)) == NULL) { Py_DECREF(l); Py_DECREF(ptuple); Py_DECREF(pfirst); return NULL; } PyTuple_SET_ITEM(ptuple, 1, psecond); PyList_SET_ITEM(l, i, ptuple); } return l; %End %ConvertToTypeCode const sipTypeDef* qpair_type = sipFindType("QPair"); // Check the type if that is all that is required. if (sipIsErr == NULL) { if (!PySequence_Check(sipPy)) return 0; for (int i = 0; i < PySequence_Size(sipPy); ++i) if (!sipCanConvertToType(PySequence_ITEM(sipPy, i), qpair_type, SIP_NOT_NONE)) return 0; return 1; } QVector< QPair > *qv = new QVector< QPair >; for (int i = 0; i < PySequence_Size(sipPy); ++i) { int state; QPair * p = reinterpret_cast< QPair * >(sipConvertToType(PySequence_ITEM(sipPy, i), qpair_type, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr)); if (*sipIsErr) { sipReleaseType(p, qpair_type, state); delete qv; return 0; } qv->append(*p); sipReleaseType(p, qpair_type, state); } *sipCppPtr = qv; return sipGetState(sipTransferObj); %End }; /* kate: indent-width 4; space-indent on; hl c++; indent-mode cstyle; */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1610020827.0 python-poppler-qt5-21.3.0/version.sip.in0000664000175000017500000000061413775573733020104 0ustar00wilbertwilbert// Generated by project.py -- Do not edit PyObject *version(); %Docstring The version of the popplerqt5 python module. %End PyObject *poppler_version(); %Docstring The version of the Poppler library it was built with. %End %ModuleCode PyObject *version() {{ return Py_BuildValue("({vlen})", {vargs}); }}; PyObject *poppler_version() {{ return Py_BuildValue("({pvlen})", {pvargs}); }}; %End