diff --git a/runtests.py b/runtests.py index 7c46bf0..c93b6bb 100755 --- a/runtests.py +++ b/runtests.py @@ -65,14 +65,14 @@ # and cleaner though, at the expense of more limited functionality. # -import re +import getopt import os +import re import sys import time +import traceback import types -import getopt import unittest -import traceback try: # Python >=2.7 and >=3.2 @@ -92,37 +92,37 @@ class Options: """Configurable properties of the test runner.""" # test location - basedir = '' # base directory for tests (defaults to + basedir = "" # base directory for tests (defaults to # basedir of argv[0] + 'src'), must be absolute - follow_symlinks = True # should symlinks to subdirectories be + follow_symlinks = True # should symlinks to subdirectories be # followed? (hardcoded, may cause loops) # which tests to run - unit_tests = False # unit tests (default if both are false) - functional_tests = False # functional tests + unit_tests = False # unit tests (default if both are false) + functional_tests = False # functional tests # test filtering - level = 1 # run only tests at this or lower level + level = 1 # run only tests at this or lower level # (if None, runs all tests) - pathname_regex = '' # regexp for filtering filenames - test_regex = '' # regexp for filtering test cases + pathname_regex = "" # regexp for filtering filenames + test_regex = "" # regexp for filtering test cases # actions to take - list_files = False # --list-files - list_tests = False # --list-tests - list_hooks = False # --list-hooks - run_tests = True # run tests (disabled by --list-foo) + list_files = False # --list-files + list_tests = False # --list-tests + list_hooks = False # --list-hooks + run_tests = True # run tests (disabled by --list-foo) # output verbosity - verbosity = 0 # verbosity level (-v) - quiet = 0 # do not print anything on success (-q) - warn_omitted = False # produce warnings when a test case is + verbosity = 0 # verbosity level (-v) + quiet = 0 # do not print anything on success (-q) + warn_omitted = False # produce warnings when a test case is # not included in a test suite (-w) - progress = False # show running progress (-p) - coverage = False # produce coverage reports (--coverage) - coverdir = 'coverage' # where to put them (currently hardcoded) - immediate_errors = False # show tracebacks twice (currently hardcoded) - screen_width = 80 # screen width (autodetected) + progress = False # show running progress (-p) + coverage = False # produce coverage reports (--coverage) + coverdir = "coverage" # where to put them (currently hardcoded) + immediate_errors = False # show tracebacks twice (currently hardcoded) + screen_width = 80 # screen width (autodetected) def compile_matcher(regex): @@ -134,9 +134,9 @@ def compile_matcher(regex): """ if not regex: return lambda x: True - elif regex == '!': + elif regex == "!": return lambda x: False - elif regex.startswith('!'): + elif regex.startswith("!"): rx = re.compile(regex[1:]) return lambda x: rx.search(x) is None else: @@ -154,7 +154,7 @@ def walk_with_symlinks(top, func, arg): except os.error: return func(arg, top, names) - exceptions = ('.', '..') + exceptions = (".", "..") for name in names: if name not in exceptions: name = os.path.join(top, name) @@ -168,27 +168,28 @@ def get_test_files(cfg): results = [] test_names = [] if cfg.unit_tests: - test_names.append('tests') + test_names.append("tests") if cfg.functional_tests: - test_names.append('ftests') + test_names.append("ftests") baselen = len(cfg.basedir) + 1 def visit(ignored, dir, files): if os.path.basename(dir) not in test_names: for name in test_names: - if name + '.py' in files: - path = os.path.join(dir, name + '.py') + if name + ".py" in files: + path = os.path.join(dir, name + ".py") if matcher(path[baselen:]): results.append(path) return - if '__init__.py' not in files: + if "__init__.py" not in files: stderr("%s is not a package" % dir) return for file in files: - if file.startswith('test') and file.endswith('.py'): + if file.startswith("test") and file.endswith(".py"): path = os.path.join(dir, file) if matcher(path[baselen:]): results.append(path) + if cfg.follow_symlinks: walker = walk_with_symlinks else: @@ -201,9 +202,9 @@ def visit(ignored, dir, files): def import_module(filename, cfg, cov=None): """Imports and returns a module.""" filename = os.path.splitext(filename)[0] - modname = filename[len(cfg.basedir):].replace(os.path.sep, '.') + modname = filename[len(cfg.basedir) :].replace(os.path.sep, ".") - if modname.startswith('.'): + if modname.startswith("."): modname = modname[1:] if cov is not None: @@ -214,15 +215,26 @@ def import_module(filename, cfg, cov=None): except ImportError: # get the dir where 'tests'/'ftests' are located. parent_path = os.sep.join(filename.split(os.sep)[:-2]) + + old_path = sys.path[:] + # remove basedir so that inplace module is not imported + sys.path.remove(cfg.basedir) + # move parent_path to front + if parent_path in sys.path: + idx = sys.path.index(parent_path) + sys.path = [parent_path,] + sys.path[:idx] + sys.path[idx + 1 :] + else: + sys.path.insert(0, parent_path) # get the module name like 'tests.demo_test' - modname = '.'.join(filename.split(os.sep)[-2:]) - sys.path.reverse() - sys.path.insert(0, parent_path) + modname = ".".join(filename.split(os.sep)[-2:]) mod = __import__(modname) - + # restore sys.path + sys.path = old_path + # + del sys.modules["tests"] if cov is not None: cov.stop() - components = modname.split('.') + components = modname.split(".") for comp in components[1:]: mod = getattr(mod, comp) return mod @@ -231,10 +243,10 @@ def import_module(filename, cfg, cov=None): def filter_testsuite(suite, matcher, level=None): """Returns a flattened list of test cases that match the given matcher.""" if not isinstance(suite, unittest.TestSuite): - raise TypeError('not a TestSuite', suite) + raise TypeError("not a TestSuite", suite) results = [] for test in suite._tests: - if level is not None and getattr(test, 'level', 0) > level: + if level is not None and getattr(test, "level", 0) > level: continue if isinstance(test, unittest.TestCase): testname = test.id() # package.module.class.method @@ -250,11 +262,12 @@ def get_all_test_cases(module): """Returns a list of all test case classes defined in a given module.""" results = [] for name in dir(module): - if not name.startswith('Test'): + if not name.startswith("Test"): continue item = getattr(module, name) - if (isinstance(item, (type, types.ClassType)) and - issubclass(item, unittest.TestCase)): + if isinstance(item, (type, types.ClassType)) and issubclass( + item, unittest.TestCase + ): results.append(item) return results @@ -262,7 +275,7 @@ def get_all_test_cases(module): def get_test_classes_from_testsuite(suite): """Returns a set of test case classes used in a test suite.""" if not isinstance(suite, unittest.TestSuite): - raise TypeError('not a TestSuite', suite) + raise TypeError("not a TestSuite", suite) results = set() for test in suite._tests: if isinstance(test, unittest.TestCase): @@ -293,10 +306,11 @@ def get_test_cases(test_files, cfg, cov=None): for test_class in difference: # surround the warning with blank lines, otherwise it tends # to get lost in the noise - stderr("\n%s: WARNING: %s not in test suite\n" - % (file, test_class.__name__)) - if (cfg.level is not None and - getattr(test_suite, 'level', 0) > cfg.level): + stderr( + "\n%s: WARNING: %s not in test suite\n" + % (file, test_class.__name__) + ) + if cfg.level is not None and getattr(test_suite, "level", 0) > cfg.level: continue filtered = filter_testsuite(test_suite, matcher, cfg.level) results.extend(filtered) @@ -308,14 +322,14 @@ def get_test_hooks(test_files, cfg, cov=None): results = [] dirs = set(map(os.path.dirname, test_files)) for dir in list(dirs): - if os.path.basename(dir) == 'ftests': - dirs.add(os.path.join(os.path.dirname(dir), 'tests')) + if os.path.basename(dir) == "ftests": + dirs.add(os.path.join(os.path.dirname(dir), "tests")) dirs = list(dirs) dirs.sort() for dir in dirs: - filename = os.path.join(dir, 'checks.py') + filename = os.path.join(dir, "checks.py") if os.path.exists(filename): - module = import_module(filename, cfg, tracer=tracer) + module = import_module(filename, cfg) if cov is not None: cov.start() hooks = module.test_hooks() @@ -356,8 +370,9 @@ def startTest(self, test): n = self.testsRun + 1 self.stream.write("\r%4d" % n) if self.count: - self.stream.write("/%d (%5.1f%%)" - % (self.count, n * 100.0 / self.count)) + self.stream.write( + "/%d (%5.1f%%)" % (self.count, n * 100.0 / self.count) + ) if self.showAll: # self.cfg.verbosity == 1 self.stream.write(": ") elif self.cfg.verbosity: @@ -386,9 +401,9 @@ def getShortDescription(self, test): # limit case is 'testname (...)' pos = s.find(" (") if pos + len(" (...)") > self._maxWidth: - s = s[:self._maxWidth - 3] + "..." + s = s[: self._maxWidth - 3] + "..." else: - s = "%s...%s" % (s[:pos + 2], s[pos + 5 - self._maxWidth:]) + s = "%s...%s" % (s[: pos + 2], s[pos + 5 - self._maxWidth :]) return s def printErrors(self): @@ -447,8 +462,9 @@ def run(self, test): run = result.testsRun if not self.cfg.quiet: self.stream.writeln(result.separator2) - self.stream.writeln("Ran %d test%s in %.3fs" % - (run, run != 1 and "s" or "", timeTaken)) + self.stream.writeln( + "Ran %d test%s in %.3fs" % (run, run != 1 and "s" or "", timeTaken) + ) self.stream.writeln() if not result.wasSuccessful(): self.stream.write("FAILED (") @@ -465,9 +481,14 @@ def run(self, test): return result def _makeResult(self): - return CustomTestResult(self.stream, self.descriptions, self.verbosity, - cfg=self.cfg, count=self.count, - hooks=self.hooks) + return CustomTestResult( + self.stream, + self.descriptions, + self.verbosity, + cfg=self.cfg, + count=self.count, + hooks=self.hooks, + ) def main(argv): @@ -475,14 +496,14 @@ def main(argv): # Environment if sys.version_info < (2, 7): - stderr('%s: need Python 2.7 or later' % argv[0]) - stderr('your python is %s' % sys.version) + stderr("%s: need Python 2.7 or later" % argv[0]) + stderr("your python is %s" % sys.version) return 1 # Defaults cfg = Options() - cfg.basedir = os.path.join(os.path.dirname(argv[0]), 'src') - cfg.basedir = os.path.abspath(cfg.basedir) + # cfg.basedir = os.path.join(os.path.dirname(argv[0]), "src") + cfg.basedir = os.path.abspath(os.path.dirname(argv[0])) # Figure out terminal size try: @@ -492,7 +513,7 @@ def main(argv): else: try: curses.setupterm() - cols = curses.tigetnum('cols') + cols = curses.tigetnum("cols") if cols > 0: cfg.screen_width = cols except (curses.error, TypeError): @@ -500,60 +521,62 @@ def main(argv): pass # Option processing - opts, args = getopt.gnu_getopt(argv[1:], 'hvpqufw', - ['list-files', 'list-tests', 'list-hooks', - 'level=', 'all-levels', 'coverage']) + opts, args = getopt.gnu_getopt( + argv[1:], + "hvpqufw", + ["list-files", "list-tests", "list-hooks", "level=", "all-levels", "coverage"], + ) for k, v in opts: - if k == '-h': + if k == "-h": print(__doc__) return 0 - elif k == '-v': + elif k == "-v": cfg.verbosity += 1 cfg.quiet = False - elif k == '-p': + elif k == "-p": cfg.progress = True cfg.quiet = False - elif k == '-q': + elif k == "-q": cfg.verbosity = 0 cfg.progress = False cfg.quiet = True - elif k == '-u': + elif k == "-u": cfg.unit_tests = True - elif k == '-f': + elif k == "-f": cfg.functional_tests = True - elif k == '-w': + elif k == "-w": cfg.warn_omitted = True - elif k == '--list-files': + elif k == "--list-files": cfg.list_files = True cfg.run_tests = False - elif k == '--list-tests': + elif k == "--list-tests": cfg.list_tests = True cfg.run_tests = False - elif k == '--list-hooks': + elif k == "--list-hooks": cfg.list_hooks = True cfg.run_tests = False - elif k == '--coverage': + elif k == "--coverage": cfg.coverage = True - elif k == '--level': + elif k == "--level": try: cfg.level = int(v) except ValueError: - stderr('%s: invalid level: %s' % (argv[0], v)) - stderr('run %s -h for help') + stderr("%s: invalid level: %s" % (argv[0], v)) + stderr("run %s -h for help") return 1 - elif k == '--all-levels': + elif k == "--all-levels": cfg.level = None else: - stderr('%s: invalid option: %s' % (argv[0], k)) - stderr('run %s -h for help') + stderr("%s: invalid option: %s" % (argv[0], k)) + stderr("run %s -h for help") return 1 if args: cfg.pathname_regex = args[0] if len(args) > 1: cfg.test_regex = args[1] if len(args) > 2: - stderr('%s: too many arguments: %s' % (argv[0], args[2])) - stderr('run %s -h for help') + stderr("%s: too many arguments: %s" % (argv[0], args[2])) + stderr("run %s -h for help") return 1 if not cfg.unit_tests and not cfg.functional_tests: cfg.unit_tests = True @@ -566,9 +589,11 @@ def main(argv): cov = None if cfg.run_tests and cfg.coverage: from coverage import coverage + # load the coverage file from same directory - cov_cfg = os.path.join(os.path.dirname( - os.path.realpath(__file__)), '.coveragerc') + cov_cfg = os.path.join( + os.path.dirname(os.path.realpath(__file__)), ".coveragerc" + ) if not os.path.isfile(cov_cfg): cov_cfg = None cov = coverage(config_file=cov_cfg) @@ -576,22 +601,6 @@ def main(argv): # Finding and importing test_files = get_test_files(cfg) - # Determine whether using inpace module or from site-packages - try: - filename = os.path.splitext(test_files[0])[0] - modname = filename[len(cfg.basedir):].replace(os.path.sep, '.') - if modname.startswith('.'): - modname = modname[1:] - mod = __import__(modname) - except ImportError: - if cfg.verbosity: - print("Using package from site-packages.") - else: - if cfg.verbosity: - print("Using inplace built. {mpath}".format(mpath=mod.__file__)) - del mod - del sys.modules[modname] - if cov is not None: cov.start() if cfg.list_tests or cfg.run_tests: @@ -601,6 +610,7 @@ def main(argv): # Configure the logging module import logging + logging.basicConfig() logging.root.setLevel(logging.CRITICAL) @@ -626,11 +636,11 @@ def main(argv): del run_result if cov is not None: - traced_file_types = ('.py', '.pyx', '.pxi', '.pxd') + traced_file_types = (".py", ".pyx", ".pxi", ".pxd") modules = [] def add_file(_, path, files): - if 'tests' in os.path.relpath(path, cfg.basedir).split(os.sep): + if "tests" in os.path.relpath(path, cfg.basedir).split(os.sep): return for filename in files: if filename.endswith(traced_file_types): @@ -643,7 +653,7 @@ def add_file(_, path, files): walker(os.path.abspath(cfg.basedir), add_file, None) try: - cov.xml_report(modules, outfile='coverage.xml') + cov.xml_report(modules, outfile="coverage.xml") if cfg.coverdir: cov.html_report(modules, directory=cfg.coverdir) finally: @@ -657,6 +667,6 @@ def add_file(_, path, files): return 1 -if __name__ == '__main__': +if __name__ == "__main__": exitcode = main(sys.argv) sys.exit(exitcode) diff --git a/src/pyxpdf/xpdf.cpp b/src/pyxpdf/xpdf.cpp index 1f4fa54..2ec3123 100644 --- a/src/pyxpdf/xpdf.cpp +++ b/src/pyxpdf/xpdf.cpp @@ -1,4 +1,4 @@ -/* Generated by Cython 0.29.19 */ +/* Generated by Cython 0.29.21 */ /* BEGIN: Cython Metadata { @@ -105,7 +105,56 @@ "src/pyxpdf/textoutput.pxi" ], "extra_compile_args": [ - "-O0" + "-g", + "-O3", + "-feliminate-unused-debug-types", + "-pipe", + "-Wall", + "-Wp,-D_FORTIFY_SOURCE=2", + "-fexceptions", + "-fstack-protector", + "--param=ssp-buffer-size=32", + "-Wformat", + "-Wformat-security", + "-Wl,--copy-dt-needed-entries", + "-m64", + "-fasynchronous-unwind-tables", + "-Wp,-D_REENTRANT", + "-ftree-loop-distribute-patterns", + "-Wl,-z", + "-Wl,now", + "-Wl,-z", + "-Wl,relro", + "-malign-data=abi", + "-fno-semantic-interposition", + "-ftree-vectorize", + "-ftree-loop-vectorize", + "-O0", + "-g", + "-O3", + "-feliminate-unused-debug-types", + "-pipe", + "-Wall", + "-Wp,-D_FORTIFY_SOURCE=2", + "-fexceptions", + "-fstack-protector", + "--param=ssp-buffer-size=32", + "-Wformat", + "-Wformat-security", + "-Wl,--copy-dt-needed-entries", + "-m64", + "-fasynchronous-unwind-tables", + "-Wp,-D_REENTRANT", + "-ftree-loop-distribute-patterns", + "-Wl,-z", + "-Wl,now", + "-Wl,-z", + "-Wl,relro", + "-malign-data=abi", + "-fno-semantic-interposition", + "-ftree-vectorize", + "-ftree-loop-vectorize", + "-fvisibility-inlines-hidden" ], "include_dirs": [ "libs/libxpdf/include", @@ -137,8 +186,8 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_19" -#define CYTHON_HEX_VERSION 0x001D13F0 +#define CYTHON_ABI "0_29_21" +#define CYTHON_HEX_VERSION 0x001D15F0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof @@ -579,7 +628,11 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) + #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 @@ -642,6 +695,13 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif +#if PY_VERSION_HEX >= 0x030900A4 + #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) +#else + #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) +#endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #else @@ -681,7 +741,7 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif @@ -1119,7 +1179,7 @@ struct __pyx_opt_args_6pyxpdf_4xpdf_10TextOutput__get_TextPage { PyObject *page_no; }; -/* "src/pyxpdf/imageoutput.pxi":429 +/* "src/pyxpdf/imageoutput.pxi":427 * * * cpdef object get(self, int page_no, crop_box=(0,0,0,0), scale_pixel_box = None): # <<<<<<<<<<<<<< @@ -1132,15 +1192,17 @@ struct __pyx_opt_args_6pyxpdf_4xpdf_14RawImageOutput_get { PyObject *scale_pixel_box; }; -/* "src/pyxpdf/document.pxi":155 +/* "src/pyxpdf/document.pxi":161 * return self.doc.getCatalog() * - * cdef display_pages(self, OutputDev* out, int first, int end, # <<<<<<<<<<<<<< + * cdef display_pages(self, OutputDev* out, int first = 0, int end = -1, # <<<<<<<<<<<<<< * double hDPI = 72, double vDPI = 72, int rotate = 0, * GBool use_media_box = gFalse, GBool crop = gTrue, */ struct __pyx_opt_args_6pyxpdf_4xpdf_8Document_display_pages { int __pyx_n; + int first; + int end; double hDPI; double vDPI; int rotate; @@ -1149,7 +1211,7 @@ struct __pyx_opt_args_6pyxpdf_4xpdf_8Document_display_pages { GBool printing; }; -/* "src/pyxpdf/document.pxi":342 +/* "src/pyxpdf/document.pxi":352 * * * cpdef text_bytes(self, int start=0, int end=-1, TextControl control=None): # <<<<<<<<<<<<<< @@ -1163,7 +1225,7 @@ struct __pyx_opt_args_6pyxpdf_4xpdf_8Document_text_bytes { struct __pyx_obj_6pyxpdf_4xpdf_TextControl *control; }; -/* "src/pyxpdf/document.pxi":384 +/* "src/pyxpdf/document.pxi":394 * return deref(out) * * cpdef text(self, start=0, end=-1, control=None): # <<<<<<<<<<<<<< @@ -1177,7 +1239,7 @@ struct __pyx_opt_args_6pyxpdf_4xpdf_8Document_text { PyObject *control; }; -/* "src/pyxpdf/document.pxi":522 +/* "src/pyxpdf/document.pxi":532 * * * cdef display_slice(self, OutputDev* out, int x1, int y1, int hgt, int wdt, # <<<<<<<<<<<<<< @@ -1194,7 +1256,7 @@ struct __pyx_opt_args_6pyxpdf_4xpdf_4Page_display_slice { GBool printing; }; -/* "src/pyxpdf/document.pxi":529 +/* "src/pyxpdf/document.pxi":539 * x1, y1, hgt, wdt, printing) * * cdef display(self, OutputDev* out, double hDPI = 72, double vDPI = 72, # <<<<<<<<<<<<<< @@ -1211,7 +1273,7 @@ struct __pyx_opt_args_6pyxpdf_4xpdf_4Page_display { GBool printing; }; -/* "src/pyxpdf/document.pxi":560 +/* "src/pyxpdf/document.pxi":570 * return None * * cdef _find_text(self, text, search_box=None, start_at_top=True, stop_at_bottom=True, start_at_last=False, # <<<<<<<<<<<<<< @@ -1332,7 +1394,7 @@ struct __pyx_obj_6pyxpdf_4xpdf_XPDFNotInplementedError { * # or corruption error. * cdef class _GlobalParamsConfig: # <<<<<<<<<<<<<< * cdef: - * object cfg_path + * public object cfg_path */ struct __pyx_obj_6pyxpdf_4xpdf__GlobalParamsConfig { PyObject_HEAD @@ -1421,7 +1483,7 @@ struct __pyx_obj_6pyxpdf_4xpdf_RawImageOutput { }; -/* "src/pyxpdf/imageoutput.pxi":503 +/* "src/pyxpdf/imageoutput.pxi":501 * } * * cdef class PDFImage: # <<<<<<<<<<<<<< @@ -1478,7 +1540,7 @@ struct __pyx_obj_6pyxpdf_4xpdf_Document { }; -/* "src/pyxpdf/document.pxi":425 +/* "src/pyxpdf/document.pxi":435 * * * cdef class DocumentPageIterator: # <<<<<<<<<<<<<< @@ -1492,7 +1554,7 @@ struct __pyx_obj_6pyxpdf_4xpdf_DocumentPageIterator { }; -/* "src/pyxpdf/document.pxi":445 +/* "src/pyxpdf/document.pxi":455 * * * cdef class Page: # <<<<<<<<<<<<<< @@ -1510,7 +1572,7 @@ struct __pyx_obj_6pyxpdf_4xpdf_Page { }; -/* "src/pyxpdf/document.pxi":831 +/* "src/pyxpdf/document.pxi":841 * * * cdef class page_iterator: # <<<<<<<<<<<<<< @@ -1525,7 +1587,7 @@ struct __pyx_obj_6pyxpdf_4xpdf_page_iterator { }; -/* "src/pyxpdf/document.pxi":713 +/* "src/pyxpdf/document.pxi":723 * * * def find_all_text(self, text, search_box=None, case_sensitive=False, wholeword=False, # <<<<<<<<<<<<<< @@ -1550,7 +1612,7 @@ struct __pyx_obj_6pyxpdf_4xpdf___pyx_scope_struct__find_all_text { * # or corruption error. * cdef class _GlobalParamsConfig: # <<<<<<<<<<<<<< * cdef: - * object cfg_path + * public object cfg_path */ struct __pyx_vtabstruct_6pyxpdf_4xpdf__GlobalParamsConfig { @@ -1610,7 +1672,7 @@ struct __pyx_vtabstruct_6pyxpdf_4xpdf_RawImageOutput { static struct __pyx_vtabstruct_6pyxpdf_4xpdf_RawImageOutput *__pyx_vtabptr_6pyxpdf_4xpdf_RawImageOutput; -/* "src/pyxpdf/imageoutput.pxi":503 +/* "src/pyxpdf/imageoutput.pxi":501 * } * * cdef class PDFImage: # <<<<<<<<<<<<<< @@ -1650,7 +1712,7 @@ static struct __pyx_vtabstruct_6pyxpdf_4xpdf_PDFImageOutput *__pyx_vtabptr_6pyxp struct __pyx_vtabstruct_6pyxpdf_4xpdf_Document { Catalog *(*get_catalog)(struct __pyx_obj_6pyxpdf_4xpdf_Document *); - PyObject *(*display_pages)(struct __pyx_obj_6pyxpdf_4xpdf_Document *, OutputDev *, int, int, struct __pyx_opt_args_6pyxpdf_4xpdf_8Document_display_pages *__pyx_optional_args); + PyObject *(*display_pages)(struct __pyx_obj_6pyxpdf_4xpdf_Document *, OutputDev *, struct __pyx_opt_args_6pyxpdf_4xpdf_8Document_display_pages *__pyx_optional_args); PyObject *(*get_info_dict)(struct __pyx_obj_6pyxpdf_4xpdf_Document *); PyObject *(*get_metadata)(struct __pyx_obj_6pyxpdf_4xpdf_Document *); PyObject *(*_load_from_file)(struct __pyx_obj_6pyxpdf_4xpdf_Document *, GString *); @@ -1664,7 +1726,7 @@ struct __pyx_vtabstruct_6pyxpdf_4xpdf_Document { static struct __pyx_vtabstruct_6pyxpdf_4xpdf_Document *__pyx_vtabptr_6pyxpdf_4xpdf_Document; -/* "src/pyxpdf/document.pxi":445 +/* "src/pyxpdf/document.pxi":455 * * * cdef class Page: # <<<<<<<<<<<<<< @@ -2323,7 +2385,7 @@ static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); PyList_SET_ITEM(list, len, x); - Py_SIZE(list) = len+1; + __Pyx_SET_SIZE(list, len + 1); return 0; } return PyList_Append(list, x); @@ -2385,8 +2447,8 @@ static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction * #define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2) #endif -/* None.proto */ -static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* CallableCheck.proto */ #if CYTHON_USE_TYPE_SLOTS && PY_MAJOR_VERSION >= 3 @@ -2403,7 +2465,7 @@ static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { if (likely(L->allocated > len)) { Py_INCREF(x); PyList_SET_ITEM(list, len, x); - Py_SIZE(list) = len+1; + __Pyx_SET_SIZE(list, len + 1); return 0; } return PyList_Append(list, x); @@ -2422,9 +2484,6 @@ static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v); static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list, int wraparound, int boundscheck); -/* ImportFrom.proto */ -static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); - /* HasAttr.proto */ static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); @@ -2764,7 +2823,7 @@ static int __pyx_f_6pyxpdf_4xpdf_14PDFImageOutput__get_PDFBitmapImages(struct __ static PyObject *__pyx_f_6pyxpdf_4xpdf_14PDFImageOutput__get_images(struct __pyx_obj_6pyxpdf_4xpdf_PDFImageOutput *__pyx_v_self, PyObject *__pyx_v_page_no); /* proto*/ static PyObject *__pyx_f_6pyxpdf_4xpdf_14PDFImageOutput_get(struct __pyx_obj_6pyxpdf_4xpdf_PDFImageOutput *__pyx_v_self, PyObject *__pyx_v_page_no, int __pyx_skip_dispatch); /* proto*/ static Catalog *__pyx_f_6pyxpdf_4xpdf_8Document_get_catalog(struct __pyx_obj_6pyxpdf_4xpdf_Document *__pyx_v_self); /* proto*/ -static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document_display_pages(struct __pyx_obj_6pyxpdf_4xpdf_Document *__pyx_v_self, OutputDev *__pyx_v_out, int __pyx_v_first, int __pyx_v_end, struct __pyx_opt_args_6pyxpdf_4xpdf_8Document_display_pages *__pyx_optional_args); /* proto*/ +static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document_display_pages(struct __pyx_obj_6pyxpdf_4xpdf_Document *__pyx_v_self, OutputDev *__pyx_v_out, struct __pyx_opt_args_6pyxpdf_4xpdf_8Document_display_pages *__pyx_optional_args); /* proto*/ static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document_get_info_dict(struct __pyx_obj_6pyxpdf_4xpdf_Document *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document_get_metadata(struct __pyx_obj_6pyxpdf_4xpdf_Document *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document__load_from_file(struct __pyx_obj_6pyxpdf_4xpdf_Document *__pyx_v_self, GString *__pyx_v_pdf); /* proto*/ @@ -2960,7 +3019,7 @@ static const char __pyx_k_BGR[] = "BGR"; static const char __pyx_k_RGB[] = "RGB"; static const char __pyx_k__44[] = "]>"; static const char __pyx_k__52[] = "'"; -static const char __pyx_k__65[] = ">"; +static const char __pyx_k__66[] = ">"; static const char __pyx_k_all[] = "__all__"; static const char __pyx_k_dir[] = "dir"; static const char __pyx_k_doc[] = "doc"; @@ -2987,6 +3046,7 @@ static const char __pyx_k_top[] = "top"; static const char __pyx_k_BGRA[] = "BGRA"; static const char __pyx_k_CMYK[] = "CMYK"; static const char __pyx_k_Page[] = "Page"; +static const char __pyx_k_Path[] = "Path"; static const char __pyx_k_RGBA[] = "RGBA"; static const char __pyx_k_args[] = "args"; static const char __pyx_k_bbox[] = " bbox="; @@ -3023,6 +3083,7 @@ static const char __pyx_k_index[] = "index"; static const char __pyx_k_items[] = "items"; static const char __pyx_k_jbig2[] = "jbig2"; static const char __pyx_k_label[] = "label"; +static const char __pyx_k_lower[] = "lower"; static const char __pyx_k_pages[] = "pages"; static const char __pyx_k_range[] = "range"; static const char __pyx_k_reset[] = "reset"; @@ -3057,6 +3118,7 @@ static const char __pyx_k_indices[] = "indices"; static const char __pyx_k_message[] = "message"; static const char __pyx_k_modules[] = "modules"; static const char __pyx_k_page_no[] = "page_no"; +static const char __pyx_k_pathlib[] = "pathlib"; static const char __pyx_k_reading[] = "reading"; static const char __pyx_k_stencil[] = "stencil"; static const char __pyx_k_unknown[] = "unknown"; @@ -3283,6 +3345,7 @@ static const char __pyx_k_Page_index_must_be_positive_inte[] = "Page index must static const char __pyx_k_RawImageControl___setstate_cytho[] = "RawImageControl.__setstate_cython__"; static const char __pyx_k_RawImageOutput___setstate_cython[] = "RawImageOutput.__setstate_cython__"; static const char __pyx_k_The_index_idx_is_out_of_page_ran[] = "The index {idx} is out of page range"; +static const char __pyx_k_Unsupported_Bitmap_SplashColorMo[] = "Unsupported Bitmap SplashColorMode."; static const char __pyx_k_XPDFConfigError___setstate_cytho[] = "XPDFConfigError.__setstate_cython__"; static const char __pyx_k_XPDFInternalError___reduce_cytho[] = "XPDFInternalError.__reduce_cython__"; static const char __pyx_k_XPDFInternalError___setstate_cyt[] = "XPDFInternalError.__setstate_cython__"; @@ -3398,6 +3461,7 @@ static PyObject *__pyx_kp_u_Page_index_label_label; static PyObject *__pyx_kp_u_Page_index_must_be_positive_inte; static PyObject *__pyx_n_s_Page_text; static PyObject *__pyx_n_s_Page_text_bytes; +static PyObject *__pyx_n_s_Path; static PyObject *__pyx_n_s_PickleError; static PyObject *__pyx_kp_u_Pillow_is_not_installed_Please; static PyObject *__pyx_n_u_RGB; @@ -3429,6 +3493,7 @@ static PyObject *__pyx_n_s_TypeError; static PyObject *__pyx_kp_u_UTF_8; static PyObject *__pyx_kp_u_Uncaught_error_in_xpdf_library; static PyObject *__pyx_kp_u_Unknown_layout; +static PyObject *__pyx_kp_u_Unsupported_Bitmap_SplashColorMo; static PyObject *__pyx_n_s_ValueError; static PyObject *__pyx_n_s_XPDFConfigError; static PyObject *__pyx_n_u_XPDFConfigError; @@ -3449,7 +3514,7 @@ static PyObject *__pyx_n_s_XPDFNotInplementedError___setsta; static PyObject *__pyx_kp_u__4; static PyObject *__pyx_kp_u__44; static PyObject *__pyx_kp_u__52; -static PyObject *__pyx_kp_u__65; +static PyObject *__pyx_kp_u__66; static PyObject *__pyx_n_s_add_font_file; static PyObject *__pyx_n_s_all; static PyObject *__pyx_n_s_anti_alias; @@ -3528,6 +3593,7 @@ static PyObject *__pyx_n_s_layout; static PyObject *__pyx_n_u_lineprinter; static PyObject *__pyx_n_s_load_file; static PyObject *__pyx_n_s_loader; +static PyObject *__pyx_n_s_lower; static PyObject *__pyx_n_u_lzw; static PyObject *__pyx_n_u_mac; static PyObject *__pyx_n_s_main; @@ -3559,6 +3625,7 @@ static PyObject *__pyx_n_s_page_no; static PyObject *__pyx_n_s_pages; static PyObject *__pyx_n_s_paper_color; static PyObject *__pyx_kp_u_paper_color_must_be_3_RGB_or_4; +static PyObject *__pyx_n_s_pathlib; static PyObject *__pyx_n_s_pdf; static PyObject *__pyx_kp_u_pdf_argument_must_be_a_string_or; static PyObject *__pyx_n_s_pdf_file; @@ -3701,6 +3768,9 @@ static int __pyx_pf_6pyxpdf_4xpdf_19_GlobalParamsConfig_14print_commands_2__set_ static PyObject *__pyx_pf_6pyxpdf_4xpdf_19_GlobalParamsConfig_11error_quiet___get__(struct __pyx_obj_6pyxpdf_4xpdf__GlobalParamsConfig *__pyx_v_self); /* proto */ static int __pyx_pf_6pyxpdf_4xpdf_19_GlobalParamsConfig_11error_quiet_2__set__(struct __pyx_obj_6pyxpdf_4xpdf__GlobalParamsConfig *__pyx_v_self, PyObject *__pyx_v_quiet); /* proto */ static PyObject *__pyx_pf_6pyxpdf_4xpdf_19_GlobalParamsConfig_21default_text_encoding___get__(struct __pyx_obj_6pyxpdf_4xpdf__GlobalParamsConfig *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pyxpdf_4xpdf_19_GlobalParamsConfig_8cfg_path___get__(struct __pyx_obj_6pyxpdf_4xpdf__GlobalParamsConfig *__pyx_v_self); /* proto */ +static int __pyx_pf_6pyxpdf_4xpdf_19_GlobalParamsConfig_8cfg_path_2__set__(struct __pyx_obj_6pyxpdf_4xpdf__GlobalParamsConfig *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pyxpdf_4xpdf_19_GlobalParamsConfig_8cfg_path_4__del__(struct __pyx_obj_6pyxpdf_4xpdf__GlobalParamsConfig *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6pyxpdf_4xpdf_19_GlobalParamsConfig_7__doc_____get__(struct __pyx_obj_6pyxpdf_4xpdf__GlobalParamsConfig *__pyx_v_self); /* proto */ static int __pyx_pf_6pyxpdf_4xpdf_19_GlobalParamsConfig_7__doc___2__set__(struct __pyx_obj_6pyxpdf_4xpdf__GlobalParamsConfig *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_6pyxpdf_4xpdf_19_GlobalParamsConfig_7__doc___4__del__(struct __pyx_obj_6pyxpdf_4xpdf__GlobalParamsConfig *__pyx_v_self); /* proto */ @@ -3859,15 +3929,15 @@ static PyObject *__pyx_int_113232382; static PyObject *__pyx_int_222419149; static PyObject *__pyx_int_neg_1; static PyObject *__pyx_k__5; -static GBool __pyx_k__75; static GBool __pyx_k__76; static GBool __pyx_k__77; -static GBool __pyx_k__91; +static GBool __pyx_k__78; static GBool __pyx_k__92; static GBool __pyx_k__93; static GBool __pyx_k__94; static GBool __pyx_k__95; static GBool __pyx_k__96; +static GBool __pyx_k__97; static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__3; static PyObject *__pyx_tuple__23; @@ -3888,22 +3958,22 @@ static PyObject *__pyx_tuple__58; static PyObject *__pyx_tuple__61; static PyObject *__pyx_tuple__63; static PyObject *__pyx_tuple__64; -static PyObject *__pyx_tuple__70; -static PyObject *__pyx_tuple__72; +static PyObject *__pyx_tuple__65; +static PyObject *__pyx_tuple__71; static PyObject *__pyx_tuple__73; static PyObject *__pyx_tuple__74; -static PyObject *__pyx_tuple__78; +static PyObject *__pyx_tuple__75; static PyObject *__pyx_tuple__79; -static PyObject *__pyx_tuple__85; -static PyObject *__pyx_tuple__87; -static PyObject *__pyx_tuple__90; +static PyObject *__pyx_tuple__80; +static PyObject *__pyx_tuple__86; +static PyObject *__pyx_tuple__88; +static PyObject *__pyx_tuple__91; static PyObject *__pyx_codeobj__6; static PyObject *__pyx_codeobj__7; static PyObject *__pyx_codeobj__8; static PyObject *__pyx_codeobj__9; -static PyObject *__pyx_tuple__102; -static PyObject *__pyx_tuple__104; -static PyObject *__pyx_tuple__120; +static PyObject *__pyx_tuple__103; +static PyObject *__pyx_tuple__105; static PyObject *__pyx_tuple__121; static PyObject *__pyx_tuple__122; static PyObject *__pyx_tuple__123; @@ -3977,6 +4047,7 @@ static PyObject *__pyx_tuple__190; static PyObject *__pyx_tuple__191; static PyObject *__pyx_tuple__192; static PyObject *__pyx_tuple__193; +static PyObject *__pyx_tuple__194; static PyObject *__pyx_codeobj__10; static PyObject *__pyx_codeobj__11; static PyObject *__pyx_codeobj__12; @@ -4012,26 +4083,25 @@ static PyObject *__pyx_codeobj__55; static PyObject *__pyx_codeobj__59; static PyObject *__pyx_codeobj__60; static PyObject *__pyx_codeobj__62; -static PyObject *__pyx_codeobj__66; static PyObject *__pyx_codeobj__67; static PyObject *__pyx_codeobj__68; static PyObject *__pyx_codeobj__69; -static PyObject *__pyx_codeobj__71; -static PyObject *__pyx_codeobj__80; +static PyObject *__pyx_codeobj__70; +static PyObject *__pyx_codeobj__72; static PyObject *__pyx_codeobj__81; static PyObject *__pyx_codeobj__82; static PyObject *__pyx_codeobj__83; static PyObject *__pyx_codeobj__84; -static PyObject *__pyx_codeobj__86; -static PyObject *__pyx_codeobj__88; +static PyObject *__pyx_codeobj__85; +static PyObject *__pyx_codeobj__87; static PyObject *__pyx_codeobj__89; -static PyObject *__pyx_codeobj__97; +static PyObject *__pyx_codeobj__90; static PyObject *__pyx_codeobj__98; static PyObject *__pyx_codeobj__99; static PyObject *__pyx_codeobj__100; static PyObject *__pyx_codeobj__101; -static PyObject *__pyx_codeobj__103; -static PyObject *__pyx_codeobj__105; +static PyObject *__pyx_codeobj__102; +static PyObject *__pyx_codeobj__104; static PyObject *__pyx_codeobj__106; static PyObject *__pyx_codeobj__107; static PyObject *__pyx_codeobj__108; @@ -4046,6 +4116,7 @@ static PyObject *__pyx_codeobj__116; static PyObject *__pyx_codeobj__117; static PyObject *__pyx_codeobj__118; static PyObject *__pyx_codeobj__119; +static PyObject *__pyx_codeobj__120; /* Late includes */ /* "pyxpdf/xpdf.pyx":49 @@ -8542,7 +8613,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_23XPDFNotInplementedError_2__setstate_cy * public object __doc__ * * cdef _set_defaults(self): # <<<<<<<<<<<<<< - * # only call after initialising self._global + * # only call after initializing self._global * # default text encoding */ @@ -8557,7 +8628,7 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_19_GlobalParamsConfig__set_defaults(struc __Pyx_TraceCall("_set_defaults", __pyx_f[3], 17, 0, __PYX_ERR(3, 17, __pyx_L1_error)); /* "src/pyxpdf/globalconfig.pxi":20 - * # only call after initialising self._global + * # only call after initializing self._global * # default text encoding * self._global.setTextEncoding("UTF-8") # <<<<<<<<<<<<<< * @@ -8570,7 +8641,7 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_19_GlobalParamsConfig__set_defaults(struc * public object __doc__ * * cdef _set_defaults(self): # <<<<<<<<<<<<<< - * # only call after initialising self._global + * # only call after initializing self._global * # default text encoding */ @@ -10785,8 +10856,8 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_19_GlobalParamsConfig_8text_eol___get__( * * @text_eol.setter * def text_eol(self, eol): # <<<<<<<<<<<<<< - * cdef EndOfLineKind c_eol - * if eol == "unix": + * # cdef EndOfLineKind c_eol + * if eol.lower() in (u'unix', u'mac', u'dos'): */ /* Python wrapper */ @@ -10803,16 +10874,17 @@ static int __pyx_pw_6pyxpdf_4xpdf_19_GlobalParamsConfig_8text_eol_3__set__(PyObj } static int __pyx_pf_6pyxpdf_4xpdf_19_GlobalParamsConfig_8text_eol_2__set__(struct __pyx_obj_6pyxpdf_4xpdf__GlobalParamsConfig *__pyx_v_self, PyObject *__pyx_v_eol) { - CYTHON_UNUSED EndOfLineKind __pyx_v_c_eol; int __pyx_r; __Pyx_TraceDeclarations __Pyx_RefNannyDeclarations - int __pyx_t_1; + PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - Py_ssize_t __pyx_t_3; - Py_UCS4 __pyx_t_4; - PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; char *__pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_UCS4 __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -10821,169 +10893,131 @@ static int __pyx_pf_6pyxpdf_4xpdf_19_GlobalParamsConfig_8text_eol_2__set__(struc /* "src/pyxpdf/globalconfig.pxi":163 * def text_eol(self, eol): - * cdef EndOfLineKind c_eol - * if eol == "unix": # <<<<<<<<<<<<<< - * c_eol = EndOfLineKind.eolUnix - * elif eol == "dos": + * # cdef EndOfLineKind c_eol + * if eol.lower() in (u'unix', u'mac', u'dos'): # <<<<<<<<<<<<<< + * self._global.setTextEOL(_chars(eol)) + * else: */ __Pyx_TraceLine(163,0,__PYX_ERR(3, 163, __pyx_L1_error)) - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_eol, __pyx_n_u_unix, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 163, __pyx_L1_error) - if (__pyx_t_1) { - - /* "src/pyxpdf/globalconfig.pxi":164 - * cdef EndOfLineKind c_eol - * if eol == "unix": - * c_eol = EndOfLineKind.eolUnix # <<<<<<<<<<<<<< - * elif eol == "dos": - * c_eol = EndOfLineKind.eolDOS - */ - __Pyx_TraceLine(164,0,__PYX_ERR(3, 164, __pyx_L1_error)) - __pyx_v_c_eol = eolUnix; - - /* "src/pyxpdf/globalconfig.pxi":163 - * def text_eol(self, eol): - * cdef EndOfLineKind c_eol - * if eol == "unix": # <<<<<<<<<<<<<< - * c_eol = EndOfLineKind.eolUnix - * elif eol == "dos": - */ - goto __pyx_L3; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_eol, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } } - - /* "src/pyxpdf/globalconfig.pxi":165 - * if eol == "unix": - * c_eol = EndOfLineKind.eolUnix - * elif eol == "dos": # <<<<<<<<<<<<<< - * c_eol = EndOfLineKind.eolDOS - * elif eol == 'mac': - */ - __Pyx_TraceLine(165,0,__PYX_ERR(3, 165, __pyx_L1_error)) - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_eol, __pyx_n_u_dos, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 165, __pyx_L1_error) - if (__pyx_t_1) { - - /* "src/pyxpdf/globalconfig.pxi":166 - * c_eol = EndOfLineKind.eolUnix - * elif eol == "dos": - * c_eol = EndOfLineKind.eolDOS # <<<<<<<<<<<<<< - * elif eol == 'mac': - * c_eol = EndOfLineKind.eolMac - */ - __Pyx_TraceLine(166,0,__PYX_ERR(3, 166, __pyx_L1_error)) - __pyx_v_c_eol = eolDOS; - - /* "src/pyxpdf/globalconfig.pxi":165 - * if eol == "unix": - * c_eol = EndOfLineKind.eolUnix - * elif eol == "dos": # <<<<<<<<<<<<<< - * c_eol = EndOfLineKind.eolDOS - * elif eol == 'mac': - */ - goto __pyx_L3; + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_unix, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 163, __pyx_L1_error) + if (!__pyx_t_5) { + } else { + __pyx_t_4 = __pyx_t_5; + goto __pyx_L4_bool_binop_done; } + __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_mac, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 163, __pyx_L1_error) + if (!__pyx_t_5) { + } else { + __pyx_t_4 = __pyx_t_5; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_dos, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 163, __pyx_L1_error) + __pyx_t_4 = __pyx_t_5; + __pyx_L4_bool_binop_done:; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = (__pyx_t_4 != 0); + if (likely(__pyx_t_5)) { - /* "src/pyxpdf/globalconfig.pxi":167 - * elif eol == "dos": - * c_eol = EndOfLineKind.eolDOS - * elif eol == 'mac': # <<<<<<<<<<<<<< - * c_eol = EndOfLineKind.eolMac - * else: - */ - __Pyx_TraceLine(167,0,__PYX_ERR(3, 167, __pyx_L1_error)) - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_eol, __pyx_n_u_mac, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 167, __pyx_L1_error) - if (likely(__pyx_t_1)) { - - /* "src/pyxpdf/globalconfig.pxi":168 - * c_eol = EndOfLineKind.eolDOS - * elif eol == 'mac': - * c_eol = EndOfLineKind.eolMac # <<<<<<<<<<<<<< + /* "src/pyxpdf/globalconfig.pxi":164 + * # cdef EndOfLineKind c_eol + * if eol.lower() in (u'unix', u'mac', u'dos'): + * self._global.setTextEOL(_chars(eol)) # <<<<<<<<<<<<<< * else: * raise XPDFConfigError(f"Invalid EOL type - {eol}.") */ - __Pyx_TraceLine(168,0,__PYX_ERR(3, 168, __pyx_L1_error)) - __pyx_v_c_eol = eolMac; + __Pyx_TraceLine(164,0,__PYX_ERR(3, 164, __pyx_L1_error)) + __pyx_t_1 = __pyx_f_6pyxpdf_4xpdf__chars(__pyx_v_eol); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 164, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__pyx_t_1 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); + __PYX_ERR(3, 164, __pyx_L1_error) + } + __pyx_t_6 = __Pyx_PyBytes_AsWritableString(__pyx_t_1); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(3, 164, __pyx_L1_error) + (void)(__pyx_v_self->_global->setTextEOL(__pyx_t_6)); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "src/pyxpdf/globalconfig.pxi":167 - * elif eol == "dos": - * c_eol = EndOfLineKind.eolDOS - * elif eol == 'mac': # <<<<<<<<<<<<<< - * c_eol = EndOfLineKind.eolMac + /* "src/pyxpdf/globalconfig.pxi":163 + * def text_eol(self, eol): + * # cdef EndOfLineKind c_eol + * if eol.lower() in (u'unix', u'mac', u'dos'): # <<<<<<<<<<<<<< + * self._global.setTextEOL(_chars(eol)) * else: */ goto __pyx_L3; } - /* "src/pyxpdf/globalconfig.pxi":170 - * c_eol = EndOfLineKind.eolMac + /* "src/pyxpdf/globalconfig.pxi":166 + * self._global.setTextEOL(_chars(eol)) * else: * raise XPDFConfigError(f"Invalid EOL type - {eol}.") # <<<<<<<<<<<<<< - * self._global.setTextEOL(_chars(eol)) + * * */ - __Pyx_TraceLine(170,0,__PYX_ERR(3, 170, __pyx_L1_error)) + __Pyx_TraceLine(166,0,__PYX_ERR(3, 166, __pyx_L1_error)) /*else*/ { - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 170, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = 0; - __pyx_t_4 = 127; + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 166, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = 0; + __pyx_t_8 = 127; __Pyx_INCREF(__pyx_kp_u_Invalid_EOL_type); - __pyx_t_3 += 19; + __pyx_t_7 += 19; __Pyx_GIVEREF(__pyx_kp_u_Invalid_EOL_type); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_Invalid_EOL_type); - __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_eol, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 170, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4; - __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5); - __pyx_t_5 = 0; + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Invalid_EOL_type); + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_eol, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 166, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_8; + __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); + __pyx_t_2 = 0; __Pyx_INCREF(__pyx_kp_u_); - __pyx_t_3 += 1; + __pyx_t_7 += 1; __Pyx_GIVEREF(__pyx_kp_u_); - PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_); - __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 170, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6pyxpdf_4xpdf_XPDFConfigError), __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 170, __pyx_L1_error) + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_); + __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6pyxpdf_4xpdf_XPDFConfigError), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 166, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(3, 170, __pyx_L1_error) + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(3, 166, __pyx_L1_error) } __pyx_L3:; - /* "src/pyxpdf/globalconfig.pxi":171 - * else: - * raise XPDFConfigError(f"Invalid EOL type - {eol}.") - * self._global.setTextEOL(_chars(eol)) # <<<<<<<<<<<<<< - * - * - */ - __Pyx_TraceLine(171,0,__PYX_ERR(3, 171, __pyx_L1_error)) - __pyx_t_2 = __pyx_f_6pyxpdf_4xpdf__chars(__pyx_v_eol); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 171, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (unlikely(__pyx_t_2 == Py_None)) { - PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(3, 171, __pyx_L1_error) - } - __pyx_t_6 = __Pyx_PyBytes_AsWritableString(__pyx_t_2); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(3, 171, __pyx_L1_error) - (void)(__pyx_v_self->_global->setTextEOL(__pyx_t_6)); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/pyxpdf/globalconfig.pxi":161 * * @text_eol.setter * def text_eol(self, eol): # <<<<<<<<<<<<<< - * cdef EndOfLineKind c_eol - * if eol == "unix": + * # cdef EndOfLineKind c_eol + * if eol.lower() in (u'unix', u'mac', u'dos'): */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pyxpdf.xpdf._GlobalParamsConfig.text_eol.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; @@ -10992,7 +11026,7 @@ static int __pyx_pf_6pyxpdf_4xpdf_19_GlobalParamsConfig_8text_eol_2__set__(struc return __pyx_r; } -/* "src/pyxpdf/globalconfig.pxi":175 +/* "src/pyxpdf/globalconfig.pxi":170 * * @property * def text_page_breaks(self): # <<<<<<<<<<<<<< @@ -11022,24 +11056,24 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_19_GlobalParamsConfig_16text_page_breaks const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[3], 175, 0, __PYX_ERR(3, 175, __pyx_L1_error)); + __Pyx_TraceCall("__get__", __pyx_f[3], 170, 0, __PYX_ERR(3, 170, __pyx_L1_error)); - /* "src/pyxpdf/globalconfig.pxi":176 + /* "src/pyxpdf/globalconfig.pxi":171 * @property * def text_page_breaks(self): * return GBool_to_bool(self._global.getTextPageBreaks()) # <<<<<<<<<<<<<< * * @text_page_breaks.setter */ - __Pyx_TraceLine(176,0,__PYX_ERR(3, 176, __pyx_L1_error)) + __Pyx_TraceLine(171,0,__PYX_ERR(3, 171, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_6pyxpdf_4xpdf_GBool_to_bool(__pyx_v_self->_global->getTextPageBreaks()); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 176, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6pyxpdf_4xpdf_GBool_to_bool(__pyx_v_self->_global->getTextPageBreaks()); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "src/pyxpdf/globalconfig.pxi":175 + /* "src/pyxpdf/globalconfig.pxi":170 * * @property * def text_page_breaks(self): # <<<<<<<<<<<<<< @@ -11059,7 +11093,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_19_GlobalParamsConfig_16text_page_breaks return __pyx_r; } -/* "src/pyxpdf/globalconfig.pxi":179 +/* "src/pyxpdf/globalconfig.pxi":174 * * @text_page_breaks.setter * def text_page_breaks(self, breaks): # <<<<<<<<<<<<<< @@ -11088,19 +11122,19 @@ static int __pyx_pf_6pyxpdf_4xpdf_19_GlobalParamsConfig_16text_page_breaks_2__se const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - __Pyx_TraceCall("__set__", __pyx_f[3], 179, 0, __PYX_ERR(3, 179, __pyx_L1_error)); + __Pyx_TraceCall("__set__", __pyx_f[3], 174, 0, __PYX_ERR(3, 174, __pyx_L1_error)); - /* "src/pyxpdf/globalconfig.pxi":180 + /* "src/pyxpdf/globalconfig.pxi":175 * @text_page_breaks.setter * def text_page_breaks(self, breaks): * self._global.setTextPageBreaks(to_GBool(breaks)) # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(180,0,__PYX_ERR(3, 180, __pyx_L1_error)) + __Pyx_TraceLine(175,0,__PYX_ERR(3, 175, __pyx_L1_error)) __pyx_v_self->_global->setTextPageBreaks(__pyx_f_6pyxpdf_4xpdf_to_GBool(__pyx_v_breaks)); - /* "src/pyxpdf/globalconfig.pxi":179 + /* "src/pyxpdf/globalconfig.pxi":174 * * @text_page_breaks.setter * def text_page_breaks(self, breaks): # <<<<<<<<<<<<<< @@ -11120,7 +11154,7 @@ static int __pyx_pf_6pyxpdf_4xpdf_19_GlobalParamsConfig_16text_page_breaks_2__se return __pyx_r; } -/* "src/pyxpdf/globalconfig.pxi":184 +/* "src/pyxpdf/globalconfig.pxi":179 * * @property * def text_keep_tiny(self): # <<<<<<<<<<<<<< @@ -11150,24 +11184,24 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_19_GlobalParamsConfig_14text_keep_tiny__ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[3], 184, 0, __PYX_ERR(3, 184, __pyx_L1_error)); + __Pyx_TraceCall("__get__", __pyx_f[3], 179, 0, __PYX_ERR(3, 179, __pyx_L1_error)); - /* "src/pyxpdf/globalconfig.pxi":185 + /* "src/pyxpdf/globalconfig.pxi":180 * @property * def text_keep_tiny(self): * return GBool_to_bool(self._global.getTextKeepTinyChars()) # <<<<<<<<<<<<<< * * @text_keep_tiny.setter */ - __Pyx_TraceLine(185,0,__PYX_ERR(3, 185, __pyx_L1_error)) + __Pyx_TraceLine(180,0,__PYX_ERR(3, 180, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_6pyxpdf_4xpdf_GBool_to_bool(__pyx_v_self->_global->getTextKeepTinyChars()); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 185, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6pyxpdf_4xpdf_GBool_to_bool(__pyx_v_self->_global->getTextKeepTinyChars()); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "src/pyxpdf/globalconfig.pxi":184 + /* "src/pyxpdf/globalconfig.pxi":179 * * @property * def text_keep_tiny(self): # <<<<<<<<<<<<<< @@ -11187,7 +11221,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_19_GlobalParamsConfig_14text_keep_tiny__ return __pyx_r; } -/* "src/pyxpdf/globalconfig.pxi":188 +/* "src/pyxpdf/globalconfig.pxi":183 * * @text_keep_tiny.setter * def text_keep_tiny(self, keep): # <<<<<<<<<<<<<< @@ -11216,19 +11250,19 @@ static int __pyx_pf_6pyxpdf_4xpdf_19_GlobalParamsConfig_14text_keep_tiny_2__set_ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - __Pyx_TraceCall("__set__", __pyx_f[3], 188, 0, __PYX_ERR(3, 188, __pyx_L1_error)); + __Pyx_TraceCall("__set__", __pyx_f[3], 183, 0, __PYX_ERR(3, 183, __pyx_L1_error)); - /* "src/pyxpdf/globalconfig.pxi":189 + /* "src/pyxpdf/globalconfig.pxi":184 * @text_keep_tiny.setter * def text_keep_tiny(self, keep): * self._global.setTextKeepTinyChars(to_GBool(keep)) # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(189,0,__PYX_ERR(3, 189, __pyx_L1_error)) + __Pyx_TraceLine(184,0,__PYX_ERR(3, 184, __pyx_L1_error)) __pyx_v_self->_global->setTextKeepTinyChars(__pyx_f_6pyxpdf_4xpdf_to_GBool(__pyx_v_keep)); - /* "src/pyxpdf/globalconfig.pxi":188 + /* "src/pyxpdf/globalconfig.pxi":183 * * @text_keep_tiny.setter * def text_keep_tiny(self, keep): # <<<<<<<<<<<<<< @@ -11248,7 +11282,7 @@ static int __pyx_pf_6pyxpdf_4xpdf_19_GlobalParamsConfig_14text_keep_tiny_2__set_ return __pyx_r; } -/* "src/pyxpdf/globalconfig.pxi":193 +/* "src/pyxpdf/globalconfig.pxi":188 * * @property * def print_commands(self): # <<<<<<<<<<<<<< @@ -11278,24 +11312,24 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_19_GlobalParamsConfig_14print_commands__ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[3], 193, 0, __PYX_ERR(3, 193, __pyx_L1_error)); + __Pyx_TraceCall("__get__", __pyx_f[3], 188, 0, __PYX_ERR(3, 188, __pyx_L1_error)); - /* "src/pyxpdf/globalconfig.pxi":194 + /* "src/pyxpdf/globalconfig.pxi":189 * @property * def print_commands(self): * return GBool_to_bool(self._global.getPrintCommands()) # <<<<<<<<<<<<<< * * @print_commands.setter */ - __Pyx_TraceLine(194,0,__PYX_ERR(3, 194, __pyx_L1_error)) + __Pyx_TraceLine(189,0,__PYX_ERR(3, 189, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_6pyxpdf_4xpdf_GBool_to_bool(__pyx_v_self->_global->getPrintCommands()); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 194, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6pyxpdf_4xpdf_GBool_to_bool(__pyx_v_self->_global->getPrintCommands()); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "src/pyxpdf/globalconfig.pxi":193 + /* "src/pyxpdf/globalconfig.pxi":188 * * @property * def print_commands(self): # <<<<<<<<<<<<<< @@ -11315,7 +11349,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_19_GlobalParamsConfig_14print_commands__ return __pyx_r; } -/* "src/pyxpdf/globalconfig.pxi":197 +/* "src/pyxpdf/globalconfig.pxi":192 * * @print_commands.setter * def print_commands(self, print_cmd): # <<<<<<<<<<<<<< @@ -11344,19 +11378,19 @@ static int __pyx_pf_6pyxpdf_4xpdf_19_GlobalParamsConfig_14print_commands_2__set_ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - __Pyx_TraceCall("__set__", __pyx_f[3], 197, 0, __PYX_ERR(3, 197, __pyx_L1_error)); + __Pyx_TraceCall("__set__", __pyx_f[3], 192, 0, __PYX_ERR(3, 192, __pyx_L1_error)); - /* "src/pyxpdf/globalconfig.pxi":198 + /* "src/pyxpdf/globalconfig.pxi":193 * @print_commands.setter * def print_commands(self, print_cmd): * self._global.setPrintCommands(to_GBool(print_cmd)) # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(198,0,__PYX_ERR(3, 198, __pyx_L1_error)) + __Pyx_TraceLine(193,0,__PYX_ERR(3, 193, __pyx_L1_error)) __pyx_v_self->_global->setPrintCommands(__pyx_f_6pyxpdf_4xpdf_to_GBool(__pyx_v_print_cmd)); - /* "src/pyxpdf/globalconfig.pxi":197 + /* "src/pyxpdf/globalconfig.pxi":192 * * @print_commands.setter * def print_commands(self, print_cmd): # <<<<<<<<<<<<<< @@ -11376,7 +11410,7 @@ static int __pyx_pf_6pyxpdf_4xpdf_19_GlobalParamsConfig_14print_commands_2__set_ return __pyx_r; } -/* "src/pyxpdf/globalconfig.pxi":202 +/* "src/pyxpdf/globalconfig.pxi":197 * * @property * def error_quiet(self): # <<<<<<<<<<<<<< @@ -11406,24 +11440,24 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_19_GlobalParamsConfig_11error_quiet___ge const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[3], 202, 0, __PYX_ERR(3, 202, __pyx_L1_error)); + __Pyx_TraceCall("__get__", __pyx_f[3], 197, 0, __PYX_ERR(3, 197, __pyx_L1_error)); - /* "src/pyxpdf/globalconfig.pxi":203 + /* "src/pyxpdf/globalconfig.pxi":198 * @property * def error_quiet(self): * return GBool_to_bool(self._global.getErrQuiet()) # <<<<<<<<<<<<<< * * @error_quiet.setter */ - __Pyx_TraceLine(203,0,__PYX_ERR(3, 203, __pyx_L1_error)) + __Pyx_TraceLine(198,0,__PYX_ERR(3, 198, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_6pyxpdf_4xpdf_GBool_to_bool(__pyx_v_self->_global->getErrQuiet()); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 203, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6pyxpdf_4xpdf_GBool_to_bool(__pyx_v_self->_global->getErrQuiet()); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "src/pyxpdf/globalconfig.pxi":202 + /* "src/pyxpdf/globalconfig.pxi":197 * * @property * def error_quiet(self): # <<<<<<<<<<<<<< @@ -11443,7 +11477,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_19_GlobalParamsConfig_11error_quiet___ge return __pyx_r; } -/* "src/pyxpdf/globalconfig.pxi":206 +/* "src/pyxpdf/globalconfig.pxi":201 * * @error_quiet.setter * def error_quiet(self, quiet): # <<<<<<<<<<<<<< @@ -11472,19 +11506,19 @@ static int __pyx_pf_6pyxpdf_4xpdf_19_GlobalParamsConfig_11error_quiet_2__set__(s const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - __Pyx_TraceCall("__set__", __pyx_f[3], 206, 0, __PYX_ERR(3, 206, __pyx_L1_error)); + __Pyx_TraceCall("__set__", __pyx_f[3], 201, 0, __PYX_ERR(3, 201, __pyx_L1_error)); - /* "src/pyxpdf/globalconfig.pxi":207 + /* "src/pyxpdf/globalconfig.pxi":202 * @error_quiet.setter * def error_quiet(self, quiet): * self._global.setErrQuiet(to_GBool(quiet)) # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(207,0,__PYX_ERR(3, 207, __pyx_L1_error)) + __Pyx_TraceLine(202,0,__PYX_ERR(3, 202, __pyx_L1_error)) __pyx_v_self->_global->setErrQuiet(__pyx_f_6pyxpdf_4xpdf_to_GBool(__pyx_v_quiet)); - /* "src/pyxpdf/globalconfig.pxi":206 + /* "src/pyxpdf/globalconfig.pxi":201 * * @error_quiet.setter * def error_quiet(self, quiet): # <<<<<<<<<<<<<< @@ -11504,7 +11538,7 @@ static int __pyx_pf_6pyxpdf_4xpdf_19_GlobalParamsConfig_11error_quiet_2__set__(s return __pyx_r; } -/* "src/pyxpdf/globalconfig.pxi":211 +/* "src/pyxpdf/globalconfig.pxi":206 * * @property * def default_text_encoding(self): # <<<<<<<<<<<<<< @@ -11535,26 +11569,26 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_19_GlobalParamsConfig_21default_text_enc const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[3], 211, 0, __PYX_ERR(3, 211, __pyx_L1_error)); + __Pyx_TraceCall("__get__", __pyx_f[3], 206, 0, __PYX_ERR(3, 206, __pyx_L1_error)); - /* "src/pyxpdf/globalconfig.pxi":212 + /* "src/pyxpdf/globalconfig.pxi":207 * @property * def default_text_encoding(self): * return self._global.defaultTextEncoding.decode('UTF-8') # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(212,0,__PYX_ERR(3, 212, __pyx_L1_error)) + __Pyx_TraceLine(207,0,__PYX_ERR(3, 207, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_v_self->_global->defaultTextEncoding; - __pyx_t_2 = __Pyx_decode_c_string(__pyx_t_1, 0, strlen(__pyx_t_1), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 212, __pyx_L1_error) + __pyx_t_2 = __Pyx_decode_c_string(__pyx_t_1, 0, strlen(__pyx_t_1), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_2); __pyx_r = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "src/pyxpdf/globalconfig.pxi":211 + /* "src/pyxpdf/globalconfig.pxi":206 * * @property * def default_text_encoding(self): # <<<<<<<<<<<<<< @@ -11574,8 +11608,134 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_19_GlobalParamsConfig_21default_text_enc return __pyx_r; } +/* "src/pyxpdf/globalconfig.pxi":13 + * cdef class _GlobalParamsConfig: + * cdef: + * public object cfg_path # <<<<<<<<<<<<<< + * GlobalParams* _global + * public object __doc__ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pyxpdf_4xpdf_19_GlobalParamsConfig_8cfg_path_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pyxpdf_4xpdf_19_GlobalParamsConfig_8cfg_path_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pyxpdf_4xpdf_19_GlobalParamsConfig_8cfg_path___get__(((struct __pyx_obj_6pyxpdf_4xpdf__GlobalParamsConfig *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pyxpdf_4xpdf_19_GlobalParamsConfig_8cfg_path___get__(struct __pyx_obj_6pyxpdf_4xpdf__GlobalParamsConfig *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_TraceCall("__get__", __pyx_f[3], 13, 0, __PYX_ERR(3, 13, __pyx_L1_error)); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->cfg_path); + __pyx_r = __pyx_v_self->cfg_path; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("pyxpdf.xpdf._GlobalParamsConfig.cfg_path.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pyxpdf_4xpdf_19_GlobalParamsConfig_8cfg_path_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pyxpdf_4xpdf_19_GlobalParamsConfig_8cfg_path_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pyxpdf_4xpdf_19_GlobalParamsConfig_8cfg_path_2__set__(((struct __pyx_obj_6pyxpdf_4xpdf__GlobalParamsConfig *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pyxpdf_4xpdf_19_GlobalParamsConfig_8cfg_path_2__set__(struct __pyx_obj_6pyxpdf_4xpdf__GlobalParamsConfig *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_TraceCall("__set__", __pyx_f[3], 13, 0, __PYX_ERR(3, 13, __pyx_L1_error)); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->cfg_path); + __Pyx_DECREF(__pyx_v_self->cfg_path); + __pyx_v_self->cfg_path = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("pyxpdf.xpdf._GlobalParamsConfig.cfg_path.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pyxpdf_4xpdf_19_GlobalParamsConfig_8cfg_path_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pyxpdf_4xpdf_19_GlobalParamsConfig_8cfg_path_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pyxpdf_4xpdf_19_GlobalParamsConfig_8cfg_path_4__del__(((struct __pyx_obj_6pyxpdf_4xpdf__GlobalParamsConfig *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pyxpdf_4xpdf_19_GlobalParamsConfig_8cfg_path_4__del__(struct __pyx_obj_6pyxpdf_4xpdf__GlobalParamsConfig *__pyx_v_self) { + int __pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_TraceCall("__del__", __pyx_f[3], 13, 0, __PYX_ERR(3, 13, __pyx_L1_error)); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->cfg_path); + __Pyx_DECREF(__pyx_v_self->cfg_path); + __pyx_v_self->cfg_path = Py_None; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("pyxpdf.xpdf._GlobalParamsConfig.cfg_path.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* "src/pyxpdf/globalconfig.pxi":15 - * object cfg_path + * public object cfg_path * GlobalParams* _global * public object __doc__ # <<<<<<<<<<<<<< * @@ -15807,12 +15967,11 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_10TextOutput_12__setstate_cython__(CYTHO * #FIXME: buggy as hell, text does not render properly. * cdef bytearray splash_bitmap_to_1bpc_1comp(SplashBitmap *bitmap): # <<<<<<<<<<<<<< * cdef: - * int idx, x, y, i + * int idx, y, i */ static PyObject *__pyx_f_6pyxpdf_4xpdf_splash_bitmap_to_1bpc_1comp(SplashBitmap *__pyx_v_bitmap) { int __pyx_v_idx; - CYTHON_UNUSED int __pyx_v_x; int __pyx_v_y; int __pyx_v_i; int __pyx_v_height; @@ -15821,6 +15980,7 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_splash_bitmap_to_1bpc_1comp(SplashBitmap SplashColorPtr __pyx_v_data; SplashColorPtr __pyx_v_p; PyObject *__pyx_v_img = 0; + CYTHON_UNUSED long __pyx_v__; PyObject *__pyx_r = NULL; __Pyx_TraceDeclarations __Pyx_RefNannyDeclarations @@ -15831,7 +15991,7 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_splash_bitmap_to_1bpc_1comp(SplashBitmap int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; - int __pyx_t_8; + long __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -15840,7 +16000,7 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_splash_bitmap_to_1bpc_1comp(SplashBitmap /* "src/pyxpdf/imageoutput.pxi":43 * cdef: - * int idx, x, y, i + * int idx, y, i * int height = bitmap.getHeight() # <<<<<<<<<<<<<< * int width = bitmap.getWidth() * SplashBitmapRowSize row_size = bitmap.getRowSize() @@ -15849,7 +16009,7 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_splash_bitmap_to_1bpc_1comp(SplashBitmap __pyx_v_height = __pyx_v_bitmap->getHeight(); /* "src/pyxpdf/imageoutput.pxi":44 - * int idx, x, y, i + * int idx, y, i * int height = bitmap.getHeight() * int width = bitmap.getWidth() # <<<<<<<<<<<<<< * SplashBitmapRowSize row_size = bitmap.getRowSize() @@ -15899,7 +16059,7 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_splash_bitmap_to_1bpc_1comp(SplashBitmap * * for y in range(height): # <<<<<<<<<<<<<< * i = 0 - * for x in range(0, width, 8): + * for _ in range(0, width, 8): */ __Pyx_TraceLine(50,0,__PYX_ERR(9, 50, __pyx_L1_error)) __pyx_t_3 = __pyx_v_height; @@ -15911,7 +16071,7 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_splash_bitmap_to_1bpc_1comp(SplashBitmap * * for y in range(height): * i = 0 # <<<<<<<<<<<<<< - * for x in range(0, width, 8): + * for _ in range(0, width, 8): * p = &data[y * row_size + i] */ __Pyx_TraceLine(51,0,__PYX_ERR(9, 51, __pyx_L1_error)) @@ -15920,7 +16080,7 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_splash_bitmap_to_1bpc_1comp(SplashBitmap /* "src/pyxpdf/imageoutput.pxi":52 * for y in range(height): * i = 0 - * for x in range(0, width, 8): # <<<<<<<<<<<<<< + * for _ in range(0, width, 8): # <<<<<<<<<<<<<< * p = &data[y * row_size + i] * idx = y * row_size + i */ @@ -15928,11 +16088,11 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_splash_bitmap_to_1bpc_1comp(SplashBitmap __pyx_t_6 = __pyx_v_width; __pyx_t_7 = __pyx_t_6; for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=8) { - __pyx_v_x = __pyx_t_8; + __pyx_v__ = __pyx_t_8; /* "src/pyxpdf/imageoutput.pxi":53 * i = 0 - * for x in range(0, width, 8): + * for _ in range(0, width, 8): * p = &data[y * row_size + i] # <<<<<<<<<<<<<< * idx = y * row_size + i * img[idx] = p[0] @@ -15941,7 +16101,7 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_splash_bitmap_to_1bpc_1comp(SplashBitmap __pyx_v_p = (&(__pyx_v_data[((__pyx_v_y * __pyx_v_row_size) + __pyx_v_i)])); /* "src/pyxpdf/imageoutput.pxi":54 - * for x in range(0, width, 8): + * for _ in range(0, width, 8): * p = &data[y * row_size + i] * idx = y * row_size + i # <<<<<<<<<<<<<< * img[idx] = p[0] @@ -15993,7 +16153,7 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_splash_bitmap_to_1bpc_1comp(SplashBitmap * #FIXME: buggy as hell, text does not render properly. * cdef bytearray splash_bitmap_to_1bpc_1comp(SplashBitmap *bitmap): # <<<<<<<<<<<<<< * cdef: - * int idx, x, y, i + * int idx, y, i */ /* function exit code */ @@ -19053,7 +19213,6 @@ static SplashBitmap *__pyx_f_6pyxpdf_4xpdf_14RawImageOutput__get_SplashBitmap(st static SplashBitmap *__pyx_f_6pyxpdf_4xpdf_14RawImageOutput__get_normalize_SplashBitmap(struct __pyx_obj_6pyxpdf_4xpdf_RawImageOutput *__pyx_v_self, int __pyx_v_page_no, int __pyx_v_crop_x, int __pyx_v_crop_y, int __pyx_v_crop_h, int __pyx_v_crop_w, double __pyx_v_scale_x, double __pyx_v_scale_y) { int __pyx_v_rotation; - CYTHON_UNUSED int __pyx_v_total_pages; double __pyx_v_page_h; double __pyx_v_page_w; double __pyx_v_tmp; @@ -19076,8 +19235,8 @@ static SplashBitmap *__pyx_f_6pyxpdf_4xpdf_14RawImageOutput__get_normalize_Splas * double scale_y) except NULL: * cdef: * int rotation = 0 # <<<<<<<<<<<<<< - * int total_pages = self.doc.doc.getNumPages() * double page_h = 0 + * double page_w = 0 */ __Pyx_TraceLine(378,0,__PYX_ERR(9, 378, __pyx_L1_error)) __pyx_v_rotation = 0; @@ -19085,88 +19244,78 @@ static SplashBitmap *__pyx_f_6pyxpdf_4xpdf_14RawImageOutput__get_normalize_Splas /* "src/pyxpdf/imageoutput.pxi":379 * cdef: * int rotation = 0 - * int total_pages = self.doc.doc.getNumPages() # <<<<<<<<<<<<<< - * double page_h = 0 - * double page_w = 0 - */ - __Pyx_TraceLine(379,0,__PYX_ERR(9, 379, __pyx_L1_error)) - __pyx_v_total_pages = __pyx_v_self->doc->doc->getNumPages(); - - /* "src/pyxpdf/imageoutput.pxi":380 - * int rotation = 0 - * int total_pages = self.doc.doc.getNumPages() * double page_h = 0 # <<<<<<<<<<<<<< * double page_w = 0 * double tmp */ - __Pyx_TraceLine(380,0,__PYX_ERR(9, 380, __pyx_L1_error)) + __Pyx_TraceLine(379,0,__PYX_ERR(9, 379, __pyx_L1_error)) __pyx_v_page_h = 0.0; - /* "src/pyxpdf/imageoutput.pxi":381 - * int total_pages = self.doc.doc.getNumPages() + /* "src/pyxpdf/imageoutput.pxi":380 + * int rotation = 0 * double page_h = 0 * double page_w = 0 # <<<<<<<<<<<<<< * double tmp * double res_x = self.resolution_x */ - __Pyx_TraceLine(381,0,__PYX_ERR(9, 381, __pyx_L1_error)) + __Pyx_TraceLine(380,0,__PYX_ERR(9, 380, __pyx_L1_error)) __pyx_v_page_w = 0.0; - /* "src/pyxpdf/imageoutput.pxi":383 + /* "src/pyxpdf/imageoutput.pxi":382 * double page_w = 0 * double tmp * double res_x = self.resolution_x # <<<<<<<<<<<<<< * double res_y = self.resolution_y - * SplashBitmap* bitmap + * */ - __Pyx_TraceLine(383,0,__PYX_ERR(9, 383, __pyx_L1_error)) + __Pyx_TraceLine(382,0,__PYX_ERR(9, 382, __pyx_L1_error)) __pyx_t_1 = __pyx_v_self->resolution_x; __pyx_v_res_x = __pyx_t_1; - /* "src/pyxpdf/imageoutput.pxi":384 + /* "src/pyxpdf/imageoutput.pxi":383 * double tmp * double res_x = self.resolution_x * double res_y = self.resolution_y # <<<<<<<<<<<<<< - * SplashBitmap* bitmap * + * if self.use_cropbox: */ - __Pyx_TraceLine(384,0,__PYX_ERR(9, 384, __pyx_L1_error)) + __Pyx_TraceLine(383,0,__PYX_ERR(9, 383, __pyx_L1_error)) __pyx_t_1 = __pyx_v_self->resolution_y; __pyx_v_res_y = __pyx_t_1; - /* "src/pyxpdf/imageoutput.pxi":387 - * SplashBitmap* bitmap + /* "src/pyxpdf/imageoutput.pxi":385 + * double res_y = self.resolution_y * * if self.use_cropbox: # <<<<<<<<<<<<<< * page_h = self.doc.doc.getPageCropHeight(page_no + 1) * page_w = self.doc.doc.getPageCropWidth(page_no + 1) */ - __Pyx_TraceLine(387,0,__PYX_ERR(9, 387, __pyx_L1_error)) + __Pyx_TraceLine(385,0,__PYX_ERR(9, 385, __pyx_L1_error)) __pyx_t_2 = (__pyx_v_self->use_cropbox != 0); if (__pyx_t_2) { - /* "src/pyxpdf/imageoutput.pxi":388 + /* "src/pyxpdf/imageoutput.pxi":386 * * if self.use_cropbox: * page_h = self.doc.doc.getPageCropHeight(page_no + 1) # <<<<<<<<<<<<<< * page_w = self.doc.doc.getPageCropWidth(page_no + 1) * else: */ - __Pyx_TraceLine(388,0,__PYX_ERR(9, 388, __pyx_L1_error)) + __Pyx_TraceLine(386,0,__PYX_ERR(9, 386, __pyx_L1_error)) __pyx_v_page_h = __pyx_v_self->doc->doc->getPageCropHeight((__pyx_v_page_no + 1)); - /* "src/pyxpdf/imageoutput.pxi":389 + /* "src/pyxpdf/imageoutput.pxi":387 * if self.use_cropbox: * page_h = self.doc.doc.getPageCropHeight(page_no + 1) * page_w = self.doc.doc.getPageCropWidth(page_no + 1) # <<<<<<<<<<<<<< * else: * page_h = self.doc.doc.getPageMediaHeight(page_no + 1) */ - __Pyx_TraceLine(389,0,__PYX_ERR(9, 389, __pyx_L1_error)) + __Pyx_TraceLine(387,0,__PYX_ERR(9, 387, __pyx_L1_error)) __pyx_v_page_w = __pyx_v_self->doc->doc->getPageCropWidth((__pyx_v_page_no + 1)); - /* "src/pyxpdf/imageoutput.pxi":387 - * SplashBitmap* bitmap + /* "src/pyxpdf/imageoutput.pxi":385 + * double res_y = self.resolution_y * * if self.use_cropbox: # <<<<<<<<<<<<<< * page_h = self.doc.doc.getPageCropHeight(page_no + 1) @@ -19175,47 +19324,47 @@ static SplashBitmap *__pyx_f_6pyxpdf_4xpdf_14RawImageOutput__get_normalize_Splas goto __pyx_L3; } - /* "src/pyxpdf/imageoutput.pxi":391 + /* "src/pyxpdf/imageoutput.pxi":389 * page_w = self.doc.doc.getPageCropWidth(page_no + 1) * else: * page_h = self.doc.doc.getPageMediaHeight(page_no + 1) # <<<<<<<<<<<<<< * page_w = self.doc.doc.getPageMediaWidth(page_no + 1) * */ - __Pyx_TraceLine(391,0,__PYX_ERR(9, 391, __pyx_L1_error)) + __Pyx_TraceLine(389,0,__PYX_ERR(9, 389, __pyx_L1_error)) /*else*/ { __pyx_v_page_h = __pyx_v_self->doc->doc->getPageMediaHeight((__pyx_v_page_no + 1)); - /* "src/pyxpdf/imageoutput.pxi":392 + /* "src/pyxpdf/imageoutput.pxi":390 * else: * page_h = self.doc.doc.getPageMediaHeight(page_no + 1) * page_w = self.doc.doc.getPageMediaWidth(page_no + 1) # <<<<<<<<<<<<<< * * rotation = self.doc.doc.getPageRotate(page_no + 1) */ - __Pyx_TraceLine(392,0,__PYX_ERR(9, 392, __pyx_L1_error)) + __Pyx_TraceLine(390,0,__PYX_ERR(9, 390, __pyx_L1_error)) __pyx_v_page_w = __pyx_v_self->doc->doc->getPageMediaWidth((__pyx_v_page_no + 1)); } __pyx_L3:; - /* "src/pyxpdf/imageoutput.pxi":394 + /* "src/pyxpdf/imageoutput.pxi":392 * page_w = self.doc.doc.getPageMediaWidth(page_no + 1) * * rotation = self.doc.doc.getPageRotate(page_no + 1) # <<<<<<<<<<<<<< * # swap height and width * if self.scale_before_rotation and (rotation == 90 or rotation == 270): */ - __Pyx_TraceLine(394,0,__PYX_ERR(9, 394, __pyx_L1_error)) + __Pyx_TraceLine(392,0,__PYX_ERR(9, 392, __pyx_L1_error)) __pyx_v_rotation = __pyx_v_self->doc->doc->getPageRotate((__pyx_v_page_no + 1)); - /* "src/pyxpdf/imageoutput.pxi":396 + /* "src/pyxpdf/imageoutput.pxi":394 * rotation = self.doc.doc.getPageRotate(page_no + 1) * # swap height and width * if self.scale_before_rotation and (rotation == 90 or rotation == 270): # <<<<<<<<<<<<<< * # cppalgo.swap(page_h, page_w) * tmp = page_h */ - __Pyx_TraceLine(396,0,__PYX_ERR(9, 396, __pyx_L1_error)) + __Pyx_TraceLine(394,0,__PYX_ERR(9, 394, __pyx_L1_error)) __pyx_t_3 = (__pyx_v_self->scale_before_rotation != 0); if (__pyx_t_3) { } else { @@ -19236,37 +19385,37 @@ static SplashBitmap *__pyx_f_6pyxpdf_4xpdf_14RawImageOutput__get_normalize_Splas __pyx_L5_bool_binop_done:; if (__pyx_t_2) { - /* "src/pyxpdf/imageoutput.pxi":398 + /* "src/pyxpdf/imageoutput.pxi":396 * if self.scale_before_rotation and (rotation == 90 or rotation == 270): * # cppalgo.swap(page_h, page_w) * tmp = page_h # <<<<<<<<<<<<<< * page_h = page_w * page_w = tmp */ - __Pyx_TraceLine(398,0,__PYX_ERR(9, 398, __pyx_L1_error)) + __Pyx_TraceLine(396,0,__PYX_ERR(9, 396, __pyx_L1_error)) __pyx_v_tmp = __pyx_v_page_h; - /* "src/pyxpdf/imageoutput.pxi":399 + /* "src/pyxpdf/imageoutput.pxi":397 * # cppalgo.swap(page_h, page_w) * tmp = page_h * page_h = page_w # <<<<<<<<<<<<<< * page_w = tmp * */ - __Pyx_TraceLine(399,0,__PYX_ERR(9, 399, __pyx_L1_error)) + __Pyx_TraceLine(397,0,__PYX_ERR(9, 397, __pyx_L1_error)) __pyx_v_page_h = __pyx_v_page_w; - /* "src/pyxpdf/imageoutput.pxi":400 + /* "src/pyxpdf/imageoutput.pxi":398 * tmp = page_h * page_h = page_w * page_w = tmp # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(400,0,__PYX_ERR(9, 400, __pyx_L1_error)) + __Pyx_TraceLine(398,0,__PYX_ERR(9, 398, __pyx_L1_error)) __pyx_v_page_w = __pyx_v_tmp; - /* "src/pyxpdf/imageoutput.pxi":396 + /* "src/pyxpdf/imageoutput.pxi":394 * rotation = self.doc.doc.getPageRotate(page_no + 1) * # swap height and width * if self.scale_before_rotation and (rotation == 90 or rotation == 270): # <<<<<<<<<<<<<< @@ -19275,54 +19424,54 @@ static SplashBitmap *__pyx_f_6pyxpdf_4xpdf_14RawImageOutput__get_normalize_Splas */ } - /* "src/pyxpdf/imageoutput.pxi":403 + /* "src/pyxpdf/imageoutput.pxi":401 * * * if scale_x > 0: # <<<<<<<<<<<<<< * res_x = (72.0 * scale_x) / page_w * if scale_y <= 0: */ - __Pyx_TraceLine(403,0,__PYX_ERR(9, 403, __pyx_L1_error)) + __Pyx_TraceLine(401,0,__PYX_ERR(9, 401, __pyx_L1_error)) __pyx_t_2 = ((__pyx_v_scale_x > 0.0) != 0); if (__pyx_t_2) { - /* "src/pyxpdf/imageoutput.pxi":404 + /* "src/pyxpdf/imageoutput.pxi":402 * * if scale_x > 0: * res_x = (72.0 * scale_x) / page_w # <<<<<<<<<<<<<< * if scale_y <= 0: * res_y = res_x */ - __Pyx_TraceLine(404,0,__PYX_ERR(9, 404, __pyx_L1_error)) + __Pyx_TraceLine(402,0,__PYX_ERR(9, 402, __pyx_L1_error)) __pyx_t_1 = (72.0 * __pyx_v_scale_x); if (unlikely(__pyx_v_page_w == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(9, 404, __pyx_L1_error) + __PYX_ERR(9, 402, __pyx_L1_error) } __pyx_v_res_x = (__pyx_t_1 / __pyx_v_page_w); - /* "src/pyxpdf/imageoutput.pxi":405 + /* "src/pyxpdf/imageoutput.pxi":403 * if scale_x > 0: * res_x = (72.0 * scale_x) / page_w * if scale_y <= 0: # <<<<<<<<<<<<<< * res_y = res_x * if scale_y > 0: */ - __Pyx_TraceLine(405,0,__PYX_ERR(9, 405, __pyx_L1_error)) + __Pyx_TraceLine(403,0,__PYX_ERR(9, 403, __pyx_L1_error)) __pyx_t_2 = ((__pyx_v_scale_y <= 0.0) != 0); if (__pyx_t_2) { - /* "src/pyxpdf/imageoutput.pxi":406 + /* "src/pyxpdf/imageoutput.pxi":404 * res_x = (72.0 * scale_x) / page_w * if scale_y <= 0: * res_y = res_x # <<<<<<<<<<<<<< * if scale_y > 0: * res_y = (72.0 * scale_y) / page_h */ - __Pyx_TraceLine(406,0,__PYX_ERR(9, 406, __pyx_L1_error)) + __Pyx_TraceLine(404,0,__PYX_ERR(9, 404, __pyx_L1_error)) __pyx_v_res_y = __pyx_v_res_x; - /* "src/pyxpdf/imageoutput.pxi":405 + /* "src/pyxpdf/imageoutput.pxi":403 * if scale_x > 0: * res_x = (72.0 * scale_x) / page_w * if scale_y <= 0: # <<<<<<<<<<<<<< @@ -19331,7 +19480,7 @@ static SplashBitmap *__pyx_f_6pyxpdf_4xpdf_14RawImageOutput__get_normalize_Splas */ } - /* "src/pyxpdf/imageoutput.pxi":403 + /* "src/pyxpdf/imageoutput.pxi":401 * * * if scale_x > 0: # <<<<<<<<<<<<<< @@ -19340,54 +19489,54 @@ static SplashBitmap *__pyx_f_6pyxpdf_4xpdf_14RawImageOutput__get_normalize_Splas */ } - /* "src/pyxpdf/imageoutput.pxi":407 + /* "src/pyxpdf/imageoutput.pxi":405 * if scale_y <= 0: * res_y = res_x * if scale_y > 0: # <<<<<<<<<<<<<< * res_y = (72.0 * scale_y) / page_h * if scale_x <= 0: */ - __Pyx_TraceLine(407,0,__PYX_ERR(9, 407, __pyx_L1_error)) + __Pyx_TraceLine(405,0,__PYX_ERR(9, 405, __pyx_L1_error)) __pyx_t_2 = ((__pyx_v_scale_y > 0.0) != 0); if (__pyx_t_2) { - /* "src/pyxpdf/imageoutput.pxi":408 + /* "src/pyxpdf/imageoutput.pxi":406 * res_y = res_x * if scale_y > 0: * res_y = (72.0 * scale_y) / page_h # <<<<<<<<<<<<<< * if scale_x <= 0: * res_x = res_y */ - __Pyx_TraceLine(408,0,__PYX_ERR(9, 408, __pyx_L1_error)) + __Pyx_TraceLine(406,0,__PYX_ERR(9, 406, __pyx_L1_error)) __pyx_t_1 = (72.0 * __pyx_v_scale_y); if (unlikely(__pyx_v_page_h == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(9, 408, __pyx_L1_error) + __PYX_ERR(9, 406, __pyx_L1_error) } __pyx_v_res_y = (__pyx_t_1 / __pyx_v_page_h); - /* "src/pyxpdf/imageoutput.pxi":409 + /* "src/pyxpdf/imageoutput.pxi":407 * if scale_y > 0: * res_y = (72.0 * scale_y) / page_h * if scale_x <= 0: # <<<<<<<<<<<<<< * res_x = res_y * */ - __Pyx_TraceLine(409,0,__PYX_ERR(9, 409, __pyx_L1_error)) + __Pyx_TraceLine(407,0,__PYX_ERR(9, 407, __pyx_L1_error)) __pyx_t_2 = ((__pyx_v_scale_x <= 0.0) != 0); if (__pyx_t_2) { - /* "src/pyxpdf/imageoutput.pxi":410 + /* "src/pyxpdf/imageoutput.pxi":408 * res_y = (72.0 * scale_y) / page_h * if scale_x <= 0: * res_x = res_y # <<<<<<<<<<<<<< * * page_w = page_w * (res_x / 72.0) */ - __Pyx_TraceLine(410,0,__PYX_ERR(9, 410, __pyx_L1_error)) + __Pyx_TraceLine(408,0,__PYX_ERR(9, 408, __pyx_L1_error)) __pyx_v_res_x = __pyx_v_res_y; - /* "src/pyxpdf/imageoutput.pxi":409 + /* "src/pyxpdf/imageoutput.pxi":407 * if scale_y > 0: * res_y = (72.0 * scale_y) / page_h * if scale_x <= 0: # <<<<<<<<<<<<<< @@ -19396,7 +19545,7 @@ static SplashBitmap *__pyx_f_6pyxpdf_4xpdf_14RawImageOutput__get_normalize_Splas */ } - /* "src/pyxpdf/imageoutput.pxi":407 + /* "src/pyxpdf/imageoutput.pxi":405 * if scale_y <= 0: * res_y = res_x * if scale_y > 0: # <<<<<<<<<<<<<< @@ -19405,34 +19554,34 @@ static SplashBitmap *__pyx_f_6pyxpdf_4xpdf_14RawImageOutput__get_normalize_Splas */ } - /* "src/pyxpdf/imageoutput.pxi":412 + /* "src/pyxpdf/imageoutput.pxi":410 * res_x = res_y * * page_w = page_w * (res_x / 72.0) # <<<<<<<<<<<<<< * page_h = page_h * (res_y / 72.0) * */ - __Pyx_TraceLine(412,0,__PYX_ERR(9, 412, __pyx_L1_error)) + __Pyx_TraceLine(410,0,__PYX_ERR(9, 410, __pyx_L1_error)) __pyx_v_page_w = (__pyx_v_page_w * (__pyx_v_res_x / 72.0)); - /* "src/pyxpdf/imageoutput.pxi":413 + /* "src/pyxpdf/imageoutput.pxi":411 * * page_w = page_w * (res_x / 72.0) * page_h = page_h * (res_y / 72.0) # <<<<<<<<<<<<<< * * # swap height and width */ - __Pyx_TraceLine(413,0,__PYX_ERR(9, 413, __pyx_L1_error)) + __Pyx_TraceLine(411,0,__PYX_ERR(9, 411, __pyx_L1_error)) __pyx_v_page_h = (__pyx_v_page_h * (__pyx_v_res_y / 72.0)); - /* "src/pyxpdf/imageoutput.pxi":416 + /* "src/pyxpdf/imageoutput.pxi":414 * * # swap height and width * if (not self.scale_before_rotation) and (rotation == 90 or rotation == 270): # <<<<<<<<<<<<<< * # cppalgo.swap(page_h, page_w) * tmp = page_h */ - __Pyx_TraceLine(416,0,__PYX_ERR(9, 416, __pyx_L1_error)) + __Pyx_TraceLine(414,0,__PYX_ERR(9, 414, __pyx_L1_error)) __pyx_t_3 = ((!(__pyx_v_self->scale_before_rotation != 0)) != 0); if (__pyx_t_3) { } else { @@ -19453,37 +19602,37 @@ static SplashBitmap *__pyx_f_6pyxpdf_4xpdf_14RawImageOutput__get_normalize_Splas __pyx_L12_bool_binop_done:; if (__pyx_t_2) { - /* "src/pyxpdf/imageoutput.pxi":418 + /* "src/pyxpdf/imageoutput.pxi":416 * if (not self.scale_before_rotation) and (rotation == 90 or rotation == 270): * # cppalgo.swap(page_h, page_w) * tmp = page_h # <<<<<<<<<<<<<< * page_h = page_w * page_w = tmp */ - __Pyx_TraceLine(418,0,__PYX_ERR(9, 418, __pyx_L1_error)) + __Pyx_TraceLine(416,0,__PYX_ERR(9, 416, __pyx_L1_error)) __pyx_v_tmp = __pyx_v_page_h; - /* "src/pyxpdf/imageoutput.pxi":419 + /* "src/pyxpdf/imageoutput.pxi":417 * # cppalgo.swap(page_h, page_w) * tmp = page_h * page_h = page_w # <<<<<<<<<<<<<< * page_w = tmp * */ - __Pyx_TraceLine(419,0,__PYX_ERR(9, 419, __pyx_L1_error)) + __Pyx_TraceLine(417,0,__PYX_ERR(9, 417, __pyx_L1_error)) __pyx_v_page_h = __pyx_v_page_w; - /* "src/pyxpdf/imageoutput.pxi":420 + /* "src/pyxpdf/imageoutput.pxi":418 * tmp = page_h * page_h = page_w * page_w = tmp # <<<<<<<<<<<<<< * * return self._get_SplashBitmap(page_no, crop_x, crop_y, */ - __Pyx_TraceLine(420,0,__PYX_ERR(9, 420, __pyx_L1_error)) + __Pyx_TraceLine(418,0,__PYX_ERR(9, 418, __pyx_L1_error)) __pyx_v_page_w = __pyx_v_tmp; - /* "src/pyxpdf/imageoutput.pxi":416 + /* "src/pyxpdf/imageoutput.pxi":414 * * # swap height and width * if (not self.scale_before_rotation) and (rotation == 90 or rotation == 270): # <<<<<<<<<<<<<< @@ -19492,15 +19641,15 @@ static SplashBitmap *__pyx_f_6pyxpdf_4xpdf_14RawImageOutput__get_normalize_Splas */ } - /* "src/pyxpdf/imageoutput.pxi":422 + /* "src/pyxpdf/imageoutput.pxi":420 * page_w = tmp * * return self._get_SplashBitmap(page_no, crop_x, crop_y, # <<<<<<<<<<<<<< * crop_h, crop_w, page_h, * page_w, res_x, res_y) */ - __Pyx_TraceLine(422,0,__PYX_ERR(9, 422, __pyx_L1_error)) - __pyx_t_4 = ((struct __pyx_vtabstruct_6pyxpdf_4xpdf_RawImageOutput *)__pyx_v_self->__pyx_vtab)->_get_SplashBitmap(__pyx_v_self, __pyx_v_page_no, __pyx_v_crop_x, __pyx_v_crop_y, __pyx_v_crop_h, __pyx_v_crop_w, __pyx_v_page_h, __pyx_v_page_w, __pyx_v_res_x, __pyx_v_res_y); if (unlikely(__pyx_t_4 == ((SplashBitmap *)NULL))) __PYX_ERR(9, 422, __pyx_L1_error) + __Pyx_TraceLine(420,0,__PYX_ERR(9, 420, __pyx_L1_error)) + __pyx_t_4 = ((struct __pyx_vtabstruct_6pyxpdf_4xpdf_RawImageOutput *)__pyx_v_self->__pyx_vtab)->_get_SplashBitmap(__pyx_v_self, __pyx_v_page_no, __pyx_v_crop_x, __pyx_v_crop_y, __pyx_v_crop_h, __pyx_v_crop_w, __pyx_v_page_h, __pyx_v_page_w, __pyx_v_res_x, __pyx_v_res_y); if (unlikely(__pyx_t_4 == ((SplashBitmap *)NULL))) __PYX_ERR(9, 420, __pyx_L1_error) __pyx_r = __pyx_t_4; goto __pyx_L0; @@ -19522,7 +19671,7 @@ static SplashBitmap *__pyx_f_6pyxpdf_4xpdf_14RawImageOutput__get_normalize_Splas return __pyx_r; } -/* "src/pyxpdf/imageoutput.pxi":429 +/* "src/pyxpdf/imageoutput.pxi":427 * * * cpdef object get(self, int page_no, crop_box=(0,0,0,0), scale_pixel_box = None): # <<<<<<<<<<<<<< @@ -19559,7 +19708,7 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_14RawImageOutput_get(struct __pyx_obj_6py int __pyx_clineno = 0; __Pyx_TraceFrameInit(__pyx_codeobj__59) __Pyx_RefNannySetupContext("get", 0); - __Pyx_TraceCall("get", __pyx_f[9], 429, 0, __PYX_ERR(9, 429, __pyx_L1_error)); + __Pyx_TraceCall("get", __pyx_f[9], 427, 0, __PYX_ERR(9, 427, __pyx_L1_error)); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_crop_box = __pyx_optional_args->crop_box; @@ -19577,11 +19726,11 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_14RawImageOutput_get(struct __pyx_obj_6py if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 429, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6pyxpdf_4xpdf_14RawImageOutput_3get)) { __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_page_no); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 429, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_page_no); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL; @@ -19599,7 +19748,7 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_14RawImageOutput_get(struct __pyx_obj_6py #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_3, __pyx_v_crop_box, __pyx_v_scale_pixel_box}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 429, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 427, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -19608,14 +19757,14 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_14RawImageOutput_get(struct __pyx_obj_6py #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_3, __pyx_v_crop_box, __pyx_v_scale_pixel_box}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 429, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 427, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { - __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 429, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; @@ -19629,7 +19778,7 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_14RawImageOutput_get(struct __pyx_obj_6py __Pyx_GIVEREF(__pyx_v_scale_pixel_box); PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_scale_pixel_box); __pyx_t_3 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 429, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } @@ -19652,19 +19801,19 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_14RawImageOutput_get(struct __pyx_obj_6py #endif } - /* "src/pyxpdf/imageoutput.pxi":452 + /* "src/pyxpdf/imageoutput.pxi":450 * """ * cdef: * int scale_x = scale_pixel_box[0] if scale_pixel_box else 0 # <<<<<<<<<<<<<< * int scale_y = scale_pixel_box[1] if scale_pixel_box else 0 * int total_pages = self.doc.doc.getNumPages() */ - __Pyx_TraceLine(452,0,__PYX_ERR(9, 452, __pyx_L1_error)) - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_scale_pixel_box); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(9, 452, __pyx_L1_error) + __Pyx_TraceLine(450,0,__PYX_ERR(9, 450, __pyx_L1_error)) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_scale_pixel_box); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(9, 450, __pyx_L1_error) if (__pyx_t_8) { - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_scale_pixel_box, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 452, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_scale_pixel_box, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 452, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 450, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __pyx_t_9; } else { @@ -19672,19 +19821,19 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_14RawImageOutput_get(struct __pyx_obj_6py } __pyx_v_scale_x = __pyx_t_6; - /* "src/pyxpdf/imageoutput.pxi":453 + /* "src/pyxpdf/imageoutput.pxi":451 * cdef: * int scale_x = scale_pixel_box[0] if scale_pixel_box else 0 * int scale_y = scale_pixel_box[1] if scale_pixel_box else 0 # <<<<<<<<<<<<<< * int total_pages = self.doc.doc.getNumPages() * SplashBitmap* bitmap */ - __Pyx_TraceLine(453,0,__PYX_ERR(9, 453, __pyx_L1_error)) - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_scale_pixel_box); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(9, 453, __pyx_L1_error) + __Pyx_TraceLine(451,0,__PYX_ERR(9, 451, __pyx_L1_error)) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_scale_pixel_box); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(9, 451, __pyx_L1_error) if (__pyx_t_8) { - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_scale_pixel_box, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 453, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_scale_pixel_box, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 453, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 451, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __pyx_t_9; } else { @@ -19692,38 +19841,38 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_14RawImageOutput_get(struct __pyx_obj_6py } __pyx_v_scale_y = __pyx_t_6; - /* "src/pyxpdf/imageoutput.pxi":454 + /* "src/pyxpdf/imageoutput.pxi":452 * int scale_x = scale_pixel_box[0] if scale_pixel_box else 0 * int scale_y = scale_pixel_box[1] if scale_pixel_box else 0 * int total_pages = self.doc.doc.getNumPages() # <<<<<<<<<<<<<< * SplashBitmap* bitmap * bytearray buff */ - __Pyx_TraceLine(454,0,__PYX_ERR(9, 454, __pyx_L1_error)) + __Pyx_TraceLine(452,0,__PYX_ERR(9, 452, __pyx_L1_error)) __pyx_v_total_pages = __pyx_v_self->doc->doc->getNumPages(); - /* "src/pyxpdf/imageoutput.pxi":458 + /* "src/pyxpdf/imageoutput.pxi":456 * bytearray buff * * if page_no < 0: # <<<<<<<<<<<<<< * page_no = 0 * if page_no >= total_pages: */ - __Pyx_TraceLine(458,0,__PYX_ERR(9, 458, __pyx_L1_error)) + __Pyx_TraceLine(456,0,__PYX_ERR(9, 456, __pyx_L1_error)) __pyx_t_8 = ((__pyx_v_page_no < 0) != 0); if (__pyx_t_8) { - /* "src/pyxpdf/imageoutput.pxi":459 + /* "src/pyxpdf/imageoutput.pxi":457 * * if page_no < 0: * page_no = 0 # <<<<<<<<<<<<<< * if page_no >= total_pages: * page_no = total_pages - 1 */ - __Pyx_TraceLine(459,0,__PYX_ERR(9, 459, __pyx_L1_error)) + __Pyx_TraceLine(457,0,__PYX_ERR(9, 457, __pyx_L1_error)) __pyx_v_page_no = 0; - /* "src/pyxpdf/imageoutput.pxi":458 + /* "src/pyxpdf/imageoutput.pxi":456 * bytearray buff * * if page_no < 0: # <<<<<<<<<<<<<< @@ -19732,28 +19881,28 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_14RawImageOutput_get(struct __pyx_obj_6py */ } - /* "src/pyxpdf/imageoutput.pxi":460 + /* "src/pyxpdf/imageoutput.pxi":458 * if page_no < 0: * page_no = 0 * if page_no >= total_pages: # <<<<<<<<<<<<<< * page_no = total_pages - 1 * */ - __Pyx_TraceLine(460,0,__PYX_ERR(9, 460, __pyx_L1_error)) + __Pyx_TraceLine(458,0,__PYX_ERR(9, 458, __pyx_L1_error)) __pyx_t_8 = ((__pyx_v_page_no >= __pyx_v_total_pages) != 0); if (__pyx_t_8) { - /* "src/pyxpdf/imageoutput.pxi":461 + /* "src/pyxpdf/imageoutput.pxi":459 * page_no = 0 * if page_no >= total_pages: * page_no = total_pages - 1 # <<<<<<<<<<<<<< * * bitmap = self._get_normalize_SplashBitmap(page_no, crop_box[0], crop_box[1], */ - __Pyx_TraceLine(461,0,__PYX_ERR(9, 461, __pyx_L1_error)) + __Pyx_TraceLine(459,0,__PYX_ERR(9, 459, __pyx_L1_error)) __pyx_v_page_no = (__pyx_v_total_pages - 1); - /* "src/pyxpdf/imageoutput.pxi":460 + /* "src/pyxpdf/imageoutput.pxi":458 * if page_no < 0: * page_no = 0 * if page_no >= total_pages: # <<<<<<<<<<<<<< @@ -19762,95 +19911,95 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_14RawImageOutput_get(struct __pyx_obj_6py */ } - /* "src/pyxpdf/imageoutput.pxi":463 + /* "src/pyxpdf/imageoutput.pxi":461 * page_no = total_pages - 1 * * bitmap = self._get_normalize_SplashBitmap(page_no, crop_box[0], crop_box[1], # <<<<<<<<<<<<<< * crop_box[2], crop_box[3], scale_x, * scale_y) */ - __Pyx_TraceLine(463,0,__PYX_ERR(9, 463, __pyx_L1_error)) - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_crop_box, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 463, __pyx_L1_error) + __Pyx_TraceLine(461,0,__PYX_ERR(9, 461, __pyx_L1_error)) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_crop_box, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 463, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 461, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_crop_box, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 463, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_crop_box, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 463, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 461, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "src/pyxpdf/imageoutput.pxi":464 + /* "src/pyxpdf/imageoutput.pxi":462 * * bitmap = self._get_normalize_SplashBitmap(page_no, crop_box[0], crop_box[1], * crop_box[2], crop_box[3], scale_x, # <<<<<<<<<<<<<< * scale_y) * buff = splash_bitmap_to_buffer(bitmap, self.mode) */ - __Pyx_TraceLine(464,0,__PYX_ERR(9, 464, __pyx_L1_error)) - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_crop_box, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 464, __pyx_L1_error) + __Pyx_TraceLine(462,0,__PYX_ERR(9, 462, __pyx_L1_error)) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_crop_box, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 464, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_crop_box, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_crop_box, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 464, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "src/pyxpdf/imageoutput.pxi":463 + /* "src/pyxpdf/imageoutput.pxi":461 * page_no = total_pages - 1 * * bitmap = self._get_normalize_SplashBitmap(page_no, crop_box[0], crop_box[1], # <<<<<<<<<<<<<< * crop_box[2], crop_box[3], scale_x, * scale_y) */ - __Pyx_TraceLine(463,0,__PYX_ERR(9, 463, __pyx_L1_error)) - __pyx_t_12 = ((struct __pyx_vtabstruct_6pyxpdf_4xpdf_RawImageOutput *)__pyx_v_self->__pyx_vtab)->_get_normalize_SplashBitmap(__pyx_v_self, __pyx_v_page_no, __pyx_t_6, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_v_scale_x, __pyx_v_scale_y); if (unlikely(__pyx_t_12 == ((SplashBitmap *)NULL))) __PYX_ERR(9, 463, __pyx_L1_error) + __Pyx_TraceLine(461,0,__PYX_ERR(9, 461, __pyx_L1_error)) + __pyx_t_12 = ((struct __pyx_vtabstruct_6pyxpdf_4xpdf_RawImageOutput *)__pyx_v_self->__pyx_vtab)->_get_normalize_SplashBitmap(__pyx_v_self, __pyx_v_page_no, __pyx_t_6, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_v_scale_x, __pyx_v_scale_y); if (unlikely(__pyx_t_12 == ((SplashBitmap *)NULL))) __PYX_ERR(9, 461, __pyx_L1_error) __pyx_v_bitmap = __pyx_t_12; - /* "src/pyxpdf/imageoutput.pxi":466 + /* "src/pyxpdf/imageoutput.pxi":464 * crop_box[2], crop_box[3], scale_x, * scale_y) * buff = splash_bitmap_to_buffer(bitmap, self.mode) # <<<<<<<<<<<<<< * * return pillow_image_from_buffer(self.mode, bitmap.getHeight(), bitmap.getWidth(), */ - __Pyx_TraceLine(466,0,__PYX_ERR(9, 466, __pyx_L1_error)) + __Pyx_TraceLine(464,0,__PYX_ERR(9, 464, __pyx_L1_error)) __pyx_t_1 = __pyx_v_self->mode; __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = __pyx_f_6pyxpdf_4xpdf_splash_bitmap_to_buffer(__pyx_v_bitmap, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 466, __pyx_L1_error) + __pyx_t_2 = __pyx_f_6pyxpdf_4xpdf_splash_bitmap_to_buffer(__pyx_v_bitmap, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_buff = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "src/pyxpdf/imageoutput.pxi":468 + /* "src/pyxpdf/imageoutput.pxi":466 * buff = splash_bitmap_to_buffer(bitmap, self.mode) * * return pillow_image_from_buffer(self.mode, bitmap.getHeight(), bitmap.getWidth(), # <<<<<<<<<<<<<< * buff) * */ - __Pyx_TraceLine(468,0,__PYX_ERR(9, 468, __pyx_L1_error)) + __Pyx_TraceLine(466,0,__PYX_ERR(9, 466, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_v_self->mode; __Pyx_INCREF(__pyx_t_2); - /* "src/pyxpdf/imageoutput.pxi":469 + /* "src/pyxpdf/imageoutput.pxi":467 * * return pillow_image_from_buffer(self.mode, bitmap.getHeight(), bitmap.getWidth(), * buff) # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(469,0,__PYX_ERR(9, 469, __pyx_L1_error)) - __pyx_t_1 = __pyx_f_6pyxpdf_4xpdf_pillow_image_from_buffer(__pyx_t_2, __pyx_v_bitmap->getHeight(), __pyx_v_bitmap->getWidth(), __pyx_v_buff); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 468, __pyx_L1_error) + __Pyx_TraceLine(467,0,__PYX_ERR(9, 467, __pyx_L1_error)) + __pyx_t_1 = __pyx_f_6pyxpdf_4xpdf_pillow_image_from_buffer(__pyx_t_2, __pyx_v_bitmap->getHeight(), __pyx_v_bitmap->getWidth(), __pyx_v_buff); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "src/pyxpdf/imageoutput.pxi":429 + /* "src/pyxpdf/imageoutput.pxi":427 * * * cpdef object get(self, int page_no, crop_box=(0,0,0,0), scale_pixel_box = None): # <<<<<<<<<<<<<< @@ -19927,7 +20076,7 @@ static PyObject *__pyx_pw_6pyxpdf_4xpdf_14RawImageOutput_3get(PyObject *__pyx_v_ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(9, 429, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(9, 427, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -19940,13 +20089,13 @@ static PyObject *__pyx_pw_6pyxpdf_4xpdf_14RawImageOutput_3get(PyObject *__pyx_v_ default: goto __pyx_L5_argtuple_error; } } - __pyx_v_page_no = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_page_no == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 429, __pyx_L3_error) + __pyx_v_page_no = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_page_no == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 427, __pyx_L3_error) __pyx_v_crop_box = values[1]; __pyx_v_scale_pixel_box = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("get", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 429, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 427, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pyxpdf.xpdf.RawImageOutput.get", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -19970,12 +20119,12 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_14RawImageOutput_2get(struct __pyx_obj_6 int __pyx_clineno = 0; __Pyx_TraceFrameInit(__pyx_codeobj__59) __Pyx_RefNannySetupContext("get", 0); - __Pyx_TraceCall("get (wrapper)", __pyx_f[9], 429, 0, __PYX_ERR(9, 429, __pyx_L1_error)); + __Pyx_TraceCall("get (wrapper)", __pyx_f[9], 427, 0, __PYX_ERR(9, 427, __pyx_L1_error)); __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 2; __pyx_t_2.crop_box = __pyx_v_crop_box; __pyx_t_2.scale_pixel_box = __pyx_v_scale_pixel_box; - __pyx_t_1 = __pyx_vtabptr_6pyxpdf_4xpdf_RawImageOutput->get(__pyx_v_self, __pyx_v_page_no, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 429, __pyx_L1_error) + __pyx_t_1 = __pyx_vtabptr_6pyxpdf_4xpdf_RawImageOutput->get(__pyx_v_self, __pyx_v_page_no, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -20564,7 +20713,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_14RawImageOutput_6__setstate_cython__(CY return __pyx_r; } -/* "src/pyxpdf/imageoutput.pxi":566 +/* "src/pyxpdf/imageoutput.pxi":564 * * @staticmethod * cdef PDFImage from_ptr(PDFBitmapImage *c_img): # <<<<<<<<<<<<<< @@ -20594,49 +20743,49 @@ static struct __pyx_obj_6pyxpdf_4xpdf_PDFImage *__pyx_f_6pyxpdf_4xpdf_8PDFImage_ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("from_ptr", 0); - __Pyx_TraceCall("from_ptr", __pyx_f[9], 566, 0, __PYX_ERR(9, 566, __pyx_L1_error)); + __Pyx_TraceCall("from_ptr", __pyx_f[9], 564, 0, __PYX_ERR(9, 564, __pyx_L1_error)); - /* "src/pyxpdf/imageoutput.pxi":568 + /* "src/pyxpdf/imageoutput.pxi":566 * cdef PDFImage from_ptr(PDFBitmapImage *c_img): * cdef: * PDFImage img = PDFImage.__new__(PDFImage) # <<<<<<<<<<<<<< * SplashBitmap *bmap * object mode */ - __Pyx_TraceLine(568,0,__PYX_ERR(9, 568, __pyx_L1_error)) - __pyx_t_1 = ((PyObject *)__pyx_tp_new_6pyxpdf_4xpdf_PDFImage(((PyTypeObject *)__pyx_ptype_6pyxpdf_4xpdf_PDFImage), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 568, __pyx_L1_error) + __Pyx_TraceLine(566,0,__PYX_ERR(9, 566, __pyx_L1_error)) + __pyx_t_1 = ((PyObject *)__pyx_tp_new_6pyxpdf_4xpdf_PDFImage(((PyTypeObject *)__pyx_ptype_6pyxpdf_4xpdf_PDFImage), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 566, __pyx_L1_error) __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __pyx_v_img = ((struct __pyx_obj_6pyxpdf_4xpdf_PDFImage *)__pyx_t_1); __pyx_t_1 = 0; - /* "src/pyxpdf/imageoutput.pxi":571 + /* "src/pyxpdf/imageoutput.pxi":569 * SplashBitmap *bmap * object mode * img.page_index = c_img.pageNum # <<<<<<<<<<<<<< * img.bbox = (c_img.x1, c_img.y1, c_img.x2, c_img.y2) * img.hDPI = c_img.hDPI */ - __Pyx_TraceLine(571,0,__PYX_ERR(9, 571, __pyx_L1_error)) + __Pyx_TraceLine(569,0,__PYX_ERR(9, 569, __pyx_L1_error)) __pyx_t_2 = __pyx_v_c_img->pageNum; __pyx_v_img->page_index = __pyx_t_2; - /* "src/pyxpdf/imageoutput.pxi":572 + /* "src/pyxpdf/imageoutput.pxi":570 * object mode * img.page_index = c_img.pageNum * img.bbox = (c_img.x1, c_img.y1, c_img.x2, c_img.y2) # <<<<<<<<<<<<<< * img.hDPI = c_img.hDPI * img.vDPI = c_img.vDPI */ - __Pyx_TraceLine(572,0,__PYX_ERR(9, 572, __pyx_L1_error)) - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_c_img->x1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 572, __pyx_L1_error) + __Pyx_TraceLine(570,0,__PYX_ERR(9, 570, __pyx_L1_error)) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_c_img->x1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_c_img->y1); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 572, __pyx_L1_error) + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_c_img->y1); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyFloat_FromDouble(__pyx_v_c_img->x2); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 572, __pyx_L1_error) + __pyx_t_4 = PyFloat_FromDouble(__pyx_v_c_img->x2); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyFloat_FromDouble(__pyx_v_c_img->y2); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 572, __pyx_L1_error) + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_c_img->y2); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 572, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); @@ -20656,36 +20805,36 @@ static struct __pyx_obj_6pyxpdf_4xpdf_PDFImage *__pyx_f_6pyxpdf_4xpdf_8PDFImage_ __pyx_v_img->bbox = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; - /* "src/pyxpdf/imageoutput.pxi":573 + /* "src/pyxpdf/imageoutput.pxi":571 * img.page_index = c_img.pageNum * img.bbox = (c_img.x1, c_img.y1, c_img.x2, c_img.y2) * img.hDPI = c_img.hDPI # <<<<<<<<<<<<<< * img.vDPI = c_img.vDPI * */ - __Pyx_TraceLine(573,0,__PYX_ERR(9, 573, __pyx_L1_error)) + __Pyx_TraceLine(571,0,__PYX_ERR(9, 571, __pyx_L1_error)) __pyx_t_7 = __pyx_v_c_img->hDPI; __pyx_v_img->hDPI = __pyx_t_7; - /* "src/pyxpdf/imageoutput.pxi":574 + /* "src/pyxpdf/imageoutput.pxi":572 * img.bbox = (c_img.x1, c_img.y1, c_img.x2, c_img.y2) * img.hDPI = c_img.hDPI * img.vDPI = c_img.vDPI # <<<<<<<<<<<<<< * * img.interpolate = True if c_img.interpolate == gTrue else False */ - __Pyx_TraceLine(574,0,__PYX_ERR(9, 574, __pyx_L1_error)) + __Pyx_TraceLine(572,0,__PYX_ERR(9, 572, __pyx_L1_error)) __pyx_t_7 = __pyx_v_c_img->vDPI; __pyx_v_img->vDPI = __pyx_t_7; - /* "src/pyxpdf/imageoutput.pxi":576 + /* "src/pyxpdf/imageoutput.pxi":574 * img.vDPI = c_img.vDPI * * img.interpolate = True if c_img.interpolate == gTrue else False # <<<<<<<<<<<<<< * img.is_inline = True if c_img.inlineImg == gTrue else False * */ - __Pyx_TraceLine(576,0,__PYX_ERR(9, 576, __pyx_L1_error)) + __Pyx_TraceLine(574,0,__PYX_ERR(9, 574, __pyx_L1_error)) if (((__pyx_v_c_img->interpolate == gTrue) != 0)) { __pyx_t_8 = 1; } else { @@ -20693,14 +20842,14 @@ static struct __pyx_obj_6pyxpdf_4xpdf_PDFImage *__pyx_f_6pyxpdf_4xpdf_8PDFImage_ } __pyx_v_img->interpolate = __pyx_t_8; - /* "src/pyxpdf/imageoutput.pxi":577 + /* "src/pyxpdf/imageoutput.pxi":575 * * img.interpolate = True if c_img.interpolate == gTrue else False * img.is_inline = True if c_img.inlineImg == gTrue else False # <<<<<<<<<<<<<< * * cs = GFX_COLOR_SPACE_NAMES.get(c_img.colorspace, None) */ - __Pyx_TraceLine(577,0,__PYX_ERR(9, 577, __pyx_L1_error)) + __Pyx_TraceLine(575,0,__PYX_ERR(9, 575, __pyx_L1_error)) if (((__pyx_v_c_img->inlineImg == gTrue) != 0)) { __pyx_t_8 = 1; } else { @@ -20708,36 +20857,36 @@ static struct __pyx_obj_6pyxpdf_4xpdf_PDFImage *__pyx_f_6pyxpdf_4xpdf_8PDFImage_ } __pyx_v_img->is_inline = __pyx_t_8; - /* "src/pyxpdf/imageoutput.pxi":579 + /* "src/pyxpdf/imageoutput.pxi":577 * img.is_inline = True if c_img.inlineImg == gTrue else False * * cs = GFX_COLOR_SPACE_NAMES.get(c_img.colorspace, None) # <<<<<<<<<<<<<< * img.colorspace = cs if cs != None else "unknown" * */ - __Pyx_TraceLine(579,0,__PYX_ERR(9, 579, __pyx_L1_error)) + __Pyx_TraceLine(577,0,__PYX_ERR(9, 577, __pyx_L1_error)) if (unlikely(__pyx_v_6pyxpdf_4xpdf_GFX_COLOR_SPACE_NAMES == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); - __PYX_ERR(9, 579, __pyx_L1_error) + __PYX_ERR(9, 577, __pyx_L1_error) } - __pyx_t_6 = __Pyx_PyInt_From_GfxColorSpaceMode(__pyx_v_c_img->colorspace); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 579, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_GfxColorSpaceMode(__pyx_v_c_img->colorspace); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyDict_GetItemDefault(__pyx_v_6pyxpdf_4xpdf_GFX_COLOR_SPACE_NAMES, __pyx_t_6, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 579, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_GetItemDefault(__pyx_v_6pyxpdf_4xpdf_GFX_COLOR_SPACE_NAMES, __pyx_t_6, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_cs = __pyx_t_5; __pyx_t_5 = 0; - /* "src/pyxpdf/imageoutput.pxi":580 + /* "src/pyxpdf/imageoutput.pxi":578 * * cs = GFX_COLOR_SPACE_NAMES.get(c_img.colorspace, None) * img.colorspace = cs if cs != None else "unknown" # <<<<<<<<<<<<<< * * img.bpc = c_img.bpc */ - __Pyx_TraceLine(580,0,__PYX_ERR(9, 580, __pyx_L1_error)) - __pyx_t_6 = PyObject_RichCompare(__pyx_v_cs, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 580, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(9, 580, __pyx_L1_error) + __Pyx_TraceLine(578,0,__PYX_ERR(9, 578, __pyx_L1_error)) + __pyx_t_6 = PyObject_RichCompare(__pyx_v_cs, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 578, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(9, 578, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_8) { __Pyx_INCREF(__pyx_v_cs); @@ -20752,58 +20901,58 @@ static struct __pyx_obj_6pyxpdf_4xpdf_PDFImage *__pyx_f_6pyxpdf_4xpdf_8PDFImage_ __pyx_v_img->colorspace = __pyx_t_5; __pyx_t_5 = 0; - /* "src/pyxpdf/imageoutput.pxi":582 + /* "src/pyxpdf/imageoutput.pxi":580 * img.colorspace = cs if cs != None else "unknown" * * img.bpc = c_img.bpc # <<<<<<<<<<<<<< * img.components = c_img.components * */ - __Pyx_TraceLine(582,0,__PYX_ERR(9, 582, __pyx_L1_error)) + __Pyx_TraceLine(580,0,__PYX_ERR(9, 580, __pyx_L1_error)) __pyx_t_2 = __pyx_v_c_img->bpc; __pyx_v_img->bpc = __pyx_t_2; - /* "src/pyxpdf/imageoutput.pxi":583 + /* "src/pyxpdf/imageoutput.pxi":581 * * img.bpc = c_img.bpc * img.components = c_img.components # <<<<<<<<<<<<<< * * comp = IMAGE_STREAM_TYPES.get(c_img.compression, None) */ - __Pyx_TraceLine(583,0,__PYX_ERR(9, 583, __pyx_L1_error)) + __Pyx_TraceLine(581,0,__PYX_ERR(9, 581, __pyx_L1_error)) __pyx_t_2 = __pyx_v_c_img->components; __pyx_v_img->components = __pyx_t_2; - /* "src/pyxpdf/imageoutput.pxi":585 + /* "src/pyxpdf/imageoutput.pxi":583 * img.components = c_img.components * * comp = IMAGE_STREAM_TYPES.get(c_img.compression, None) # <<<<<<<<<<<<<< * img.compression = comp if comp != None else "unknown" * */ - __Pyx_TraceLine(585,0,__PYX_ERR(9, 585, __pyx_L1_error)) + __Pyx_TraceLine(583,0,__PYX_ERR(9, 583, __pyx_L1_error)) if (unlikely(__pyx_v_6pyxpdf_4xpdf_IMAGE_STREAM_TYPES == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); - __PYX_ERR(9, 585, __pyx_L1_error) + __PYX_ERR(9, 583, __pyx_L1_error) } - __pyx_t_5 = __Pyx_PyInt_From_StreamKind(__pyx_v_c_img->compression); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 585, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_StreamKind(__pyx_v_c_img->compression); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyDict_GetItemDefault(__pyx_v_6pyxpdf_4xpdf_IMAGE_STREAM_TYPES, __pyx_t_5, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 585, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_GetItemDefault(__pyx_v_6pyxpdf_4xpdf_IMAGE_STREAM_TYPES, __pyx_t_5, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_comp = __pyx_t_6; __pyx_t_6 = 0; - /* "src/pyxpdf/imageoutput.pxi":586 + /* "src/pyxpdf/imageoutput.pxi":584 * * comp = IMAGE_STREAM_TYPES.get(c_img.compression, None) * img.compression = comp if comp != None else "unknown" # <<<<<<<<<<<<<< * * # image_type */ - __Pyx_TraceLine(586,0,__PYX_ERR(9, 586, __pyx_L1_error)) - __pyx_t_5 = PyObject_RichCompare(__pyx_v_comp, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 586, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(9, 586, __pyx_L1_error) + __Pyx_TraceLine(584,0,__PYX_ERR(9, 584, __pyx_L1_error)) + __pyx_t_5 = PyObject_RichCompare(__pyx_v_comp, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 584, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(9, 584, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_8) { __Pyx_INCREF(__pyx_v_comp); @@ -20818,32 +20967,32 @@ static struct __pyx_obj_6pyxpdf_4xpdf_PDFImage *__pyx_f_6pyxpdf_4xpdf_8PDFImage_ __pyx_v_img->compression = __pyx_t_6; __pyx_t_6 = 0; - /* "src/pyxpdf/imageoutput.pxi":589 + /* "src/pyxpdf/imageoutput.pxi":587 * * # image_type * if c_img.imgType == ImageType.imgImage: # <<<<<<<<<<<<<< * img.image_type = "image" * elif c_img.imgType == ImageType.imgStencil: */ - __Pyx_TraceLine(589,0,__PYX_ERR(9, 589, __pyx_L1_error)) + __Pyx_TraceLine(587,0,__PYX_ERR(9, 587, __pyx_L1_error)) switch (__pyx_v_c_img->imgType) { case imgImage: - /* "src/pyxpdf/imageoutput.pxi":590 + /* "src/pyxpdf/imageoutput.pxi":588 * # image_type * if c_img.imgType == ImageType.imgImage: * img.image_type = "image" # <<<<<<<<<<<<<< * elif c_img.imgType == ImageType.imgStencil: * img.image_type = "stencil" */ - __Pyx_TraceLine(590,0,__PYX_ERR(9, 590, __pyx_L1_error)) + __Pyx_TraceLine(588,0,__PYX_ERR(9, 588, __pyx_L1_error)) __Pyx_INCREF(__pyx_n_u_image); __Pyx_GIVEREF(__pyx_n_u_image); __Pyx_GOTREF(__pyx_v_img->image_type); __Pyx_DECREF(__pyx_v_img->image_type); __pyx_v_img->image_type = __pyx_n_u_image; - /* "src/pyxpdf/imageoutput.pxi":589 + /* "src/pyxpdf/imageoutput.pxi":587 * * # image_type * if c_img.imgType == ImageType.imgImage: # <<<<<<<<<<<<<< @@ -20853,21 +21002,21 @@ static struct __pyx_obj_6pyxpdf_4xpdf_PDFImage *__pyx_f_6pyxpdf_4xpdf_8PDFImage_ break; case imgStencil: - /* "src/pyxpdf/imageoutput.pxi":592 + /* "src/pyxpdf/imageoutput.pxi":590 * img.image_type = "image" * elif c_img.imgType == ImageType.imgStencil: * img.image_type = "stencil" # <<<<<<<<<<<<<< * elif c_img.imgType == ImageType.imgMask: * img.image_type = "mask" */ - __Pyx_TraceLine(592,0,__PYX_ERR(9, 592, __pyx_L1_error)) + __Pyx_TraceLine(590,0,__PYX_ERR(9, 590, __pyx_L1_error)) __Pyx_INCREF(__pyx_n_u_stencil); __Pyx_GIVEREF(__pyx_n_u_stencil); __Pyx_GOTREF(__pyx_v_img->image_type); __Pyx_DECREF(__pyx_v_img->image_type); __pyx_v_img->image_type = __pyx_n_u_stencil; - /* "src/pyxpdf/imageoutput.pxi":591 + /* "src/pyxpdf/imageoutput.pxi":589 * if c_img.imgType == ImageType.imgImage: * img.image_type = "image" * elif c_img.imgType == ImageType.imgStencil: # <<<<<<<<<<<<<< @@ -20877,21 +21026,21 @@ static struct __pyx_obj_6pyxpdf_4xpdf_PDFImage *__pyx_f_6pyxpdf_4xpdf_8PDFImage_ break; case imgMask: - /* "src/pyxpdf/imageoutput.pxi":594 + /* "src/pyxpdf/imageoutput.pxi":592 * img.image_type = "stencil" * elif c_img.imgType == ImageType.imgMask: * img.image_type = "mask" # <<<<<<<<<<<<<< * elif c_img.imgType == ImageType.imgSmask: * img.image_type = "smask" */ - __Pyx_TraceLine(594,0,__PYX_ERR(9, 594, __pyx_L1_error)) + __Pyx_TraceLine(592,0,__PYX_ERR(9, 592, __pyx_L1_error)) __Pyx_INCREF(__pyx_n_u_mask); __Pyx_GIVEREF(__pyx_n_u_mask); __Pyx_GOTREF(__pyx_v_img->image_type); __Pyx_DECREF(__pyx_v_img->image_type); __pyx_v_img->image_type = __pyx_n_u_mask; - /* "src/pyxpdf/imageoutput.pxi":593 + /* "src/pyxpdf/imageoutput.pxi":591 * elif c_img.imgType == ImageType.imgStencil: * img.image_type = "stencil" * elif c_img.imgType == ImageType.imgMask: # <<<<<<<<<<<<<< @@ -20901,21 +21050,21 @@ static struct __pyx_obj_6pyxpdf_4xpdf_PDFImage *__pyx_f_6pyxpdf_4xpdf_8PDFImage_ break; case imgSmask: - /* "src/pyxpdf/imageoutput.pxi":596 + /* "src/pyxpdf/imageoutput.pxi":594 * img.image_type = "mask" * elif c_img.imgType == ImageType.imgSmask: * img.image_type = "smask" # <<<<<<<<<<<<<< * else: * raise ValueError(f"unexpected value of imgType") */ - __Pyx_TraceLine(596,0,__PYX_ERR(9, 596, __pyx_L1_error)) + __Pyx_TraceLine(594,0,__PYX_ERR(9, 594, __pyx_L1_error)) __Pyx_INCREF(__pyx_n_u_smask); __Pyx_GIVEREF(__pyx_n_u_smask); __Pyx_GOTREF(__pyx_v_img->image_type); __Pyx_DECREF(__pyx_v_img->image_type); __pyx_v_img->image_type = __pyx_n_u_smask; - /* "src/pyxpdf/imageoutput.pxi":595 + /* "src/pyxpdf/imageoutput.pxi":593 * elif c_img.imgType == ImageType.imgMask: * img.image_type = "mask" * elif c_img.imgType == ImageType.imgSmask: # <<<<<<<<<<<<<< @@ -20925,55 +21074,55 @@ static struct __pyx_obj_6pyxpdf_4xpdf_PDFImage *__pyx_f_6pyxpdf_4xpdf_8PDFImage_ break; default: - /* "src/pyxpdf/imageoutput.pxi":598 + /* "src/pyxpdf/imageoutput.pxi":596 * img.image_type = "smask" * else: * raise ValueError(f"unexpected value of imgType") # <<<<<<<<<<<<<< * * bmap = c_img.bitmap.get() */ - __Pyx_TraceLine(598,0,__PYX_ERR(9, 598, __pyx_L1_error)) - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 598, __pyx_L1_error) + __Pyx_TraceLine(596,0,__PYX_ERR(9, 596, __pyx_L1_error)) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(9, 598, __pyx_L1_error) + __PYX_ERR(9, 596, __pyx_L1_error) break; } - /* "src/pyxpdf/imageoutput.pxi":600 + /* "src/pyxpdf/imageoutput.pxi":598 * raise ValueError(f"unexpected value of imgType") * * bmap = c_img.bitmap.get() # <<<<<<<<<<<<<< * if c_img.bitmapColorMode == SplashColorMode.splashModeMono1: * mode = "1" */ - __Pyx_TraceLine(600,0,__PYX_ERR(9, 600, __pyx_L1_error)) + __Pyx_TraceLine(598,0,__PYX_ERR(9, 598, __pyx_L1_error)) __pyx_v_bmap = __pyx_v_c_img->bitmap.get(); - /* "src/pyxpdf/imageoutput.pxi":601 + /* "src/pyxpdf/imageoutput.pxi":599 * * bmap = c_img.bitmap.get() * if c_img.bitmapColorMode == SplashColorMode.splashModeMono1: # <<<<<<<<<<<<<< * mode = "1" * elif c_img.bitmapColorMode == SplashColorMode.splashModeMono8: */ - __Pyx_TraceLine(601,0,__PYX_ERR(9, 601, __pyx_L1_error)) + __Pyx_TraceLine(599,0,__PYX_ERR(9, 599, __pyx_L1_error)) switch (__pyx_v_c_img->bitmapColorMode) { case splashModeMono1: - /* "src/pyxpdf/imageoutput.pxi":602 + /* "src/pyxpdf/imageoutput.pxi":600 * bmap = c_img.bitmap.get() * if c_img.bitmapColorMode == SplashColorMode.splashModeMono1: * mode = "1" # <<<<<<<<<<<<<< * elif c_img.bitmapColorMode == SplashColorMode.splashModeMono8: * mode = "L" */ - __Pyx_TraceLine(602,0,__PYX_ERR(9, 602, __pyx_L1_error)) + __Pyx_TraceLine(600,0,__PYX_ERR(9, 600, __pyx_L1_error)) __Pyx_INCREF(__pyx_kp_u_1); __pyx_v_mode = __pyx_kp_u_1; - /* "src/pyxpdf/imageoutput.pxi":601 + /* "src/pyxpdf/imageoutput.pxi":599 * * bmap = c_img.bitmap.get() * if c_img.bitmapColorMode == SplashColorMode.splashModeMono1: # <<<<<<<<<<<<<< @@ -20983,18 +21132,18 @@ static struct __pyx_obj_6pyxpdf_4xpdf_PDFImage *__pyx_f_6pyxpdf_4xpdf_8PDFImage_ break; case splashModeMono8: - /* "src/pyxpdf/imageoutput.pxi":604 + /* "src/pyxpdf/imageoutput.pxi":602 * mode = "1" * elif c_img.bitmapColorMode == SplashColorMode.splashModeMono8: * mode = "L" # <<<<<<<<<<<<<< * elif c_img.bitmapColorMode == SplashColorMode.splashModeRGB8: * mode = "RGB" */ - __Pyx_TraceLine(604,0,__PYX_ERR(9, 604, __pyx_L1_error)) + __Pyx_TraceLine(602,0,__PYX_ERR(9, 602, __pyx_L1_error)) __Pyx_INCREF(__pyx_n_u_L); __pyx_v_mode = __pyx_n_u_L; - /* "src/pyxpdf/imageoutput.pxi":603 + /* "src/pyxpdf/imageoutput.pxi":601 * if c_img.bitmapColorMode == SplashColorMode.splashModeMono1: * mode = "1" * elif c_img.bitmapColorMode == SplashColorMode.splashModeMono8: # <<<<<<<<<<<<<< @@ -21004,51 +21153,64 @@ static struct __pyx_obj_6pyxpdf_4xpdf_PDFImage *__pyx_f_6pyxpdf_4xpdf_8PDFImage_ break; case splashModeRGB8: - /* "src/pyxpdf/imageoutput.pxi":606 + /* "src/pyxpdf/imageoutput.pxi":604 * mode = "L" * elif c_img.bitmapColorMode == SplashColorMode.splashModeRGB8: * mode = "RGB" # <<<<<<<<<<<<<< - * buff = splash_bitmap_to_buffer(bmap, mode) - * img.image = pillow_image_from_buffer(mode, bmap.getHeight(), bmap.getWidth(), buff) + * else: + * raise XPDFInternalError(f"Unsupported Bitmap SplashColorMode.") */ - __Pyx_TraceLine(606,0,__PYX_ERR(9, 606, __pyx_L1_error)) + __Pyx_TraceLine(604,0,__PYX_ERR(9, 604, __pyx_L1_error)) __Pyx_INCREF(__pyx_n_u_RGB); __pyx_v_mode = __pyx_n_u_RGB; - /* "src/pyxpdf/imageoutput.pxi":605 + /* "src/pyxpdf/imageoutput.pxi":603 * elif c_img.bitmapColorMode == SplashColorMode.splashModeMono8: * mode = "L" * elif c_img.bitmapColorMode == SplashColorMode.splashModeRGB8: # <<<<<<<<<<<<<< * mode = "RGB" + * else: + */ + break; + default: + + /* "src/pyxpdf/imageoutput.pxi":606 + * mode = "RGB" + * else: + * raise XPDFInternalError(f"Unsupported Bitmap SplashColorMode.") # <<<<<<<<<<<<<< * buff = splash_bitmap_to_buffer(bmap, mode) + * img.image = pillow_image_from_buffer(mode, bmap.getHeight(), bmap.getWidth(), buff) */ + __Pyx_TraceLine(606,0,__PYX_ERR(9, 606, __pyx_L1_error)) + __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6pyxpdf_4xpdf_XPDFInternalError), __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 606, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_ERR(9, 606, __pyx_L1_error) break; - default: break; } /* "src/pyxpdf/imageoutput.pxi":607 - * elif c_img.bitmapColorMode == SplashColorMode.splashModeRGB8: - * mode = "RGB" + * else: + * raise XPDFInternalError(f"Unsupported Bitmap SplashColorMode.") * buff = splash_bitmap_to_buffer(bmap, mode) # <<<<<<<<<<<<<< * img.image = pillow_image_from_buffer(mode, bmap.getHeight(), bmap.getWidth(), buff) * */ __Pyx_TraceLine(607,0,__PYX_ERR(9, 607, __pyx_L1_error)) - if (unlikely(!__pyx_v_mode)) { __Pyx_RaiseUnboundLocalError("mode"); __PYX_ERR(9, 607, __pyx_L1_error) } __pyx_t_6 = __pyx_f_6pyxpdf_4xpdf_splash_bitmap_to_buffer(__pyx_v_bmap, __pyx_v_mode); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_buff = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; /* "src/pyxpdf/imageoutput.pxi":608 - * mode = "RGB" + * raise XPDFInternalError(f"Unsupported Bitmap SplashColorMode.") * buff = splash_bitmap_to_buffer(bmap, mode) * img.image = pillow_image_from_buffer(mode, bmap.getHeight(), bmap.getWidth(), buff) # <<<<<<<<<<<<<< * * return img */ __Pyx_TraceLine(608,0,__PYX_ERR(9, 608, __pyx_L1_error)) - if (unlikely(!__pyx_v_mode)) { __Pyx_RaiseUnboundLocalError("mode"); __PYX_ERR(9, 608, __pyx_L1_error) } __pyx_t_6 = __pyx_f_6pyxpdf_4xpdf_pillow_image_from_buffer(__pyx_v_mode, __pyx_v_bmap->getHeight(), __pyx_v_bmap->getWidth(), __pyx_v_buff); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); @@ -21070,7 +21232,7 @@ static struct __pyx_obj_6pyxpdf_4xpdf_PDFImage *__pyx_f_6pyxpdf_4xpdf_8PDFImage_ __pyx_r = __pyx_v_img; goto __pyx_L0; - /* "src/pyxpdf/imageoutput.pxi":566 + /* "src/pyxpdf/imageoutput.pxi":564 * * @staticmethod * cdef PDFImage from_ptr(PDFBitmapImage *c_img): # <<<<<<<<<<<<<< @@ -21191,10 +21353,10 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8PDFImage___repr__(struct __pyx_obj_6pyx __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 7, __pyx_t_4); __pyx_t_4 = 0; - __Pyx_INCREF(__pyx_kp_u__65); + __Pyx_INCREF(__pyx_kp_u__66); __pyx_t_2 += 1; - __Pyx_GIVEREF(__pyx_kp_u__65); - PyTuple_SET_ITEM(__pyx_t_1, 8, __pyx_kp_u__65); + __Pyx_GIVEREF(__pyx_kp_u__66); + PyTuple_SET_ITEM(__pyx_t_1, 8, __pyx_kp_u__66); __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 9, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -21223,7 +21385,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8PDFImage___repr__(struct __pyx_obj_6pyx return __pyx_r; } -/* "src/pyxpdf/imageoutput.pxi":552 +/* "src/pyxpdf/imageoutput.pxi":550 * * cdef: * readonly tuple bbox # <<<<<<<<<<<<<< @@ -21252,7 +21414,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8PDFImage_4bbox___get__(struct __pyx_obj const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[9], 552, 0, __PYX_ERR(9, 552, __pyx_L1_error)); + __Pyx_TraceCall("__get__", __pyx_f[9], 550, 0, __PYX_ERR(9, 550, __pyx_L1_error)); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->bbox); __pyx_r = __pyx_v_self->bbox; @@ -21269,7 +21431,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8PDFImage_4bbox___get__(struct __pyx_obj return __pyx_r; } -/* "src/pyxpdf/imageoutput.pxi":553 +/* "src/pyxpdf/imageoutput.pxi":551 * cdef: * readonly tuple bbox * readonly int page_index # <<<<<<<<<<<<<< @@ -21299,9 +21461,9 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8PDFImage_10page_index___get__(struct __ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[9], 553, 0, __PYX_ERR(9, 553, __pyx_L1_error)); + __Pyx_TraceCall("__get__", __pyx_f[9], 551, 0, __PYX_ERR(9, 551, __pyx_L1_error)); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->page_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 553, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->page_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -21319,7 +21481,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8PDFImage_10page_index___get__(struct __ return __pyx_r; } -/* "src/pyxpdf/imageoutput.pxi":554 +/* "src/pyxpdf/imageoutput.pxi":552 * readonly tuple bbox * readonly int page_index * readonly bint interpolate # <<<<<<<<<<<<<< @@ -21349,9 +21511,9 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8PDFImage_11interpolate___get__(struct _ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[9], 554, 0, __PYX_ERR(9, 554, __pyx_L1_error)); + __Pyx_TraceCall("__get__", __pyx_f[9], 552, 0, __PYX_ERR(9, 552, __pyx_L1_error)); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->interpolate); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 554, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->interpolate); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -21369,7 +21531,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8PDFImage_11interpolate___get__(struct _ return __pyx_r; } -/* "src/pyxpdf/imageoutput.pxi":555 +/* "src/pyxpdf/imageoutput.pxi":553 * readonly int page_index * readonly bint interpolate * readonly bint is_inline # <<<<<<<<<<<<<< @@ -21399,9 +21561,9 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8PDFImage_9is_inline___get__(struct __py const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[9], 555, 0, __PYX_ERR(9, 555, __pyx_L1_error)); + __Pyx_TraceCall("__get__", __pyx_f[9], 553, 0, __PYX_ERR(9, 553, __pyx_L1_error)); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->is_inline); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 555, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->is_inline); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -21419,7 +21581,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8PDFImage_9is_inline___get__(struct __py return __pyx_r; } -/* "src/pyxpdf/imageoutput.pxi":556 +/* "src/pyxpdf/imageoutput.pxi":554 * readonly bint interpolate * readonly bint is_inline * readonly double hDPI # <<<<<<<<<<<<<< @@ -21449,9 +21611,9 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8PDFImage_4hDPI___get__(struct __pyx_obj const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[9], 556, 0, __PYX_ERR(9, 556, __pyx_L1_error)); + __Pyx_TraceCall("__get__", __pyx_f[9], 554, 0, __PYX_ERR(9, 554, __pyx_L1_error)); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->hDPI); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 556, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->hDPI); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -21469,7 +21631,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8PDFImage_4hDPI___get__(struct __pyx_obj return __pyx_r; } -/* "src/pyxpdf/imageoutput.pxi":557 +/* "src/pyxpdf/imageoutput.pxi":555 * readonly bint is_inline * readonly double hDPI * readonly double vDPI # <<<<<<<<<<<<<< @@ -21499,9 +21661,9 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8PDFImage_4vDPI___get__(struct __pyx_obj const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[9], 557, 0, __PYX_ERR(9, 557, __pyx_L1_error)); + __Pyx_TraceCall("__get__", __pyx_f[9], 555, 0, __PYX_ERR(9, 555, __pyx_L1_error)); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->vDPI); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 557, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->vDPI); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -21519,7 +21681,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8PDFImage_4vDPI___get__(struct __pyx_obj return __pyx_r; } -/* "src/pyxpdf/imageoutput.pxi":558 +/* "src/pyxpdf/imageoutput.pxi":556 * readonly double hDPI * readonly double vDPI * readonly object colorspace # <<<<<<<<<<<<<< @@ -21548,7 +21710,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8PDFImage_10colorspace___get__(struct __ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[9], 558, 0, __PYX_ERR(9, 558, __pyx_L1_error)); + __Pyx_TraceCall("__get__", __pyx_f[9], 556, 0, __PYX_ERR(9, 556, __pyx_L1_error)); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->colorspace); __pyx_r = __pyx_v_self->colorspace; @@ -21565,7 +21727,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8PDFImage_10colorspace___get__(struct __ return __pyx_r; } -/* "src/pyxpdf/imageoutput.pxi":559 +/* "src/pyxpdf/imageoutput.pxi":557 * readonly double vDPI * readonly object colorspace * readonly int components # <<<<<<<<<<<<<< @@ -21595,9 +21757,9 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8PDFImage_10components___get__(struct __ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[9], 559, 0, __PYX_ERR(9, 559, __pyx_L1_error)); + __Pyx_TraceCall("__get__", __pyx_f[9], 557, 0, __PYX_ERR(9, 557, __pyx_L1_error)); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->components); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 559, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->components); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -21615,7 +21777,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8PDFImage_10components___get__(struct __ return __pyx_r; } -/* "src/pyxpdf/imageoutput.pxi":560 +/* "src/pyxpdf/imageoutput.pxi":558 * readonly object colorspace * readonly int components * readonly int bpc # <<<<<<<<<<<<<< @@ -21645,9 +21807,9 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8PDFImage_3bpc___get__(struct __pyx_obj_ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[9], 560, 0, __PYX_ERR(9, 560, __pyx_L1_error)); + __Pyx_TraceCall("__get__", __pyx_f[9], 558, 0, __PYX_ERR(9, 558, __pyx_L1_error)); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->bpc); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 560, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->bpc); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -21665,7 +21827,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8PDFImage_3bpc___get__(struct __pyx_obj_ return __pyx_r; } -/* "src/pyxpdf/imageoutput.pxi":561 +/* "src/pyxpdf/imageoutput.pxi":559 * readonly int components * readonly int bpc * readonly object image_type # <<<<<<<<<<<<<< @@ -21694,7 +21856,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8PDFImage_10image_type___get__(struct __ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[9], 561, 0, __PYX_ERR(9, 561, __pyx_L1_error)); + __Pyx_TraceCall("__get__", __pyx_f[9], 559, 0, __PYX_ERR(9, 559, __pyx_L1_error)); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->image_type); __pyx_r = __pyx_v_self->image_type; @@ -21711,7 +21873,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8PDFImage_10image_type___get__(struct __ return __pyx_r; } -/* "src/pyxpdf/imageoutput.pxi":562 +/* "src/pyxpdf/imageoutput.pxi":560 * readonly int bpc * readonly object image_type * readonly object compression # <<<<<<<<<<<<<< @@ -21740,7 +21902,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8PDFImage_11compression___get__(struct _ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[9], 562, 0, __PYX_ERR(9, 562, __pyx_L1_error)); + __Pyx_TraceCall("__get__", __pyx_f[9], 560, 0, __PYX_ERR(9, 560, __pyx_L1_error)); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->compression); __pyx_r = __pyx_v_self->compression; @@ -21757,7 +21919,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8PDFImage_11compression___get__(struct _ return __pyx_r; } -/* "src/pyxpdf/imageoutput.pxi":563 +/* "src/pyxpdf/imageoutput.pxi":561 * readonly object image_type * readonly object compression * readonly object image # <<<<<<<<<<<<<< @@ -21786,7 +21948,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8PDFImage_5image___get__(struct __pyx_ob const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[9], 563, 0, __PYX_ERR(9, 563, __pyx_L1_error)); + __Pyx_TraceCall("__get__", __pyx_f[9], 561, 0, __PYX_ERR(9, 561, __pyx_L1_error)); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->image); __pyx_r = __pyx_v_self->image; @@ -21845,7 +22007,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8PDFImage_2__reduce_cython__(struct __py int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__66) + __Pyx_TraceFrameInit(__pyx_codeobj__67) __Pyx_RefNannySetupContext("__reduce_cython__", 0); __Pyx_TraceCall("__reduce_cython__", __pyx_f[7], 1, 0, __PYX_ERR(7, 1, __pyx_L1_error)); @@ -22171,7 +22333,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8PDFImage_4__setstate_cython__(struct __ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__67) + __Pyx_TraceFrameInit(__pyx_codeobj__68) __Pyx_RefNannySetupContext("__setstate_cython__", 0); __Pyx_TraceCall("__setstate_cython__", __pyx_f[7], 16, 0, __PYX_ERR(7, 16, __pyx_L1_error)); @@ -22541,7 +22703,7 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_14PDFImageOutput_get(struct __pyx_obj_6py int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__68) + __Pyx_TraceFrameInit(__pyx_codeobj__69) __Pyx_RefNannySetupContext("get", 0); __Pyx_TraceCall("get", __pyx_f[9], 661, 0, __PYX_ERR(9, 661, __pyx_L1_error)); /* Check if called by wrapper */ @@ -22653,7 +22815,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_14PDFImageOutput_2get(struct __pyx_obj_6 int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__68) + __Pyx_TraceFrameInit(__pyx_codeobj__69) __Pyx_RefNannySetupContext("get", 0); __Pyx_TraceCall("get (wrapper)", __pyx_f[9], 661, 0, __PYX_ERR(9, 661, __pyx_L1_error)); __Pyx_XDECREF(__pyx_r); @@ -22750,7 +22912,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_14PDFImageOutput_4__reduce_cython__(CYTH int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__69) + __Pyx_TraceFrameInit(__pyx_codeobj__70) __Pyx_RefNannySetupContext("__reduce_cython__", 0); __Pyx_TraceCall("__reduce_cython__", __pyx_f[7], 1, 0, __PYX_ERR(7, 1, __pyx_L1_error)); @@ -22761,7 +22923,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_14PDFImageOutput_4__reduce_cython__(CYTH * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __Pyx_TraceLine(2,0,__PYX_ERR(7, 2, __pyx_L1_error)) - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 2, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -22814,7 +22976,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_14PDFImageOutput_6__setstate_cython__(CY int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__71) + __Pyx_TraceFrameInit(__pyx_codeobj__72) __Pyx_RefNannySetupContext("__setstate_cython__", 0); __Pyx_TraceCall("__setstate_cython__", __pyx_f[7], 3, 0, __PYX_ERR(7, 3, __pyx_L1_error)); @@ -22824,7 +22986,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_14PDFImageOutput_6__setstate_cython__(CY * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __Pyx_TraceLine(4,0,__PYX_ERR(7, 4, __pyx_L1_error)) - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__72, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 4, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__73, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -22967,8 +23129,8 @@ static int __pyx_pf_6pyxpdf_4xpdf_8Document___init__(CYTHON_UNUSED struct __pyx_ * """ * * def __cinit__(self, pdf, ownerpass=None, userpass=None): # <<<<<<<<<<<<<< - * self.doc = NULL - * + * cdef object Path + * from pathlib import Path */ /* Python wrapper */ @@ -23053,14 +23215,15 @@ static int __pyx_pw_6pyxpdf_4xpdf_8Document_3__cinit__(PyObject *__pyx_v_self, P } static int __pyx_pf_6pyxpdf_4xpdf_8Document_2__cinit__(struct __pyx_obj_6pyxpdf_4xpdf_Document *__pyx_v_self, PyObject *__pyx_v_pdf, PyObject *__pyx_v_ownerpass, PyObject *__pyx_v_userpass) { + PyObject *__pyx_v_Path = 0; int __pyx_r; __Pyx_TraceDeclarations __Pyx_RefNannyDeclarations - GString *__pyx_t_1; + PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; + GString *__pyx_t_3; int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; + int __pyx_t_5; PyObject *__pyx_t_6 = NULL; char *__pyx_t_7; Py_ssize_t __pyx_t_8; @@ -23070,160 +23233,220 @@ static int __pyx_pf_6pyxpdf_4xpdf_8Document_2__cinit__(struct __pyx_obj_6pyxpdf_ __Pyx_RefNannySetupContext("__cinit__", 0); __Pyx_TraceCall("__cinit__", __pyx_f[6], 89, 0, __PYX_ERR(6, 89, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":90 - * + /* "src/pyxpdf/document.pxi":91 * def __cinit__(self, pdf, ownerpass=None, userpass=None): + * cdef object Path + * from pathlib import Path # <<<<<<<<<<<<<< + * + * self.doc = NULL + */ + __Pyx_TraceLine(91,0,__PYX_ERR(6, 91, __pyx_L1_error)) + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_Path); + __Pyx_GIVEREF(__pyx_n_s_Path); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Path); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_pathlib, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Path); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_Path = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/pyxpdf/document.pxi":93 + * from pathlib import Path + * * self.doc = NULL # <<<<<<<<<<<<<< * * # Type casting NULL to prebent MSVC/C14 errors */ - __Pyx_TraceLine(90,0,__PYX_ERR(6, 90, __pyx_L1_error)) + __Pyx_TraceLine(93,0,__PYX_ERR(6, 93, __pyx_L1_error)) __pyx_v_self->doc = NULL; - /* "src/pyxpdf/document.pxi":93 + /* "src/pyxpdf/document.pxi":96 * * # Type casting NULL to prebent MSVC/C14 errors * self.ownerpass = NULL if ownerpass == None else to_GString(ownerpass) # <<<<<<<<<<<<<< * self.userpass = NULL if userpass == None else to_GString(userpass) * */ - __Pyx_TraceLine(93,0,__PYX_ERR(6, 93, __pyx_L1_error)) - __pyx_t_2 = PyObject_RichCompare(__pyx_v_ownerpass, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 93, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(6, 93, __pyx_L1_error) + __Pyx_TraceLine(96,0,__PYX_ERR(6, 96, __pyx_L1_error)) + __pyx_t_2 = PyObject_RichCompare(__pyx_v_ownerpass, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 96, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(6, 96, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_3) { - __pyx_t_1 = ((GString *)NULL); + if (__pyx_t_4) { + __pyx_t_3 = ((GString *)NULL); } else { - __pyx_t_1 = __pyx_f_6pyxpdf_4xpdf_to_GString(__pyx_v_ownerpass); + __pyx_t_3 = __pyx_f_6pyxpdf_4xpdf_to_GString(__pyx_v_ownerpass); } - __pyx_v_self->ownerpass = __pyx_t_1; + __pyx_v_self->ownerpass = __pyx_t_3; - /* "src/pyxpdf/document.pxi":94 + /* "src/pyxpdf/document.pxi":97 * # Type casting NULL to prebent MSVC/C14 errors * self.ownerpass = NULL if ownerpass == None else to_GString(ownerpass) * self.userpass = NULL if userpass == None else to_GString(userpass) # <<<<<<<<<<<<<< * * # pdf file path */ - __Pyx_TraceLine(94,0,__PYX_ERR(6, 94, __pyx_L1_error)) - __pyx_t_2 = PyObject_RichCompare(__pyx_v_userpass, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 94, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(6, 94, __pyx_L1_error) + __Pyx_TraceLine(97,0,__PYX_ERR(6, 97, __pyx_L1_error)) + __pyx_t_2 = PyObject_RichCompare(__pyx_v_userpass, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 97, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(6, 97, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_3) { - __pyx_t_1 = ((GString *)NULL); + if (__pyx_t_4) { + __pyx_t_3 = ((GString *)NULL); } else { - __pyx_t_1 = __pyx_f_6pyxpdf_4xpdf_to_GString(__pyx_v_userpass); + __pyx_t_3 = __pyx_f_6pyxpdf_4xpdf_to_GString(__pyx_v_userpass); } - __pyx_v_self->userpass = __pyx_t_1; + __pyx_v_self->userpass = __pyx_t_3; - /* "src/pyxpdf/document.pxi":97 + /* "src/pyxpdf/document.pxi":100 * * # pdf file path * if isinstance(pdf, basestring): # <<<<<<<<<<<<<< * self._load_from_file(to_GString(pdf)) - * # file-like object + * # Path object */ - __Pyx_TraceLine(97,0,__PYX_ERR(6, 97, __pyx_L1_error)) - __pyx_t_3 = __Pyx_PyBaseString_Check(__pyx_v_pdf); - __pyx_t_4 = (__pyx_t_3 != 0); - if (__pyx_t_4) { + __Pyx_TraceLine(100,0,__PYX_ERR(6, 100, __pyx_L1_error)) + __pyx_t_4 = __Pyx_PyBaseString_Check(__pyx_v_pdf); + __pyx_t_5 = (__pyx_t_4 != 0); + if (__pyx_t_5) { - /* "src/pyxpdf/document.pxi":98 + /* "src/pyxpdf/document.pxi":101 * # pdf file path * if isinstance(pdf, basestring): * self._load_from_file(to_GString(pdf)) # <<<<<<<<<<<<<< - * # file-like object - * elif callable(getattr(pdf, 'read', None)): + * # Path object + * elif isinstance(pdf, Path): */ - __Pyx_TraceLine(98,0,__PYX_ERR(6, 98, __pyx_L1_error)) - __pyx_t_2 = ((struct __pyx_vtabstruct_6pyxpdf_4xpdf_Document *)__pyx_v_self->__pyx_vtab)->_load_from_file(__pyx_v_self, __pyx_f_6pyxpdf_4xpdf_to_GString(__pyx_v_pdf)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 98, __pyx_L1_error) + __Pyx_TraceLine(101,0,__PYX_ERR(6, 101, __pyx_L1_error)) + __pyx_t_2 = ((struct __pyx_vtabstruct_6pyxpdf_4xpdf_Document *)__pyx_v_self->__pyx_vtab)->_load_from_file(__pyx_v_self, __pyx_f_6pyxpdf_4xpdf_to_GString(__pyx_v_pdf)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/pyxpdf/document.pxi":97 + /* "src/pyxpdf/document.pxi":100 * * # pdf file path * if isinstance(pdf, basestring): # <<<<<<<<<<<<<< * self._load_from_file(to_GString(pdf)) - * # file-like object + * # Path object */ goto __pyx_L3; } - /* "src/pyxpdf/document.pxi":100 + /* "src/pyxpdf/document.pxi":103 * self._load_from_file(to_GString(pdf)) + * # Path object + * elif isinstance(pdf, Path): # <<<<<<<<<<<<<< + * self._load_from_file(to_GString(str(pdf))) + * # file-like object + */ + __Pyx_TraceLine(103,0,__PYX_ERR(6, 103, __pyx_L1_error)) + __pyx_t_5 = PyObject_IsInstance(__pyx_v_pdf, __pyx_v_Path); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(6, 103, __pyx_L1_error) + __pyx_t_4 = (__pyx_t_5 != 0); + if (__pyx_t_4) { + + /* "src/pyxpdf/document.pxi":104 + * # Path object + * elif isinstance(pdf, Path): + * self._load_from_file(to_GString(str(pdf))) # <<<<<<<<<<<<<< + * # file-like object + * elif callable(getattr(pdf, 'read', None)): + */ + __Pyx_TraceLine(104,0,__PYX_ERR(6, 104, __pyx_L1_error)) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_pdf); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pyxpdf_4xpdf_Document *)__pyx_v_self->__pyx_vtab)->_load_from_file(__pyx_v_self, __pyx_f_6pyxpdf_4xpdf_to_GString(__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/pyxpdf/document.pxi":103 + * self._load_from_file(to_GString(pdf)) + * # Path object + * elif isinstance(pdf, Path): # <<<<<<<<<<<<<< + * self._load_from_file(to_GString(str(pdf))) + * # file-like object + */ + goto __pyx_L3; + } + + /* "src/pyxpdf/document.pxi":106 + * self._load_from_file(to_GString(str(pdf))) * # file-like object * elif callable(getattr(pdf, 'read', None)): # <<<<<<<<<<<<<< * # copy buffer * self.doc_data = pdf.read() */ - __Pyx_TraceLine(100,0,__PYX_ERR(6, 100, __pyx_L1_error)) - __pyx_t_2 = __Pyx_GetAttr3(__pyx_v_pdf, __pyx_n_u_read, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 100, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyCallable_Check(__pyx_t_2); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(6, 100, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = (__pyx_t_4 != 0); - if (likely(__pyx_t_3)) { + __Pyx_TraceLine(106,0,__PYX_ERR(6, 106, __pyx_L1_error)) + __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_pdf, __pyx_n_u_read, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyCallable_Check(__pyx_t_1); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(6, 106, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = (__pyx_t_4 != 0); + if (likely(__pyx_t_5)) { - /* "src/pyxpdf/document.pxi":102 + /* "src/pyxpdf/document.pxi":108 * elif callable(getattr(pdf, 'read', None)): * # copy buffer * self.doc_data = pdf.read() # <<<<<<<<<<<<<< * self._load_from_char_array(self.doc_data, len(self.doc_data)) * else: */ - __Pyx_TraceLine(102,0,__PYX_ERR(6, 102, __pyx_L1_error)) - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_pdf, __pyx_n_s_read); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 102, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __Pyx_TraceLine(108,0,__PYX_ERR(6, 108, __pyx_L1_error)) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_pdf, __pyx_n_s_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 108, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); + __Pyx_DECREF_SET(__pyx_t_2, function); } } - __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5); + __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 102, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(6, 102, __pyx_L1_error) - __Pyx_GIVEREF(__pyx_t_2); + if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 108, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(6, 108, __pyx_L1_error) + __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->doc_data); __Pyx_DECREF(__pyx_v_self->doc_data); - __pyx_v_self->doc_data = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; + __pyx_v_self->doc_data = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; - /* "src/pyxpdf/document.pxi":103 + /* "src/pyxpdf/document.pxi":109 * # copy buffer * self.doc_data = pdf.read() * self._load_from_char_array(self.doc_data, len(self.doc_data)) # <<<<<<<<<<<<<< * else: * raise ValueError(f"pdf argument must be a string or a file-like object.") */ - __Pyx_TraceLine(103,0,__PYX_ERR(6, 103, __pyx_L1_error)) + __Pyx_TraceLine(109,0,__PYX_ERR(6, 109, __pyx_L1_error)) if (unlikely(__pyx_v_self->doc_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(6, 103, __pyx_L1_error) + __PYX_ERR(6, 109, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->doc_data); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(6, 103, __pyx_L1_error) - __pyx_t_2 = __pyx_v_self->doc_data; - __Pyx_INCREF(__pyx_t_2); - if (unlikely(__pyx_t_2 == Py_None)) { + __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->doc_data); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(6, 109, __pyx_L1_error) + __pyx_t_1 = __pyx_v_self->doc_data; + __Pyx_INCREF(__pyx_t_1); + if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(6, 103, __pyx_L1_error) + __PYX_ERR(6, 109, __pyx_L1_error) } - __pyx_t_8 = PyBytes_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(6, 103, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = ((struct __pyx_vtabstruct_6pyxpdf_4xpdf_Document *)__pyx_v_self->__pyx_vtab)->_load_from_char_array(__pyx_v_self, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 103, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_8 = PyBytes_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(6, 109, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = ((struct __pyx_vtabstruct_6pyxpdf_4xpdf_Document *)__pyx_v_self->__pyx_vtab)->_load_from_char_array(__pyx_v_self, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "src/pyxpdf/document.pxi":100 - * self._load_from_file(to_GString(pdf)) + /* "src/pyxpdf/document.pxi":106 + * self._load_from_file(to_GString(str(pdf))) * # file-like object * elif callable(getattr(pdf, 'read', None)): # <<<<<<<<<<<<<< * # copy buffer @@ -23232,86 +23455,87 @@ static int __pyx_pf_6pyxpdf_4xpdf_8Document_2__cinit__(struct __pyx_obj_6pyxpdf_ goto __pyx_L3; } - /* "src/pyxpdf/document.pxi":105 + /* "src/pyxpdf/document.pxi":111 * self._load_from_char_array(self.doc_data, len(self.doc_data)) * else: * raise ValueError(f"pdf argument must be a string or a file-like object.") # <<<<<<<<<<<<<< * * # check PDFDoc */ - __Pyx_TraceLine(105,0,__PYX_ERR(6, 105, __pyx_L1_error)) + __Pyx_TraceLine(111,0,__PYX_ERR(6, 111, __pyx_L1_error)) /*else*/ { - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__73, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 105, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(6, 105, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__74, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(6, 111, __pyx_L1_error) } __pyx_L3:; - /* "src/pyxpdf/document.pxi":108 + /* "src/pyxpdf/document.pxi":114 * * # check PDFDoc * self.check() # <<<<<<<<<<<<<< * * # build empty cache */ - __Pyx_TraceLine(108,0,__PYX_ERR(6, 108, __pyx_L1_error)) - __pyx_t_2 = ((struct __pyx_vtabstruct_6pyxpdf_4xpdf_Document *)__pyx_v_self->__pyx_vtab)->check(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 108, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_TraceLine(114,0,__PYX_ERR(6, 114, __pyx_L1_error)) + __pyx_t_1 = ((struct __pyx_vtabstruct_6pyxpdf_4xpdf_Document *)__pyx_v_self->__pyx_vtab)->check(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "src/pyxpdf/document.pxi":111 + /* "src/pyxpdf/document.pxi":117 * * # build empty cache * self._pages_cache = [None] * self.num_pages # <<<<<<<<<<<<<< * * def __dealloc__(self): */ - __Pyx_TraceLine(111,0,__PYX_ERR(6, 111, __pyx_L1_error)) - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_pages); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 111, __pyx_L1_error) + __Pyx_TraceLine(117,0,__PYX_ERR(6, 117, __pyx_L1_error)) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_pages); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 111, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - PyList_SET_ITEM(__pyx_t_5, 0, Py_None); - { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_temp)) __PYX_ERR(6, 111, __pyx_L1_error) + PyList_SET_ITEM(__pyx_t_2, 0, Py_None); + { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_temp)) __PYX_ERR(6, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_temp); - __Pyx_DECREF(__pyx_t_5); - __pyx_t_5 = __pyx_temp; + __Pyx_DECREF(__pyx_t_2); + __pyx_t_2 = __pyx_temp; } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GIVEREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->_pages_cache); __Pyx_DECREF(__pyx_v_self->_pages_cache); - __pyx_v_self->_pages_cache = ((PyObject*)__pyx_t_5); - __pyx_t_5 = 0; + __pyx_v_self->_pages_cache = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; /* "src/pyxpdf/document.pxi":89 * """ * * def __cinit__(self, pdf, ownerpass=None, userpass=None): # <<<<<<<<<<<<<< - * self.doc = NULL - * + * cdef object Path + * from pathlib import Path */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pyxpdf.xpdf.Document.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_Path); __Pyx_TraceReturn(Py_None, 0); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "src/pyxpdf/document.pxi":113 +/* "src/pyxpdf/document.pxi":119 * self._pages_cache = [None] * self.num_pages * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -23337,39 +23561,39 @@ static void __pyx_pf_6pyxpdf_4xpdf_8Document_4__dealloc__(struct __pyx_obj_6pyxp const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__dealloc__", 0); - __Pyx_TraceCall("__dealloc__", __pyx_f[6], 113, 0, __PYX_ERR(6, 113, __pyx_L1_error)); + __Pyx_TraceCall("__dealloc__", __pyx_f[6], 119, 0, __PYX_ERR(6, 119, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":114 + /* "src/pyxpdf/document.pxi":120 * * def __dealloc__(self): * del self.doc # <<<<<<<<<<<<<< * del self.ownerpass * del self.userpass */ - __Pyx_TraceLine(114,0,__PYX_ERR(6, 114, __pyx_L1_error)) + __Pyx_TraceLine(120,0,__PYX_ERR(6, 120, __pyx_L1_error)) delete __pyx_v_self->doc; - /* "src/pyxpdf/document.pxi":115 + /* "src/pyxpdf/document.pxi":121 * def __dealloc__(self): * del self.doc * del self.ownerpass # <<<<<<<<<<<<<< * del self.userpass * */ - __Pyx_TraceLine(115,0,__PYX_ERR(6, 115, __pyx_L1_error)) + __Pyx_TraceLine(121,0,__PYX_ERR(6, 121, __pyx_L1_error)) delete __pyx_v_self->ownerpass; - /* "src/pyxpdf/document.pxi":116 + /* "src/pyxpdf/document.pxi":122 * del self.doc * del self.ownerpass * del self.userpass # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(116,0,__PYX_ERR(6, 116, __pyx_L1_error)) + __Pyx_TraceLine(122,0,__PYX_ERR(6, 122, __pyx_L1_error)) delete __pyx_v_self->userpass; - /* "src/pyxpdf/document.pxi":113 + /* "src/pyxpdf/document.pxi":119 * self._pages_cache = [None] * self.num_pages * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -23386,7 +23610,7 @@ static void __pyx_pf_6pyxpdf_4xpdf_8Document_4__dealloc__(struct __pyx_obj_6pyxp __Pyx_RefNannyFinishContext(); } -/* "src/pyxpdf/document.pxi":119 +/* "src/pyxpdf/document.pxi":125 * * * def __repr__(self): # <<<<<<<<<<<<<< @@ -23420,25 +23644,25 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_6__repr__(struct __pyx_obj_6py const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 0); - __Pyx_TraceCall("__repr__", __pyx_f[6], 119, 0, __PYX_ERR(6, 119, __pyx_L1_error)); + __Pyx_TraceCall("__repr__", __pyx_f[6], 125, 0, __PYX_ERR(6, 125, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":120 + /* "src/pyxpdf/document.pxi":126 * * def __repr__(self): * fname = "Stream" if self.filename == "" else self.filename # <<<<<<<<<<<<<< * return "".format(fname=fname) * */ - __Pyx_TraceLine(120,0,__PYX_ERR(6, 120, __pyx_L1_error)) - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_filename); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 120, __pyx_L1_error) + __Pyx_TraceLine(126,0,__PYX_ERR(6, 126, __pyx_L1_error)) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_filename); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_kp_u__4, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(6, 120, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_kp_u__4, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(6, 126, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { __Pyx_INCREF(__pyx_n_u_Stream); __pyx_t_1 = __pyx_n_u_Stream; } else { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_filename); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 120, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_filename); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; @@ -23446,21 +23670,21 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_6__repr__(struct __pyx_obj_6py __pyx_v_fname = __pyx_t_1; __pyx_t_1 = 0; - /* "src/pyxpdf/document.pxi":121 + /* "src/pyxpdf/document.pxi":127 * def __repr__(self): * fname = "Stream" if self.filename == "" else self.filename * return "".format(fname=fname) # <<<<<<<<<<<<<< * * def __str__(self): */ - __Pyx_TraceLine(121,0,__PYX_ERR(6, 121, __pyx_L1_error)) + __Pyx_TraceLine(127,0,__PYX_ERR(6, 127, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Document_fname, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 121, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Document_fname, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 121, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_fname, __pyx_v_fname) < 0) __PYX_ERR(6, 121, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 121, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_fname, __pyx_v_fname) < 0) __PYX_ERR(6, 127, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -23468,7 +23692,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_6__repr__(struct __pyx_obj_6py __pyx_t_4 = 0; goto __pyx_L0; - /* "src/pyxpdf/document.pxi":119 + /* "src/pyxpdf/document.pxi":125 * * * def __repr__(self): # <<<<<<<<<<<<<< @@ -23491,7 +23715,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_6__repr__(struct __pyx_obj_6py return __pyx_r; } -/* "src/pyxpdf/document.pxi":123 +/* "src/pyxpdf/document.pxi":129 * return "".format(fname=fname) * * def __str__(self): # <<<<<<<<<<<<<< @@ -23525,25 +23749,25 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_8__str__(struct __pyx_obj_6pyx const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__str__", 0); - __Pyx_TraceCall("__str__", __pyx_f[6], 123, 0, __PYX_ERR(6, 123, __pyx_L1_error)); + __Pyx_TraceCall("__str__", __pyx_f[6], 129, 0, __PYX_ERR(6, 129, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":124 + /* "src/pyxpdf/document.pxi":130 * * def __str__(self): * fname = "Stream" if self.filename == "" else self.filename # <<<<<<<<<<<<<< * return "".format(fname=fname, pages=self.num_pages) * */ - __Pyx_TraceLine(124,0,__PYX_ERR(6, 124, __pyx_L1_error)) - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_filename); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 124, __pyx_L1_error) + __Pyx_TraceLine(130,0,__PYX_ERR(6, 130, __pyx_L1_error)) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_filename); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_kp_u__4, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(6, 124, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_kp_u__4, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(6, 130, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { __Pyx_INCREF(__pyx_n_u_Stream); __pyx_t_1 = __pyx_n_u_Stream; } else { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_filename); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 124, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_filename); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; @@ -23551,25 +23775,25 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_8__str__(struct __pyx_obj_6pyx __pyx_v_fname = __pyx_t_1; __pyx_t_1 = 0; - /* "src/pyxpdf/document.pxi":125 + /* "src/pyxpdf/document.pxi":131 * def __str__(self): * fname = "Stream" if self.filename == "" else self.filename * return "".format(fname=fname, pages=self.num_pages) # <<<<<<<<<<<<<< * * def __len__(self): */ - __Pyx_TraceLine(125,0,__PYX_ERR(6, 125, __pyx_L1_error)) + __Pyx_TraceLine(131,0,__PYX_ERR(6, 131, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Document_fname_pages, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 125, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Document_fname_pages, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 125, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_fname, __pyx_v_fname) < 0) __PYX_ERR(6, 125, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_pages); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 125, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_fname, __pyx_v_fname) < 0) __PYX_ERR(6, 131, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_pages); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pages, __pyx_t_4) < 0) __PYX_ERR(6, 125, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pages, __pyx_t_4) < 0) __PYX_ERR(6, 131, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 125, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -23577,7 +23801,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_8__str__(struct __pyx_obj_6pyx __pyx_t_4 = 0; goto __pyx_L0; - /* "src/pyxpdf/document.pxi":123 + /* "src/pyxpdf/document.pxi":129 * return "".format(fname=fname) * * def __str__(self): # <<<<<<<<<<<<<< @@ -23600,7 +23824,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_8__str__(struct __pyx_obj_6pyx return __pyx_r; } -/* "src/pyxpdf/document.pxi":127 +/* "src/pyxpdf/document.pxi":133 * return "".format(fname=fname, pages=self.num_pages) * * def __len__(self): # <<<<<<<<<<<<<< @@ -23631,24 +23855,24 @@ static Py_ssize_t __pyx_pf_6pyxpdf_4xpdf_8Document_10__len__(struct __pyx_obj_6p const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__len__", 0); - __Pyx_TraceCall("__len__", __pyx_f[6], 127, 0, __PYX_ERR(6, 127, __pyx_L1_error)); + __Pyx_TraceCall("__len__", __pyx_f[6], 133, 0, __PYX_ERR(6, 133, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":128 + /* "src/pyxpdf/document.pxi":134 * * def __len__(self): * return self.num_pages # <<<<<<<<<<<<<< * * def __getitem__(self, key): */ - __Pyx_TraceLine(128,0,__PYX_ERR(6, 128, __pyx_L1_error)) - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_pages); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 128, __pyx_L1_error) + __Pyx_TraceLine(134,0,__PYX_ERR(6, 134, __pyx_L1_error)) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_pages); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(6, 128, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(6, 134, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; goto __pyx_L0; - /* "src/pyxpdf/document.pxi":127 + /* "src/pyxpdf/document.pxi":133 * return "".format(fname=fname, pages=self.num_pages) * * def __len__(self): # <<<<<<<<<<<<<< @@ -23667,7 +23891,7 @@ static Py_ssize_t __pyx_pf_6pyxpdf_4xpdf_8Document_10__len__(struct __pyx_obj_6p return __pyx_r; } -/* "src/pyxpdf/document.pxi":130 +/* "src/pyxpdf/document.pxi":136 * return self.num_pages * * def __getitem__(self, key): # <<<<<<<<<<<<<< @@ -23708,76 +23932,76 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_12__getitem__(struct __pyx_obj const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); - __Pyx_TraceCall("__getitem__", __pyx_f[6], 130, 0, __PYX_ERR(6, 130, __pyx_L1_error)); + __Pyx_TraceCall("__getitem__", __pyx_f[6], 136, 0, __PYX_ERR(6, 136, __pyx_L1_error)); __Pyx_INCREF(__pyx_v_key); - /* "src/pyxpdf/document.pxi":131 + /* "src/pyxpdf/document.pxi":137 * * def __getitem__(self, key): * if isinstance(key, str): # <<<<<<<<<<<<<< * pgno = self.label_to_index(key) * if pgno == -1: */ - __Pyx_TraceLine(131,0,__PYX_ERR(6, 131, __pyx_L1_error)) + __Pyx_TraceLine(137,0,__PYX_ERR(6, 137, __pyx_L1_error)) __pyx_t_1 = PyUnicode_Check(__pyx_v_key); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "src/pyxpdf/document.pxi":132 + /* "src/pyxpdf/document.pxi":138 * def __getitem__(self, key): * if isinstance(key, str): * pgno = self.label_to_index(key) # <<<<<<<<<<<<<< * if pgno == -1: * raise KeyError( */ - __Pyx_TraceLine(132,0,__PYX_ERR(6, 132, __pyx_L1_error)) + __Pyx_TraceLine(138,0,__PYX_ERR(6, 138, __pyx_L1_error)) __pyx_v_pgno = ((struct __pyx_vtabstruct_6pyxpdf_4xpdf_Document *)__pyx_v_self->__pyx_vtab)->label_to_index(__pyx_v_self, __pyx_v_key); - /* "src/pyxpdf/document.pxi":133 + /* "src/pyxpdf/document.pxi":139 * if isinstance(key, str): * pgno = self.label_to_index(key) * if pgno == -1: # <<<<<<<<<<<<<< * raise KeyError( * "Could not find page with label '{key}'".format(key=key)) */ - __Pyx_TraceLine(133,0,__PYX_ERR(6, 133, __pyx_L1_error)) + __Pyx_TraceLine(139,0,__PYX_ERR(6, 139, __pyx_L1_error)) __pyx_t_2 = ((__pyx_v_pgno == -1L) != 0); if (unlikely(__pyx_t_2)) { - /* "src/pyxpdf/document.pxi":135 + /* "src/pyxpdf/document.pxi":141 * if pgno == -1: * raise KeyError( * "Could not find page with label '{key}'".format(key=key)) # <<<<<<<<<<<<<< * return self.get_page(pgno) * elif isinstance(key, int): */ - __Pyx_TraceLine(135,0,__PYX_ERR(6, 135, __pyx_L1_error)) - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Could_not_find_page_with_label_k, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 135, __pyx_L1_error) + __Pyx_TraceLine(141,0,__PYX_ERR(6, 141, __pyx_L1_error)) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Could_not_find_page_with_label_k, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 135, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_key, __pyx_v_key) < 0) __PYX_ERR(6, 135, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 135, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_key, __pyx_v_key) < 0) __PYX_ERR(6, 141, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "src/pyxpdf/document.pxi":134 + /* "src/pyxpdf/document.pxi":140 * pgno = self.label_to_index(key) * if pgno == -1: * raise KeyError( # <<<<<<<<<<<<<< * "Could not find page with label '{key}'".format(key=key)) * return self.get_page(pgno) */ - __Pyx_TraceLine(134,0,__PYX_ERR(6, 134, __pyx_L1_error)) - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 134, __pyx_L1_error) + __Pyx_TraceLine(140,0,__PYX_ERR(6, 140, __pyx_L1_error)) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(6, 134, __pyx_L1_error) + __PYX_ERR(6, 140, __pyx_L1_error) - /* "src/pyxpdf/document.pxi":133 + /* "src/pyxpdf/document.pxi":139 * if isinstance(key, str): * pgno = self.label_to_index(key) * if pgno == -1: # <<<<<<<<<<<<<< @@ -23786,22 +24010,22 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_12__getitem__(struct __pyx_obj */ } - /* "src/pyxpdf/document.pxi":136 + /* "src/pyxpdf/document.pxi":142 * raise KeyError( * "Could not find page with label '{key}'".format(key=key)) * return self.get_page(pgno) # <<<<<<<<<<<<<< * elif isinstance(key, int): * # handle neg key */ - __Pyx_TraceLine(136,0,__PYX_ERR(6, 136, __pyx_L1_error)) + __Pyx_TraceLine(142,0,__PYX_ERR(6, 142, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = ((struct __pyx_vtabstruct_6pyxpdf_4xpdf_Document *)__pyx_v_self->__pyx_vtab)->get_page(__pyx_v_self, __pyx_v_pgno); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 136, __pyx_L1_error) + __pyx_t_4 = ((struct __pyx_vtabstruct_6pyxpdf_4xpdf_Document *)__pyx_v_self->__pyx_vtab)->get_page(__pyx_v_self, __pyx_v_pgno); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "src/pyxpdf/document.pxi":131 + /* "src/pyxpdf/document.pxi":137 * * def __getitem__(self, key): * if isinstance(key, str): # <<<<<<<<<<<<<< @@ -23810,48 +24034,48 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_12__getitem__(struct __pyx_obj */ } - /* "src/pyxpdf/document.pxi":137 + /* "src/pyxpdf/document.pxi":143 * "Could not find page with label '{key}'".format(key=key)) * return self.get_page(pgno) * elif isinstance(key, int): # <<<<<<<<<<<<<< * # handle neg key * if key < 0: */ - __Pyx_TraceLine(137,0,__PYX_ERR(6, 137, __pyx_L1_error)) + __Pyx_TraceLine(143,0,__PYX_ERR(6, 143, __pyx_L1_error)) __pyx_t_2 = PyInt_Check(__pyx_v_key); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "src/pyxpdf/document.pxi":139 + /* "src/pyxpdf/document.pxi":145 * elif isinstance(key, int): * # handle neg key * if key < 0: # <<<<<<<<<<<<<< * key += self.num_pages * return self.get_page(key) */ - __Pyx_TraceLine(139,0,__PYX_ERR(6, 139, __pyx_L1_error)) - __pyx_t_4 = PyObject_RichCompare(__pyx_v_key, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 139, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 139, __pyx_L1_error) + __Pyx_TraceLine(145,0,__PYX_ERR(6, 145, __pyx_L1_error)) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_key, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 145, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 145, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { - /* "src/pyxpdf/document.pxi":140 + /* "src/pyxpdf/document.pxi":146 * # handle neg key * if key < 0: * key += self.num_pages # <<<<<<<<<<<<<< * return self.get_page(key) * elif isinstance(key, slice): */ - __Pyx_TraceLine(140,0,__PYX_ERR(6, 140, __pyx_L1_error)) - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_pages); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 140, __pyx_L1_error) + __Pyx_TraceLine(146,0,__PYX_ERR(6, 146, __pyx_L1_error)) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_pages); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_key, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 140, __pyx_L1_error) + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_key, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_5); __pyx_t_5 = 0; - /* "src/pyxpdf/document.pxi":139 + /* "src/pyxpdf/document.pxi":145 * elif isinstance(key, int): * # handle neg key * if key < 0: # <<<<<<<<<<<<<< @@ -23860,23 +24084,23 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_12__getitem__(struct __pyx_obj */ } - /* "src/pyxpdf/document.pxi":141 + /* "src/pyxpdf/document.pxi":147 * if key < 0: * key += self.num_pages * return self.get_page(key) # <<<<<<<<<<<<<< * elif isinstance(key, slice): * # Return the list of Pages */ - __Pyx_TraceLine(141,0,__PYX_ERR(6, 141, __pyx_L1_error)) + __Pyx_TraceLine(147,0,__PYX_ERR(6, 147, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_key); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 141, __pyx_L1_error) - __pyx_t_5 = ((struct __pyx_vtabstruct_6pyxpdf_4xpdf_Document *)__pyx_v_self->__pyx_vtab)->get_page(__pyx_v_self, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 141, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_key); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 147, __pyx_L1_error) + __pyx_t_5 = ((struct __pyx_vtabstruct_6pyxpdf_4xpdf_Document *)__pyx_v_self->__pyx_vtab)->get_page(__pyx_v_self, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; - /* "src/pyxpdf/document.pxi":137 + /* "src/pyxpdf/document.pxi":143 * "Could not find page with label '{key}'".format(key=key)) * return self.get_page(pgno) * elif isinstance(key, int): # <<<<<<<<<<<<<< @@ -23885,33 +24109,33 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_12__getitem__(struct __pyx_obj */ } - /* "src/pyxpdf/document.pxi":142 + /* "src/pyxpdf/document.pxi":148 * key += self.num_pages * return self.get_page(key) * elif isinstance(key, slice): # <<<<<<<<<<<<<< * # Return the list of Pages * return [self[i] for i in range(*key.indices(self.num_pages))] */ - __Pyx_TraceLine(142,0,__PYX_ERR(6, 142, __pyx_L1_error)) + __Pyx_TraceLine(148,0,__PYX_ERR(6, 148, __pyx_L1_error)) __pyx_t_1 = PySlice_Check(__pyx_v_key); __pyx_t_2 = (__pyx_t_1 != 0); if (likely(__pyx_t_2)) { - /* "src/pyxpdf/document.pxi":144 + /* "src/pyxpdf/document.pxi":150 * elif isinstance(key, slice): * # Return the list of Pages * return [self[i] for i in range(*key.indices(self.num_pages))] # <<<<<<<<<<<<<< * else: * raise TypeError("Invalid Key type") */ - __Pyx_TraceLine(144,0,__PYX_ERR(6, 144, __pyx_L1_error)) + __Pyx_TraceLine(150,0,__PYX_ERR(6, 150, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ - __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 144, __pyx_L8_error) + __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 150, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 144, __pyx_L8_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 150, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_pages); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 144, __pyx_L8_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_pages); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 150, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { @@ -23926,22 +24150,22 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_12__getitem__(struct __pyx_obj __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_8, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 144, __pyx_L8_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 150, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 144, __pyx_L8_error) + __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 150, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 144, __pyx_L8_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 150, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_9 = 0; __pyx_t_10 = NULL; } else { - __pyx_t_9 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 144, __pyx_L8_error) + __pyx_t_9 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 150, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 144, __pyx_L8_error) + __pyx_t_10 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 150, __pyx_L8_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -23949,17 +24173,17 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_12__getitem__(struct __pyx_obj if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(6, 144, __pyx_L8_error) + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(6, 150, __pyx_L8_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 144, __pyx_L8_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 150, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(6, 144, __pyx_L8_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(6, 150, __pyx_L8_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 144, __pyx_L8_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 150, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -23969,7 +24193,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_12__getitem__(struct __pyx_obj PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(6, 144, __pyx_L8_error) + else __PYX_ERR(6, 150, __pyx_L8_error) } break; } @@ -23977,9 +24201,9 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_12__getitem__(struct __pyx_obj } __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_i, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_7genexpr__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 144, __pyx_L8_error) + __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_7genexpr__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 150, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_4))) __PYX_ERR(6, 144, __pyx_L8_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_4))) __PYX_ERR(6, 150, __pyx_L8_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -23994,7 +24218,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_12__getitem__(struct __pyx_obj __pyx_t_5 = 0; goto __pyx_L0; - /* "src/pyxpdf/document.pxi":142 + /* "src/pyxpdf/document.pxi":148 * key += self.num_pages * return self.get_page(key) * elif isinstance(key, slice): # <<<<<<<<<<<<<< @@ -24003,23 +24227,23 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_12__getitem__(struct __pyx_obj */ } - /* "src/pyxpdf/document.pxi":146 + /* "src/pyxpdf/document.pxi":152 * return [self[i] for i in range(*key.indices(self.num_pages))] * else: * raise TypeError("Invalid Key type") # <<<<<<<<<<<<<< * * def __iter__(self): */ - __Pyx_TraceLine(146,0,__PYX_ERR(6, 146, __pyx_L1_error)) + __Pyx_TraceLine(152,0,__PYX_ERR(6, 152, __pyx_L1_error)) /*else*/ { - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__74, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 146, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__75, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(6, 146, __pyx_L1_error) + __PYX_ERR(6, 152, __pyx_L1_error) } - /* "src/pyxpdf/document.pxi":130 + /* "src/pyxpdf/document.pxi":136 * return self.num_pages * * def __getitem__(self, key): # <<<<<<<<<<<<<< @@ -24045,7 +24269,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_12__getitem__(struct __pyx_obj return __pyx_r; } -/* "src/pyxpdf/document.pxi":148 +/* "src/pyxpdf/document.pxi":154 * raise TypeError("Invalid Key type") * * def __iter__(self): # <<<<<<<<<<<<<< @@ -24075,24 +24299,24 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_14__iter__(struct __pyx_obj_6p const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__iter__", 0); - __Pyx_TraceCall("__iter__", __pyx_f[6], 148, 0, __PYX_ERR(6, 148, __pyx_L1_error)); + __Pyx_TraceCall("__iter__", __pyx_f[6], 154, 0, __PYX_ERR(6, 154, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":149 + /* "src/pyxpdf/document.pxi":155 * * def __iter__(self): * return DocumentPageIterator(self) # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(149,0,__PYX_ERR(6, 149, __pyx_L1_error)) + __Pyx_TraceLine(155,0,__PYX_ERR(6, 155, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6pyxpdf_4xpdf_DocumentPageIterator), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 149, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6pyxpdf_4xpdf_DocumentPageIterator), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "src/pyxpdf/document.pxi":148 + /* "src/pyxpdf/document.pxi":154 * raise TypeError("Invalid Key type") * * def __iter__(self): # <<<<<<<<<<<<<< @@ -24112,7 +24336,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_14__iter__(struct __pyx_obj_6p return __pyx_r; } -/* "src/pyxpdf/document.pxi":152 +/* "src/pyxpdf/document.pxi":158 * * * cdef Catalog *get_catalog(self): # <<<<<<<<<<<<<< @@ -24128,20 +24352,20 @@ static Catalog *__pyx_f_6pyxpdf_4xpdf_8Document_get_catalog(struct __pyx_obj_6py const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_catalog", 0); - __Pyx_TraceCall("get_catalog", __pyx_f[6], 152, 0, __PYX_ERR(6, 152, __pyx_L1_error)); + __Pyx_TraceCall("get_catalog", __pyx_f[6], 158, 0, __PYX_ERR(6, 158, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":153 + /* "src/pyxpdf/document.pxi":159 * * cdef Catalog *get_catalog(self): * return self.doc.getCatalog() # <<<<<<<<<<<<<< * - * cdef display_pages(self, OutputDev* out, int first, int end, + * cdef display_pages(self, OutputDev* out, int first = 0, int end = -1, */ - __Pyx_TraceLine(153,0,__PYX_ERR(6, 153, __pyx_L1_error)) + __Pyx_TraceLine(159,0,__PYX_ERR(6, 159, __pyx_L1_error)) __pyx_r = __pyx_v_self->doc->getCatalog(); goto __pyx_L0; - /* "src/pyxpdf/document.pxi":152 + /* "src/pyxpdf/document.pxi":158 * * * cdef Catalog *get_catalog(self): # <<<<<<<<<<<<<< @@ -24159,48 +24383,56 @@ static Catalog *__pyx_f_6pyxpdf_4xpdf_8Document_get_catalog(struct __pyx_obj_6py return __pyx_r; } -/* "src/pyxpdf/document.pxi":155 +/* "src/pyxpdf/document.pxi":161 * return self.doc.getCatalog() * - * cdef display_pages(self, OutputDev* out, int first, int end, # <<<<<<<<<<<<<< + * cdef display_pages(self, OutputDev* out, int first = 0, int end = -1, # <<<<<<<<<<<<<< * double hDPI = 72, double vDPI = 72, int rotate = 0, * GBool use_media_box = gFalse, GBool crop = gTrue, */ -static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document_display_pages(struct __pyx_obj_6pyxpdf_4xpdf_Document *__pyx_v_self, OutputDev *__pyx_v_out, int __pyx_v_first, int __pyx_v_end, struct __pyx_opt_args_6pyxpdf_4xpdf_8Document_display_pages *__pyx_optional_args) { +static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document_display_pages(struct __pyx_obj_6pyxpdf_4xpdf_Document *__pyx_v_self, OutputDev *__pyx_v_out, struct __pyx_opt_args_6pyxpdf_4xpdf_8Document_display_pages *__pyx_optional_args) { + int __pyx_v_first = ((int)0); + int __pyx_v_end = ((int)-1); double __pyx_v_hDPI = ((double)72.0); double __pyx_v_vDPI = ((double)72.0); int __pyx_v_rotate = ((int)0); - GBool __pyx_v_use_media_box = __pyx_k__75; - GBool __pyx_v_crop = __pyx_k__76; - GBool __pyx_v_printing = __pyx_k__77; + GBool __pyx_v_use_media_box = __pyx_k__76; + GBool __pyx_v_crop = __pyx_k__77; + GBool __pyx_v_printing = __pyx_k__78; + long __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_TraceDeclarations __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; + long __pyx_t_3; + long __pyx_t_4; + long __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("display_pages", 0); - __Pyx_TraceCall("display_pages", __pyx_f[6], 155, 0, __PYX_ERR(6, 155, __pyx_L1_error)); + __Pyx_TraceCall("display_pages", __pyx_f[6], 161, 0, __PYX_ERR(6, 161, __pyx_L1_error)); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { - __pyx_v_hDPI = __pyx_optional_args->hDPI; + __pyx_v_first = __pyx_optional_args->first; if (__pyx_optional_args->__pyx_n > 1) { - __pyx_v_vDPI = __pyx_optional_args->vDPI; + __pyx_v_end = __pyx_optional_args->end; if (__pyx_optional_args->__pyx_n > 2) { - __pyx_v_rotate = __pyx_optional_args->rotate; + __pyx_v_hDPI = __pyx_optional_args->hDPI; if (__pyx_optional_args->__pyx_n > 3) { - __pyx_v_use_media_box = __pyx_optional_args->use_media_box; + __pyx_v_vDPI = __pyx_optional_args->vDPI; if (__pyx_optional_args->__pyx_n > 4) { - __pyx_v_crop = __pyx_optional_args->crop; + __pyx_v_rotate = __pyx_optional_args->rotate; if (__pyx_optional_args->__pyx_n > 5) { - __pyx_v_printing = __pyx_optional_args->printing; + __pyx_v_use_media_box = __pyx_optional_args->use_media_box; + if (__pyx_optional_args->__pyx_n > 6) { + __pyx_v_crop = __pyx_optional_args->crop; + if (__pyx_optional_args->__pyx_n > 7) { + __pyx_v_printing = __pyx_optional_args->printing; + } + } } } } @@ -24209,119 +24441,110 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document_display_pages(struct __pyx_obj_ } } - /* "src/pyxpdf/document.pxi":159 + /* "src/pyxpdf/document.pxi":165 * GBool use_media_box = gFalse, GBool crop = gTrue, * GBool printing = gFalse): - * if first < 0 or first >= self.num_pages: # <<<<<<<<<<<<<< + * if first < 0 or first >= self.doc.getNumPages(): # <<<<<<<<<<<<<< * first = 0 - * if end < 0 or end >= self.num_pages: + * if end < 0 or end >= self.doc.getNumPages(): */ - __Pyx_TraceLine(159,0,__PYX_ERR(6, 159, __pyx_L1_error)) + __Pyx_TraceLine(165,0,__PYX_ERR(6, 165, __pyx_L1_error)) __pyx_t_2 = ((__pyx_v_first < 0) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_first); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 159, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_pages); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 159, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 159, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 159, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_2 = ((__pyx_v_first >= __pyx_v_self->doc->getNumPages()) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { - /* "src/pyxpdf/document.pxi":160 + /* "src/pyxpdf/document.pxi":166 * GBool printing = gFalse): - * if first < 0 or first >= self.num_pages: + * if first < 0 or first >= self.doc.getNumPages(): * first = 0 # <<<<<<<<<<<<<< - * if end < 0 or end >= self.num_pages: - * end = self.num_pages - 1 + * if end < 0 or end >= self.doc.getNumPages(): + * end = self.doc.getNumPages() - 1 */ - __Pyx_TraceLine(160,0,__PYX_ERR(6, 160, __pyx_L1_error)) + __Pyx_TraceLine(166,0,__PYX_ERR(6, 166, __pyx_L1_error)) __pyx_v_first = 0; - /* "src/pyxpdf/document.pxi":159 + /* "src/pyxpdf/document.pxi":165 * GBool use_media_box = gFalse, GBool crop = gTrue, * GBool printing = gFalse): - * if first < 0 or first >= self.num_pages: # <<<<<<<<<<<<<< + * if first < 0 or first >= self.doc.getNumPages(): # <<<<<<<<<<<<<< * first = 0 - * if end < 0 or end >= self.num_pages: + * if end < 0 or end >= self.doc.getNumPages(): */ } - /* "src/pyxpdf/document.pxi":161 - * if first < 0 or first >= self.num_pages: + /* "src/pyxpdf/document.pxi":167 + * if first < 0 or first >= self.doc.getNumPages(): * first = 0 - * if end < 0 or end >= self.num_pages: # <<<<<<<<<<<<<< - * end = self.num_pages - 1 - * self.doc.displayPages(out, first + 1, end + 1, hDPI, vDPI, rotate, + * if end < 0 or end >= self.doc.getNumPages(): # <<<<<<<<<<<<<< + * end = self.doc.getNumPages() - 1 + * */ - __Pyx_TraceLine(161,0,__PYX_ERR(6, 161, __pyx_L1_error)) + __Pyx_TraceLine(167,0,__PYX_ERR(6, 167, __pyx_L1_error)) __pyx_t_2 = ((__pyx_v_end < 0) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L7_bool_binop_done; } - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_end); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 161, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_pages); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 161, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 161, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 161, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = ((__pyx_v_end >= __pyx_v_self->doc->getNumPages()) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L7_bool_binop_done:; if (__pyx_t_1) { - /* "src/pyxpdf/document.pxi":162 + /* "src/pyxpdf/document.pxi":168 * first = 0 - * if end < 0 or end >= self.num_pages: - * end = self.num_pages - 1 # <<<<<<<<<<<<<< - * self.doc.displayPages(out, first + 1, end + 1, hDPI, vDPI, rotate, - * use_media_box, crop, printing) + * if end < 0 or end >= self.doc.getNumPages(): + * end = self.doc.getNumPages() - 1 # <<<<<<<<<<<<<< + * + * # xpdf source count pages from 1 */ - __Pyx_TraceLine(162,0,__PYX_ERR(6, 162, __pyx_L1_error)) - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_pages); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 162, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 162, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 162, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_end = __pyx_t_6; + __Pyx_TraceLine(168,0,__PYX_ERR(6, 168, __pyx_L1_error)) + __pyx_v_end = (__pyx_v_self->doc->getNumPages() - 1); - /* "src/pyxpdf/document.pxi":161 - * if first < 0 or first >= self.num_pages: + /* "src/pyxpdf/document.pxi":167 + * if first < 0 or first >= self.doc.getNumPages(): * first = 0 - * if end < 0 or end >= self.num_pages: # <<<<<<<<<<<<<< - * end = self.num_pages - 1 - * self.doc.displayPages(out, first + 1, end + 1, hDPI, vDPI, rotate, + * if end < 0 or end >= self.doc.getNumPages(): # <<<<<<<<<<<<<< + * end = self.doc.getNumPages() - 1 + * */ } - /* "src/pyxpdf/document.pxi":163 - * if end < 0 or end >= self.num_pages: - * end = self.num_pages - 1 - * self.doc.displayPages(out, first + 1, end + 1, hDPI, vDPI, rotate, # <<<<<<<<<<<<<< - * use_media_box, crop, printing) + /* "src/pyxpdf/document.pxi":171 * + * # xpdf source count pages from 1 + * for i in range(first + 1, end + 2): # <<<<<<<<<<<<<< + * #print(i) + * self.doc.displayPage(out, i, hDPI, vDPI, rotate, */ - __Pyx_TraceLine(163,0,__PYX_ERR(6, 163, __pyx_L1_error)) - __pyx_v_self->doc->displayPages(__pyx_v_out, (__pyx_v_first + 1), (__pyx_v_end + 1), __pyx_v_hDPI, __pyx_v_vDPI, __pyx_v_rotate, __pyx_v_use_media_box, __pyx_v_crop, __pyx_v_printing, NULL); + __Pyx_TraceLine(171,0,__PYX_ERR(6, 171, __pyx_L1_error)) + __pyx_t_3 = (__pyx_v_end + 2); + __pyx_t_4 = __pyx_t_3; + for (__pyx_t_5 = (__pyx_v_first + 1); __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; - /* "src/pyxpdf/document.pxi":155 + /* "src/pyxpdf/document.pxi":173 + * for i in range(first + 1, end + 2): + * #print(i) + * self.doc.displayPage(out, i, hDPI, vDPI, rotate, # <<<<<<<<<<<<<< + * use_media_box, crop, printing) + * + */ + __Pyx_TraceLine(173,0,__PYX_ERR(6, 173, __pyx_L1_error)) + __pyx_v_self->doc->displayPage(__pyx_v_out, __pyx_v_i, __pyx_v_hDPI, __pyx_v_vDPI, __pyx_v_rotate, __pyx_v_use_media_box, __pyx_v_crop, __pyx_v_printing, NULL); + } + + /* "src/pyxpdf/document.pxi":161 * return self.doc.getCatalog() * - * cdef display_pages(self, OutputDev* out, int first, int end, # <<<<<<<<<<<<<< + * cdef display_pages(self, OutputDev* out, int first = 0, int end = -1, # <<<<<<<<<<<<<< * double hDPI = 72, double vDPI = 72, int rotate = 0, * GBool use_media_box = gFalse, GBool crop = gTrue, */ @@ -24330,9 +24553,6 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document_display_pages(struct __pyx_obj_ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pyxpdf.xpdf.Document.display_pages", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; @@ -24342,8 +24562,8 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document_display_pages(struct __pyx_obj_ return __pyx_r; } -/* "src/pyxpdf/document.pxi":166 - * use_media_box, crop, printing) +/* "src/pyxpdf/document.pxi":176 + * use_media_box, crop, printing) * * cdef dict get_info_dict(self): # <<<<<<<<<<<<<< * cdef: @@ -24363,47 +24583,47 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document_get_info_dict(struct __pyx_obj_ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_info_dict", 0); - __Pyx_TraceCall("get_info_dict", __pyx_f[6], 166, 0, __PYX_ERR(6, 166, __pyx_L1_error)); + __Pyx_TraceCall("get_info_dict", __pyx_f[6], 176, 0, __PYX_ERR(6, 176, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":169 + /* "src/pyxpdf/document.pxi":179 * cdef: * Object info * dict result = {} # <<<<<<<<<<<<<< * if self.doc.getDocInfo(&info).isDict() == gTrue: * Dict_to_pydict(info.getDict(), result) */ - __Pyx_TraceLine(169,0,__PYX_ERR(6, 169, __pyx_L1_error)) - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 169, __pyx_L1_error) + __Pyx_TraceLine(179,0,__PYX_ERR(6, 179, __pyx_L1_error)) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_result = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "src/pyxpdf/document.pxi":170 + /* "src/pyxpdf/document.pxi":180 * Object info * dict result = {} * if self.doc.getDocInfo(&info).isDict() == gTrue: # <<<<<<<<<<<<<< * Dict_to_pydict(info.getDict(), result) * info.free() */ - __Pyx_TraceLine(170,0,__PYX_ERR(6, 170, __pyx_L1_error)) + __Pyx_TraceLine(180,0,__PYX_ERR(6, 180, __pyx_L1_error)) __pyx_t_2 = ((__pyx_v_self->doc->getDocInfo((&__pyx_v_info))->isDict() == gTrue) != 0); if (__pyx_t_2) { - /* "src/pyxpdf/document.pxi":171 + /* "src/pyxpdf/document.pxi":181 * dict result = {} * if self.doc.getDocInfo(&info).isDict() == gTrue: * Dict_to_pydict(info.getDict(), result) # <<<<<<<<<<<<<< * info.free() * return result */ - __Pyx_TraceLine(171,0,__PYX_ERR(6, 171, __pyx_L1_error)) + __Pyx_TraceLine(181,0,__PYX_ERR(6, 181, __pyx_L1_error)) __pyx_t_3.__pyx_n = 1; __pyx_t_3.pydict = __pyx_v_result; - __pyx_t_1 = __pyx_f_6pyxpdf_4xpdf_Dict_to_pydict(__pyx_v_info.getDict(), &__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 171, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6pyxpdf_4xpdf_Dict_to_pydict(__pyx_v_info.getDict(), &__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "src/pyxpdf/document.pxi":170 + /* "src/pyxpdf/document.pxi":180 * Object info * dict result = {} * if self.doc.getDocInfo(&info).isDict() == gTrue: # <<<<<<<<<<<<<< @@ -24412,31 +24632,31 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document_get_info_dict(struct __pyx_obj_ */ } - /* "src/pyxpdf/document.pxi":172 + /* "src/pyxpdf/document.pxi":182 * if self.doc.getDocInfo(&info).isDict() == gTrue: * Dict_to_pydict(info.getDict(), result) * info.free() # <<<<<<<<<<<<<< * return result * */ - __Pyx_TraceLine(172,0,__PYX_ERR(6, 172, __pyx_L1_error)) + __Pyx_TraceLine(182,0,__PYX_ERR(6, 182, __pyx_L1_error)) __pyx_v_info.free(); - /* "src/pyxpdf/document.pxi":173 + /* "src/pyxpdf/document.pxi":183 * Dict_to_pydict(info.getDict(), result) * info.free() * return result # <<<<<<<<<<<<<< * * cdef get_metadata(self): */ - __Pyx_TraceLine(173,0,__PYX_ERR(6, 173, __pyx_L1_error)) + __Pyx_TraceLine(183,0,__PYX_ERR(6, 183, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; - /* "src/pyxpdf/document.pxi":166 - * use_media_box, crop, printing) + /* "src/pyxpdf/document.pxi":176 + * use_media_box, crop, printing) * * cdef dict get_info_dict(self): # <<<<<<<<<<<<<< * cdef: @@ -24456,7 +24676,7 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document_get_info_dict(struct __pyx_obj_ return __pyx_r; } -/* "src/pyxpdf/document.pxi":175 +/* "src/pyxpdf/document.pxi":185 * return result * * cdef get_metadata(self): # <<<<<<<<<<<<<< @@ -24475,45 +24695,45 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document_get_metadata(struct __pyx_obj_6 const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_metadata", 0); - __Pyx_TraceCall("get_metadata", __pyx_f[6], 175, 0, __PYX_ERR(6, 175, __pyx_L1_error)); + __Pyx_TraceCall("get_metadata", __pyx_f[6], 185, 0, __PYX_ERR(6, 185, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":177 + /* "src/pyxpdf/document.pxi":187 * cdef get_metadata(self): * cdef unique_ptr[GString] meta * meta.reset(self.doc.readMetadata()) # <<<<<<<<<<<<<< * if meta.get(): * return GString_to_unicode(meta.get()) */ - __Pyx_TraceLine(177,0,__PYX_ERR(6, 177, __pyx_L1_error)) + __Pyx_TraceLine(187,0,__PYX_ERR(6, 187, __pyx_L1_error)) __pyx_v_meta.reset(__pyx_v_self->doc->readMetadata()); - /* "src/pyxpdf/document.pxi":178 + /* "src/pyxpdf/document.pxi":188 * cdef unique_ptr[GString] meta * meta.reset(self.doc.readMetadata()) * if meta.get(): # <<<<<<<<<<<<<< * return GString_to_unicode(meta.get()) * return None */ - __Pyx_TraceLine(178,0,__PYX_ERR(6, 178, __pyx_L1_error)) + __Pyx_TraceLine(188,0,__PYX_ERR(6, 188, __pyx_L1_error)) __pyx_t_1 = (__pyx_v_meta.get() != 0); if (__pyx_t_1) { - /* "src/pyxpdf/document.pxi":179 + /* "src/pyxpdf/document.pxi":189 * meta.reset(self.doc.readMetadata()) * if meta.get(): * return GString_to_unicode(meta.get()) # <<<<<<<<<<<<<< * return None * */ - __Pyx_TraceLine(179,0,__PYX_ERR(6, 179, __pyx_L1_error)) + __Pyx_TraceLine(189,0,__PYX_ERR(6, 189, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_6pyxpdf_4xpdf_GString_to_unicode(__pyx_v_meta.get()); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 179, __pyx_L1_error) + __pyx_t_2 = __pyx_f_6pyxpdf_4xpdf_GString_to_unicode(__pyx_v_meta.get()); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "src/pyxpdf/document.pxi":178 + /* "src/pyxpdf/document.pxi":188 * cdef unique_ptr[GString] meta * meta.reset(self.doc.readMetadata()) * if meta.get(): # <<<<<<<<<<<<<< @@ -24522,19 +24742,19 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document_get_metadata(struct __pyx_obj_6 */ } - /* "src/pyxpdf/document.pxi":180 + /* "src/pyxpdf/document.pxi":190 * if meta.get(): * return GString_to_unicode(meta.get()) * return None # <<<<<<<<<<<<<< * * cdef _load_from_file(self, GString *pdf): */ - __Pyx_TraceLine(180,0,__PYX_ERR(6, 180, __pyx_L1_error)) + __Pyx_TraceLine(190,0,__PYX_ERR(6, 190, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "src/pyxpdf/document.pxi":175 + /* "src/pyxpdf/document.pxi":185 * return result * * cdef get_metadata(self): # <<<<<<<<<<<<<< @@ -24554,7 +24774,7 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document_get_metadata(struct __pyx_obj_6 return __pyx_r; } -/* "src/pyxpdf/document.pxi":182 +/* "src/pyxpdf/document.pxi":192 * return None * * cdef _load_from_file(self, GString *pdf): # <<<<<<<<<<<<<< @@ -24572,44 +24792,44 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document__load_from_file(struct __pyx_ob const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_load_from_file", 0); - __Pyx_TraceCall("_load_from_file", __pyx_f[6], 182, 0, __PYX_ERR(6, 182, __pyx_L1_error)); + __Pyx_TraceCall("_load_from_file", __pyx_f[6], 192, 0, __PYX_ERR(6, 192, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":183 + /* "src/pyxpdf/document.pxi":193 * * cdef _load_from_file(self, GString *pdf): * self.doc = new PDFDoc(pdf, self.ownerpass, self.userpass) # <<<<<<<<<<<<<< * if self.doc == NULL: * raise MemoryError("Cannot allocate memory for internal objects") */ - __Pyx_TraceLine(183,0,__PYX_ERR(6, 183, __pyx_L1_error)) + __Pyx_TraceLine(193,0,__PYX_ERR(6, 193, __pyx_L1_error)) __pyx_v_self->doc = new PDFDoc(__pyx_v_pdf, __pyx_v_self->ownerpass, __pyx_v_self->userpass); - /* "src/pyxpdf/document.pxi":184 + /* "src/pyxpdf/document.pxi":194 * cdef _load_from_file(self, GString *pdf): * self.doc = new PDFDoc(pdf, self.ownerpass, self.userpass) * if self.doc == NULL: # <<<<<<<<<<<<<< * raise MemoryError("Cannot allocate memory for internal objects") * */ - __Pyx_TraceLine(184,0,__PYX_ERR(6, 184, __pyx_L1_error)) + __Pyx_TraceLine(194,0,__PYX_ERR(6, 194, __pyx_L1_error)) __pyx_t_1 = ((__pyx_v_self->doc == NULL) != 0); if (unlikely(__pyx_t_1)) { - /* "src/pyxpdf/document.pxi":185 + /* "src/pyxpdf/document.pxi":195 * self.doc = new PDFDoc(pdf, self.ownerpass, self.userpass) * if self.doc == NULL: * raise MemoryError("Cannot allocate memory for internal objects") # <<<<<<<<<<<<<< * * cdef _load_from_char_array(self, char *pdf, int data_length): */ - __Pyx_TraceLine(185,0,__PYX_ERR(6, 185, __pyx_L1_error)) - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__78, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 185, __pyx_L1_error) + __Pyx_TraceLine(195,0,__PYX_ERR(6, 195, __pyx_L1_error)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__79, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(6, 185, __pyx_L1_error) + __PYX_ERR(6, 195, __pyx_L1_error) - /* "src/pyxpdf/document.pxi":184 + /* "src/pyxpdf/document.pxi":194 * cdef _load_from_file(self, GString *pdf): * self.doc = new PDFDoc(pdf, self.ownerpass, self.userpass) * if self.doc == NULL: # <<<<<<<<<<<<<< @@ -24618,7 +24838,7 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document__load_from_file(struct __pyx_ob */ } - /* "src/pyxpdf/document.pxi":182 + /* "src/pyxpdf/document.pxi":192 * return None * * cdef _load_from_file(self, GString *pdf): # <<<<<<<<<<<<<< @@ -24640,7 +24860,7 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document__load_from_file(struct __pyx_ob return __pyx_r; } -/* "src/pyxpdf/document.pxi":187 +/* "src/pyxpdf/document.pxi":197 * raise MemoryError("Cannot allocate memory for internal objects") * * cdef _load_from_char_array(self, char *pdf, int data_length): # <<<<<<<<<<<<<< @@ -24660,54 +24880,54 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document__load_from_char_array(struct __ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_load_from_char_array", 0); - __Pyx_TraceCall("_load_from_char_array", __pyx_f[6], 187, 0, __PYX_ERR(6, 187, __pyx_L1_error)); + __Pyx_TraceCall("_load_from_char_array", __pyx_f[6], 197, 0, __PYX_ERR(6, 197, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":192 + /* "src/pyxpdf/document.pxi":202 * MemStream *mem_stream * * obj_null = new Object() # <<<<<<<<<<<<<< * mem_stream = new MemStream(pdf, 0, data_length, obj_null.initNull()) * */ - __Pyx_TraceLine(192,0,__PYX_ERR(6, 192, __pyx_L1_error)) + __Pyx_TraceLine(202,0,__PYX_ERR(6, 202, __pyx_L1_error)) __pyx_v_obj_null = new Object(); - /* "src/pyxpdf/document.pxi":193 + /* "src/pyxpdf/document.pxi":203 * * obj_null = new Object() * mem_stream = new MemStream(pdf, 0, data_length, obj_null.initNull()) # <<<<<<<<<<<<<< * * if mem_stream == NULL: */ - __Pyx_TraceLine(193,0,__PYX_ERR(6, 193, __pyx_L1_error)) + __Pyx_TraceLine(203,0,__PYX_ERR(6, 203, __pyx_L1_error)) __pyx_v_mem_stream = new MemStream(__pyx_v_pdf, 0, __pyx_v_data_length, __pyx_v_obj_null->initNull()); - /* "src/pyxpdf/document.pxi":195 + /* "src/pyxpdf/document.pxi":205 * mem_stream = new MemStream(pdf, 0, data_length, obj_null.initNull()) * * if mem_stream == NULL: # <<<<<<<<<<<<<< * raise MemoryError("Cannot allocate memory for internal objects") * self.doc = new PDFDoc(mem_stream, self.ownerpass, self.userpass) */ - __Pyx_TraceLine(195,0,__PYX_ERR(6, 195, __pyx_L1_error)) + __Pyx_TraceLine(205,0,__PYX_ERR(6, 205, __pyx_L1_error)) __pyx_t_1 = ((__pyx_v_mem_stream == NULL) != 0); if (unlikely(__pyx_t_1)) { - /* "src/pyxpdf/document.pxi":196 + /* "src/pyxpdf/document.pxi":206 * * if mem_stream == NULL: * raise MemoryError("Cannot allocate memory for internal objects") # <<<<<<<<<<<<<< * self.doc = new PDFDoc(mem_stream, self.ownerpass, self.userpass) * */ - __Pyx_TraceLine(196,0,__PYX_ERR(6, 196, __pyx_L1_error)) - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__78, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 196, __pyx_L1_error) + __Pyx_TraceLine(206,0,__PYX_ERR(6, 206, __pyx_L1_error)) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__79, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(6, 196, __pyx_L1_error) + __PYX_ERR(6, 206, __pyx_L1_error) - /* "src/pyxpdf/document.pxi":195 + /* "src/pyxpdf/document.pxi":205 * mem_stream = new MemStream(pdf, 0, data_length, obj_null.initNull()) * * if mem_stream == NULL: # <<<<<<<<<<<<<< @@ -24716,27 +24936,27 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document__load_from_char_array(struct __ */ } - /* "src/pyxpdf/document.pxi":197 + /* "src/pyxpdf/document.pxi":207 * if mem_stream == NULL: * raise MemoryError("Cannot allocate memory for internal objects") * self.doc = new PDFDoc(mem_stream, self.ownerpass, self.userpass) # <<<<<<<<<<<<<< * * del obj_null */ - __Pyx_TraceLine(197,0,__PYX_ERR(6, 197, __pyx_L1_error)) + __Pyx_TraceLine(207,0,__PYX_ERR(6, 207, __pyx_L1_error)) __pyx_v_self->doc = new PDFDoc(__pyx_v_mem_stream, __pyx_v_self->ownerpass, __pyx_v_self->userpass); - /* "src/pyxpdf/document.pxi":199 + /* "src/pyxpdf/document.pxi":209 * self.doc = new PDFDoc(mem_stream, self.ownerpass, self.userpass) * * del obj_null # <<<<<<<<<<<<<< * * cdef check(self): */ - __Pyx_TraceLine(199,0,__PYX_ERR(6, 199, __pyx_L1_error)) + __Pyx_TraceLine(209,0,__PYX_ERR(6, 209, __pyx_L1_error)) delete __pyx_v_obj_null; - /* "src/pyxpdf/document.pxi":187 + /* "src/pyxpdf/document.pxi":197 * raise MemoryError("Cannot allocate memory for internal objects") * * cdef _load_from_char_array(self, char *pdf, int data_length): # <<<<<<<<<<<<<< @@ -24758,7 +24978,7 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document__load_from_char_array(struct __ return __pyx_r; } -/* "src/pyxpdf/document.pxi":201 +/* "src/pyxpdf/document.pxi":211 * del obj_null * * cdef check(self): # <<<<<<<<<<<<<< @@ -24779,16 +24999,16 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document_check(struct __pyx_obj_6pyxpdf_ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("check", 0); - __Pyx_TraceCall("check", __pyx_f[6], 201, 0, __PYX_ERR(6, 201, __pyx_L1_error)); + __Pyx_TraceCall("check", __pyx_f[6], 211, 0, __PYX_ERR(6, 211, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":202 + /* "src/pyxpdf/document.pxi":212 * * cdef check(self): * if self.doc.isOk() == gTrue or self.doc.getErrorCode() == errEncrypted: # <<<<<<<<<<<<<< * if self.doc.getErrorCode() == errEncrypted: * raise PDFPermissionError("PDF cannot be decrypted please provide correct passwords.") */ - __Pyx_TraceLine(202,0,__PYX_ERR(6, 202, __pyx_L1_error)) + __Pyx_TraceLine(212,0,__PYX_ERR(6, 212, __pyx_L1_error)) __pyx_t_2 = ((__pyx_v_self->doc->isOk() == gTrue) != 0); if (!__pyx_t_2) { } else { @@ -24800,32 +25020,32 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document_check(struct __pyx_obj_6pyxpdf_ __pyx_L4_bool_binop_done:; if (__pyx_t_1) { - /* "src/pyxpdf/document.pxi":203 + /* "src/pyxpdf/document.pxi":213 * cdef check(self): * if self.doc.isOk() == gTrue or self.doc.getErrorCode() == errEncrypted: * if self.doc.getErrorCode() == errEncrypted: # <<<<<<<<<<<<<< * raise PDFPermissionError("PDF cannot be decrypted please provide correct passwords.") * elif self.doc.getErrorCode() == errOpenFile: */ - __Pyx_TraceLine(203,0,__PYX_ERR(6, 203, __pyx_L1_error)) + __Pyx_TraceLine(213,0,__PYX_ERR(6, 213, __pyx_L1_error)) __pyx_t_1 = ((__pyx_v_self->doc->getErrorCode() == errEncrypted) != 0); if (unlikely(__pyx_t_1)) { - /* "src/pyxpdf/document.pxi":204 + /* "src/pyxpdf/document.pxi":214 * if self.doc.isOk() == gTrue or self.doc.getErrorCode() == errEncrypted: * if self.doc.getErrorCode() == errEncrypted: * raise PDFPermissionError("PDF cannot be decrypted please provide correct passwords.") # <<<<<<<<<<<<<< * elif self.doc.getErrorCode() == errOpenFile: * raise PDFIOError(f"Failed to load {self.filename}") */ - __Pyx_TraceLine(204,0,__PYX_ERR(6, 204, __pyx_L1_error)) - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6pyxpdf_4xpdf_PDFPermissionError), __pyx_tuple__79, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 204, __pyx_L1_error) + __Pyx_TraceLine(214,0,__PYX_ERR(6, 214, __pyx_L1_error)) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6pyxpdf_4xpdf_PDFPermissionError), __pyx_tuple__80, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(6, 204, __pyx_L1_error) + __PYX_ERR(6, 214, __pyx_L1_error) - /* "src/pyxpdf/document.pxi":203 + /* "src/pyxpdf/document.pxi":213 * cdef check(self): * if self.doc.isOk() == gTrue or self.doc.getErrorCode() == errEncrypted: * if self.doc.getErrorCode() == errEncrypted: # <<<<<<<<<<<<<< @@ -24834,7 +25054,7 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document_check(struct __pyx_obj_6pyxpdf_ */ } - /* "src/pyxpdf/document.pxi":202 + /* "src/pyxpdf/document.pxi":212 * * cdef check(self): * if self.doc.isOk() == gTrue or self.doc.getErrorCode() == errEncrypted: # <<<<<<<<<<<<<< @@ -24844,41 +25064,41 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document_check(struct __pyx_obj_6pyxpdf_ goto __pyx_L3; } - /* "src/pyxpdf/document.pxi":205 + /* "src/pyxpdf/document.pxi":215 * if self.doc.getErrorCode() == errEncrypted: * raise PDFPermissionError("PDF cannot be decrypted please provide correct passwords.") * elif self.doc.getErrorCode() == errOpenFile: # <<<<<<<<<<<<<< * raise PDFIOError(f"Failed to load {self.filename}") * else: */ - __Pyx_TraceLine(205,0,__PYX_ERR(6, 205, __pyx_L1_error)) + __Pyx_TraceLine(215,0,__PYX_ERR(6, 215, __pyx_L1_error)) __pyx_t_1 = ((__pyx_v_self->doc->getErrorCode() == errOpenFile) != 0); if (unlikely(__pyx_t_1)) { - /* "src/pyxpdf/document.pxi":206 + /* "src/pyxpdf/document.pxi":216 * raise PDFPermissionError("PDF cannot be decrypted please provide correct passwords.") * elif self.doc.getErrorCode() == errOpenFile: * raise PDFIOError(f"Failed to load {self.filename}") # <<<<<<<<<<<<<< * else: * err_code = self.doc.getErrorCode() */ - __Pyx_TraceLine(206,0,__PYX_ERR(6, 206, __pyx_L1_error)) - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_filename); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 206, __pyx_L1_error) + __Pyx_TraceLine(216,0,__PYX_ERR(6, 216, __pyx_L1_error)) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_filename); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 206, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Failed_to_load, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 206, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Failed_to_load, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6pyxpdf_4xpdf_PDFIOError), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 206, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6pyxpdf_4xpdf_PDFIOError), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(6, 206, __pyx_L1_error) + __PYX_ERR(6, 216, __pyx_L1_error) - /* "src/pyxpdf/document.pxi":205 + /* "src/pyxpdf/document.pxi":215 * if self.doc.getErrorCode() == errEncrypted: * raise PDFPermissionError("PDF cannot be decrypted please provide correct passwords.") * elif self.doc.getErrorCode() == errOpenFile: # <<<<<<<<<<<<<< @@ -24887,37 +25107,37 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document_check(struct __pyx_obj_6pyxpdf_ */ } - /* "src/pyxpdf/document.pxi":208 + /* "src/pyxpdf/document.pxi":218 * raise PDFIOError(f"Failed to load {self.filename}") * else: * err_code = self.doc.getErrorCode() # <<<<<<<<<<<<<< * raise ErrorCodeMapping[err_code] * */ - __Pyx_TraceLine(208,0,__PYX_ERR(6, 208, __pyx_L1_error)) + __Pyx_TraceLine(218,0,__PYX_ERR(6, 218, __pyx_L1_error)) /*else*/ { __pyx_v_err_code = __pyx_v_self->doc->getErrorCode(); - /* "src/pyxpdf/document.pxi":209 + /* "src/pyxpdf/document.pxi":219 * else: * err_code = self.doc.getErrorCode() * raise ErrorCodeMapping[err_code] # <<<<<<<<<<<<<< * * cdef int label_to_index(self, label): */ - __Pyx_TraceLine(209,0,__PYX_ERR(6, 209, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ErrorCodeMapping); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 209, __pyx_L1_error) + __Pyx_TraceLine(219,0,__PYX_ERR(6, 219, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ErrorCodeMapping); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, __pyx_v_err_code, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 209, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, __pyx_v_err_code, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(6, 209, __pyx_L1_error) + __PYX_ERR(6, 219, __pyx_L1_error) } __pyx_L3:; - /* "src/pyxpdf/document.pxi":201 + /* "src/pyxpdf/document.pxi":211 * del obj_null * * cdef check(self): # <<<<<<<<<<<<<< @@ -24940,7 +25160,7 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document_check(struct __pyx_obj_6pyxpdf_ return __pyx_r; } -/* "src/pyxpdf/document.pxi":211 +/* "src/pyxpdf/document.pxi":221 * raise ErrorCodeMapping[err_code] * * cdef int label_to_index(self, label): # <<<<<<<<<<<<<< @@ -24959,50 +25179,50 @@ static int __pyx_f_6pyxpdf_4xpdf_8Document_label_to_index(struct __pyx_obj_6pyxp const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("label_to_index", 0); - __Pyx_TraceCall("label_to_index", __pyx_f[6], 211, 0, __PYX_ERR(6, 211, __pyx_L1_error)); + __Pyx_TraceCall("label_to_index", __pyx_f[6], 221, 0, __PYX_ERR(6, 221, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":216 + /* "src/pyxpdf/document.pxi":226 * unique_ptr[TextString] tstr * * tstr.reset(to_TextString(label)) # <<<<<<<<<<<<<< * pgno = self.get_catalog().getPageNumFromPageLabel(tstr.get()) * # xpdf page index start from 1 not 0 */ - __Pyx_TraceLine(216,0,__PYX_ERR(6, 216, __pyx_L1_error)) + __Pyx_TraceLine(226,0,__PYX_ERR(6, 226, __pyx_L1_error)) __pyx_v_tstr.reset(__pyx_f_6pyxpdf_4xpdf_to_TextString(__pyx_v_label)); - /* "src/pyxpdf/document.pxi":217 + /* "src/pyxpdf/document.pxi":227 * * tstr.reset(to_TextString(label)) * pgno = self.get_catalog().getPageNumFromPageLabel(tstr.get()) # <<<<<<<<<<<<<< * # xpdf page index start from 1 not 0 * if pgno != -1: */ - __Pyx_TraceLine(217,0,__PYX_ERR(6, 217, __pyx_L1_error)) + __Pyx_TraceLine(227,0,__PYX_ERR(6, 227, __pyx_L1_error)) __pyx_v_pgno = ((struct __pyx_vtabstruct_6pyxpdf_4xpdf_Document *)__pyx_v_self->__pyx_vtab)->get_catalog(__pyx_v_self)->getPageNumFromPageLabel(__pyx_v_tstr.get()); - /* "src/pyxpdf/document.pxi":219 + /* "src/pyxpdf/document.pxi":229 * pgno = self.get_catalog().getPageNumFromPageLabel(tstr.get()) * # xpdf page index start from 1 not 0 * if pgno != -1: # <<<<<<<<<<<<<< * pgno = pgno - 1 * return pgno */ - __Pyx_TraceLine(219,0,__PYX_ERR(6, 219, __pyx_L1_error)) + __Pyx_TraceLine(229,0,__PYX_ERR(6, 229, __pyx_L1_error)) __pyx_t_1 = ((__pyx_v_pgno != -1L) != 0); if (__pyx_t_1) { - /* "src/pyxpdf/document.pxi":220 + /* "src/pyxpdf/document.pxi":230 * # xpdf page index start from 1 not 0 * if pgno != -1: * pgno = pgno - 1 # <<<<<<<<<<<<<< * return pgno * */ - __Pyx_TraceLine(220,0,__PYX_ERR(6, 220, __pyx_L1_error)) + __Pyx_TraceLine(230,0,__PYX_ERR(6, 230, __pyx_L1_error)) __pyx_v_pgno = (__pyx_v_pgno - 1); - /* "src/pyxpdf/document.pxi":219 + /* "src/pyxpdf/document.pxi":229 * pgno = self.get_catalog().getPageNumFromPageLabel(tstr.get()) * # xpdf page index start from 1 not 0 * if pgno != -1: # <<<<<<<<<<<<<< @@ -25011,18 +25231,18 @@ static int __pyx_f_6pyxpdf_4xpdf_8Document_label_to_index(struct __pyx_obj_6pyxp */ } - /* "src/pyxpdf/document.pxi":221 + /* "src/pyxpdf/document.pxi":231 * if pgno != -1: * pgno = pgno - 1 * return pgno # <<<<<<<<<<<<<< * * cdef get_page(self, int idx): */ - __Pyx_TraceLine(221,0,__PYX_ERR(6, 221, __pyx_L1_error)) + __Pyx_TraceLine(231,0,__PYX_ERR(6, 231, __pyx_L1_error)) __pyx_r = __pyx_v_pgno; goto __pyx_L0; - /* "src/pyxpdf/document.pxi":211 + /* "src/pyxpdf/document.pxi":221 * raise ErrorCodeMapping[err_code] * * cdef int label_to_index(self, label): # <<<<<<<<<<<<<< @@ -25040,7 +25260,7 @@ static int __pyx_f_6pyxpdf_4xpdf_8Document_label_to_index(struct __pyx_obj_6pyxp return __pyx_r; } -/* "src/pyxpdf/document.pxi":223 +/* "src/pyxpdf/document.pxi":233 * return pgno * * cdef get_page(self, int idx): # <<<<<<<<<<<<<< @@ -25061,72 +25281,72 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document_get_page(struct __pyx_obj_6pyxp const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_page", 0); - __Pyx_TraceCall("get_page", __pyx_f[6], 223, 0, __PYX_ERR(6, 223, __pyx_L1_error)); + __Pyx_TraceCall("get_page", __pyx_f[6], 233, 0, __PYX_ERR(6, 233, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":224 + /* "src/pyxpdf/document.pxi":234 * * cdef get_page(self, int idx): * if idx < 0 or idx >= self.num_pages: # <<<<<<<<<<<<<< * raise IndexError( * "The index {idx} is out of page range".format(idx=idx)) */ - __Pyx_TraceLine(224,0,__PYX_ERR(6, 224, __pyx_L1_error)) + __Pyx_TraceLine(234,0,__PYX_ERR(6, 234, __pyx_L1_error)) __pyx_t_2 = ((__pyx_v_idx < 0) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 224, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_pages); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 224, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_pages); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 224, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 234, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 224, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 234, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (unlikely(__pyx_t_1)) { - /* "src/pyxpdf/document.pxi":226 + /* "src/pyxpdf/document.pxi":236 * if idx < 0 or idx >= self.num_pages: * raise IndexError( * "The index {idx} is out of page range".format(idx=idx)) # <<<<<<<<<<<<<< * # load page in cache if not present * if self._pages_cache[idx] == None: */ - __Pyx_TraceLine(226,0,__PYX_ERR(6, 226, __pyx_L1_error)) - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_The_index_idx_is_out_of_page_ran, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 226, __pyx_L1_error) + __Pyx_TraceLine(236,0,__PYX_ERR(6, 236, __pyx_L1_error)) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_The_index_idx_is_out_of_page_ran, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 226, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 226, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_idx, __pyx_t_3) < 0) __PYX_ERR(6, 226, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_idx, __pyx_t_3) < 0) __PYX_ERR(6, 236, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 226, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "src/pyxpdf/document.pxi":225 + /* "src/pyxpdf/document.pxi":235 * cdef get_page(self, int idx): * if idx < 0 or idx >= self.num_pages: * raise IndexError( # <<<<<<<<<<<<<< * "The index {idx} is out of page range".format(idx=idx)) * # load page in cache if not present */ - __Pyx_TraceLine(225,0,__PYX_ERR(6, 225, __pyx_L1_error)) - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 225, __pyx_L1_error) + __Pyx_TraceLine(235,0,__PYX_ERR(6, 235, __pyx_L1_error)) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(6, 225, __pyx_L1_error) + __PYX_ERR(6, 235, __pyx_L1_error) - /* "src/pyxpdf/document.pxi":224 + /* "src/pyxpdf/document.pxi":234 * * cdef get_page(self, int idx): * if idx < 0 or idx >= self.num_pages: # <<<<<<<<<<<<<< @@ -25135,37 +25355,37 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document_get_page(struct __pyx_obj_6pyxp */ } - /* "src/pyxpdf/document.pxi":228 + /* "src/pyxpdf/document.pxi":238 * "The index {idx} is out of page range".format(idx=idx)) * # load page in cache if not present * if self._pages_cache[idx] == None: # <<<<<<<<<<<<<< * self._pages_cache[idx] = Page(self, idx) * return self._pages_cache[idx] */ - __Pyx_TraceLine(228,0,__PYX_ERR(6, 228, __pyx_L1_error)) + __Pyx_TraceLine(238,0,__PYX_ERR(6, 238, __pyx_L1_error)) if (unlikely(__pyx_v_self->_pages_cache == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(6, 228, __pyx_L1_error) + __PYX_ERR(6, 238, __pyx_L1_error) } - __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_self->_pages_cache, __pyx_v_idx, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 228, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_self->_pages_cache, __pyx_v_idx, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 228, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 238, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 228, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 238, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "src/pyxpdf/document.pxi":229 + /* "src/pyxpdf/document.pxi":239 * # load page in cache if not present * if self._pages_cache[idx] == None: * self._pages_cache[idx] = Page(self, idx) # <<<<<<<<<<<<<< * return self._pages_cache[idx] * */ - __Pyx_TraceLine(229,0,__PYX_ERR(6, 229, __pyx_L1_error)) - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 229, __pyx_L1_error) + __Pyx_TraceLine(239,0,__PYX_ERR(6, 239, __pyx_L1_error)) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 229, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); @@ -25173,17 +25393,17 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document_get_page(struct __pyx_obj_6pyxp __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6pyxpdf_4xpdf_Page), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 229, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6pyxpdf_4xpdf_Page), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_v_self->_pages_cache == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(6, 229, __pyx_L1_error) + __PYX_ERR(6, 239, __pyx_L1_error) } - if (unlikely(__Pyx_SetItemInt(__pyx_v_self->_pages_cache, __pyx_v_idx, __pyx_t_3, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0)) __PYX_ERR(6, 229, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_self->_pages_cache, __pyx_v_idx, __pyx_t_3, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0)) __PYX_ERR(6, 239, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "src/pyxpdf/document.pxi":228 + /* "src/pyxpdf/document.pxi":238 * "The index {idx} is out of page range".format(idx=idx)) * # load page in cache if not present * if self._pages_cache[idx] == None: # <<<<<<<<<<<<<< @@ -25192,26 +25412,26 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document_get_page(struct __pyx_obj_6pyxp */ } - /* "src/pyxpdf/document.pxi":230 + /* "src/pyxpdf/document.pxi":240 * if self._pages_cache[idx] == None: * self._pages_cache[idx] = Page(self, idx) * return self._pages_cache[idx] # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(230,0,__PYX_ERR(6, 230, __pyx_L1_error)) + __Pyx_TraceLine(240,0,__PYX_ERR(6, 240, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); if (unlikely(__pyx_v_self->_pages_cache == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(6, 230, __pyx_L1_error) + __PYX_ERR(6, 240, __pyx_L1_error) } - __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_self->_pages_cache, __pyx_v_idx, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 230, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_self->_pages_cache, __pyx_v_idx, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "src/pyxpdf/document.pxi":223 + /* "src/pyxpdf/document.pxi":233 * return pgno * * cdef get_page(self, int idx): # <<<<<<<<<<<<<< @@ -25233,7 +25453,7 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document_get_page(struct __pyx_obj_6pyxp return __pyx_r; } -/* "src/pyxpdf/document.pxi":235 +/* "src/pyxpdf/document.pxi":245 * * @property * def filename(self): # <<<<<<<<<<<<<< @@ -25263,24 +25483,24 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_8filename___get__(struct __pyx const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[6], 235, 0, __PYX_ERR(6, 235, __pyx_L1_error)); + __Pyx_TraceCall("__get__", __pyx_f[6], 245, 0, __PYX_ERR(6, 245, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":241 + /* "src/pyxpdf/document.pxi":251 * empty `str`. * """ * return GString_to_unicode(self.doc.getFileName()) # <<<<<<<<<<<<<< * * @property */ - __Pyx_TraceLine(241,0,__PYX_ERR(6, 241, __pyx_L1_error)) + __Pyx_TraceLine(251,0,__PYX_ERR(6, 251, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_6pyxpdf_4xpdf_GString_to_unicode(__pyx_v_self->doc->getFileName()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 241, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6pyxpdf_4xpdf_GString_to_unicode(__pyx_v_self->doc->getFileName()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "src/pyxpdf/document.pxi":235 + /* "src/pyxpdf/document.pxi":245 * * @property * def filename(self): # <<<<<<<<<<<<<< @@ -25300,7 +25520,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_8filename___get__(struct __pyx return __pyx_r; } -/* "src/pyxpdf/document.pxi":244 +/* "src/pyxpdf/document.pxi":254 * * @property * def has_page_labels(self): # <<<<<<<<<<<<<< @@ -25330,24 +25550,24 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_15has_page_labels___get__(stru const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[6], 244, 0, __PYX_ERR(6, 244, __pyx_L1_error)); + __Pyx_TraceCall("__get__", __pyx_f[6], 254, 0, __PYX_ERR(6, 254, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":247 + /* "src/pyxpdf/document.pxi":257 * """bool: whether pdf has page labels or not * """ * return GBool_to_bool(self.get_catalog().hasPageLabels()) # <<<<<<<<<<<<<< * * @property */ - __Pyx_TraceLine(247,0,__PYX_ERR(6, 247, __pyx_L1_error)) + __Pyx_TraceLine(257,0,__PYX_ERR(6, 257, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_6pyxpdf_4xpdf_GBool_to_bool(((struct __pyx_vtabstruct_6pyxpdf_4xpdf_Document *)__pyx_v_self->__pyx_vtab)->get_catalog(__pyx_v_self)->hasPageLabels()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 247, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6pyxpdf_4xpdf_GBool_to_bool(((struct __pyx_vtabstruct_6pyxpdf_4xpdf_Document *)__pyx_v_self->__pyx_vtab)->get_catalog(__pyx_v_self)->hasPageLabels()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "src/pyxpdf/document.pxi":244 + /* "src/pyxpdf/document.pxi":254 * * @property * def has_page_labels(self): # <<<<<<<<<<<<<< @@ -25367,7 +25587,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_15has_page_labels___get__(stru return __pyx_r; } -/* "src/pyxpdf/document.pxi":250 +/* "src/pyxpdf/document.pxi":260 * * @property * def num_pages(self): # <<<<<<<<<<<<<< @@ -25397,24 +25617,24 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_9num_pages___get__(struct __py const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[6], 250, 0, __PYX_ERR(6, 250, __pyx_L1_error)); + __Pyx_TraceCall("__get__", __pyx_f[6], 260, 0, __PYX_ERR(6, 260, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":253 + /* "src/pyxpdf/document.pxi":263 * """int: total pages in pdf * """ * return self.doc.getNumPages() # <<<<<<<<<<<<<< * * @property */ - __Pyx_TraceLine(253,0,__PYX_ERR(6, 253, __pyx_L1_error)) + __Pyx_TraceLine(263,0,__PYX_ERR(6, 263, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->doc->getNumPages()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 253, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->doc->getNumPages()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "src/pyxpdf/document.pxi":250 + /* "src/pyxpdf/document.pxi":260 * * @property * def num_pages(self): # <<<<<<<<<<<<<< @@ -25434,7 +25654,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_9num_pages___get__(struct __py return __pyx_r; } -/* "src/pyxpdf/document.pxi":256 +/* "src/pyxpdf/document.pxi":266 * * @property * def pdf_version(self): # <<<<<<<<<<<<<< @@ -25464,24 +25684,24 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_11pdf_version___get__(struct _ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[6], 256, 0, __PYX_ERR(6, 256, __pyx_L1_error)); + __Pyx_TraceCall("__get__", __pyx_f[6], 266, 0, __PYX_ERR(6, 266, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":259 + /* "src/pyxpdf/document.pxi":269 * """float: version of PDF standard pdf comply with * """ * return self.doc.getPDFVersion() # <<<<<<<<<<<<<< * * @property */ - __Pyx_TraceLine(259,0,__PYX_ERR(6, 259, __pyx_L1_error)) + __Pyx_TraceLine(269,0,__PYX_ERR(6, 269, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->doc->getPDFVersion()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 259, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->doc->getPDFVersion()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "src/pyxpdf/document.pxi":256 + /* "src/pyxpdf/document.pxi":266 * * @property * def pdf_version(self): # <<<<<<<<<<<<<< @@ -25501,7 +25721,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_11pdf_version___get__(struct _ return __pyx_r; } -/* "src/pyxpdf/document.pxi":262 +/* "src/pyxpdf/document.pxi":272 * * @property * def is_linearized(self): # <<<<<<<<<<<<<< @@ -25531,24 +25751,24 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_13is_linearized___get__(struct const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[6], 262, 0, __PYX_ERR(6, 262, __pyx_L1_error)); + __Pyx_TraceCall("__get__", __pyx_f[6], 272, 0, __PYX_ERR(6, 272, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":265 + /* "src/pyxpdf/document.pxi":275 * """bool: whether pdf is lineralised or not * """ * return GBool_to_bool(self.doc.isLinearized()) # <<<<<<<<<<<<<< * * @property */ - __Pyx_TraceLine(265,0,__PYX_ERR(6, 265, __pyx_L1_error)) + __Pyx_TraceLine(275,0,__PYX_ERR(6, 275, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_6pyxpdf_4xpdf_GBool_to_bool(__pyx_v_self->doc->isLinearized()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 265, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6pyxpdf_4xpdf_GBool_to_bool(__pyx_v_self->doc->isLinearized()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "src/pyxpdf/document.pxi":262 + /* "src/pyxpdf/document.pxi":272 * * @property * def is_linearized(self): # <<<<<<<<<<<<<< @@ -25568,7 +25788,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_13is_linearized___get__(struct return __pyx_r; } -/* "src/pyxpdf/document.pxi":268 +/* "src/pyxpdf/document.pxi":278 * * @property * def is_encrypted(self): # <<<<<<<<<<<<<< @@ -25598,24 +25818,24 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_12is_encrypted___get__(struct const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[6], 268, 0, __PYX_ERR(6, 268, __pyx_L1_error)); + __Pyx_TraceCall("__get__", __pyx_f[6], 278, 0, __PYX_ERR(6, 278, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":276 + /* "src/pyxpdf/document.pxi":286 * PDF documents return :obj:`True` * """ * return GBool_to_bool(self.doc.isEncrypted()) # <<<<<<<<<<<<<< * * # PDF Permissions */ - __Pyx_TraceLine(276,0,__PYX_ERR(6, 276, __pyx_L1_error)) + __Pyx_TraceLine(286,0,__PYX_ERR(6, 286, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_6pyxpdf_4xpdf_GBool_to_bool(__pyx_v_self->doc->isEncrypted()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 276, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6pyxpdf_4xpdf_GBool_to_bool(__pyx_v_self->doc->isEncrypted()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "src/pyxpdf/document.pxi":268 + /* "src/pyxpdf/document.pxi":278 * * @property * def is_encrypted(self): # <<<<<<<<<<<<<< @@ -25635,7 +25855,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_12is_encrypted___get__(struct return __pyx_r; } -/* "src/pyxpdf/document.pxi":280 +/* "src/pyxpdf/document.pxi":290 * # PDF Permissions * @property * def ok_to_print(self): # <<<<<<<<<<<<<< @@ -25665,24 +25885,24 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_11ok_to_print___get__(struct _ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[6], 280, 0, __PYX_ERR(6, 280, __pyx_L1_error)); + __Pyx_TraceCall("__get__", __pyx_f[6], 290, 0, __PYX_ERR(6, 290, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":285 + /* "src/pyxpdf/document.pxi":295 * Whether document can be printed or not. * """ * return GBool_to_bool(self.doc.okToPrint(ignoreOwnerPW=gFalse)) # <<<<<<<<<<<<<< * * @property */ - __Pyx_TraceLine(285,0,__PYX_ERR(6, 285, __pyx_L1_error)) + __Pyx_TraceLine(295,0,__PYX_ERR(6, 295, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_6pyxpdf_4xpdf_GBool_to_bool(__pyx_v_self->doc->okToPrint(gFalse)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 285, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6pyxpdf_4xpdf_GBool_to_bool(__pyx_v_self->doc->okToPrint(gFalse)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "src/pyxpdf/document.pxi":280 + /* "src/pyxpdf/document.pxi":290 * # PDF Permissions * @property * def ok_to_print(self): # <<<<<<<<<<<<<< @@ -25702,7 +25922,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_11ok_to_print___get__(struct _ return __pyx_r; } -/* "src/pyxpdf/document.pxi":288 +/* "src/pyxpdf/document.pxi":298 * * @property * def ok_to_change(self): # <<<<<<<<<<<<<< @@ -25732,24 +25952,24 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_12ok_to_change___get__(struct const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[6], 288, 0, __PYX_ERR(6, 288, __pyx_L1_error)); + __Pyx_TraceCall("__get__", __pyx_f[6], 298, 0, __PYX_ERR(6, 298, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":297 + /* "src/pyxpdf/document.pxi":307 * * """ * return GBool_to_bool(self.doc.okToChange(ignoreOwnerPW=gFalse)) # <<<<<<<<<<<<<< * * @property */ - __Pyx_TraceLine(297,0,__PYX_ERR(6, 297, __pyx_L1_error)) + __Pyx_TraceLine(307,0,__PYX_ERR(6, 307, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_6pyxpdf_4xpdf_GBool_to_bool(__pyx_v_self->doc->okToChange(gFalse)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 297, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6pyxpdf_4xpdf_GBool_to_bool(__pyx_v_self->doc->okToChange(gFalse)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "src/pyxpdf/document.pxi":288 + /* "src/pyxpdf/document.pxi":298 * * @property * def ok_to_change(self): # <<<<<<<<<<<<<< @@ -25769,7 +25989,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_12ok_to_change___get__(struct return __pyx_r; } -/* "src/pyxpdf/document.pxi":300 +/* "src/pyxpdf/document.pxi":310 * * @property * def ok_to_copy(self): # <<<<<<<<<<<<<< @@ -25799,24 +26019,24 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_10ok_to_copy___get__(struct __ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[6], 300, 0, __PYX_ERR(6, 300, __pyx_L1_error)); + __Pyx_TraceCall("__get__", __pyx_f[6], 310, 0, __PYX_ERR(6, 310, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":310 + /* "src/pyxpdf/document.pxi":320 * from document. * """ * return GBool_to_bool(self.doc.okToCopy(ignoreOwnerPW=gFalse)) # <<<<<<<<<<<<<< * * @property */ - __Pyx_TraceLine(310,0,__PYX_ERR(6, 310, __pyx_L1_error)) + __Pyx_TraceLine(320,0,__PYX_ERR(6, 320, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_6pyxpdf_4xpdf_GBool_to_bool(__pyx_v_self->doc->okToCopy(gFalse)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 310, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6pyxpdf_4xpdf_GBool_to_bool(__pyx_v_self->doc->okToCopy(gFalse)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "src/pyxpdf/document.pxi":300 + /* "src/pyxpdf/document.pxi":310 * * @property * def ok_to_copy(self): # <<<<<<<<<<<<<< @@ -25836,7 +26056,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_10ok_to_copy___get__(struct __ return __pyx_r; } -/* "src/pyxpdf/document.pxi":313 +/* "src/pyxpdf/document.pxi":323 * * @property * def ok_to_add_notes(self): # <<<<<<<<<<<<<< @@ -25866,24 +26086,24 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_15ok_to_add_notes___get__(stru const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[6], 313, 0, __PYX_ERR(6, 313, __pyx_L1_error)); + __Pyx_TraceCall("__get__", __pyx_f[6], 323, 0, __PYX_ERR(6, 323, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":316 + /* "src/pyxpdf/document.pxi":326 * """bool: PDF add notes permission * """ * return GBool_to_bool(self.doc.okToAddNotes(ignoreOwnerPW=gFalse)) # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(316,0,__PYX_ERR(6, 316, __pyx_L1_error)) + __Pyx_TraceLine(326,0,__PYX_ERR(6, 326, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_6pyxpdf_4xpdf_GBool_to_bool(__pyx_v_self->doc->okToAddNotes(gFalse)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 316, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6pyxpdf_4xpdf_GBool_to_bool(__pyx_v_self->doc->okToAddNotes(gFalse)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "src/pyxpdf/document.pxi":313 + /* "src/pyxpdf/document.pxi":323 * * @property * def ok_to_add_notes(self): # <<<<<<<<<<<<<< @@ -25903,7 +26123,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_15ok_to_add_notes___get__(stru return __pyx_r; } -/* "src/pyxpdf/document.pxi":319 +/* "src/pyxpdf/document.pxi":329 * * * def info(self): # <<<<<<<<<<<<<< @@ -25934,26 +26154,26 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_16info(struct __pyx_obj_6pyxpd int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__80) + __Pyx_TraceFrameInit(__pyx_codeobj__81) __Pyx_RefNannySetupContext("info", 0); - __Pyx_TraceCall("info", __pyx_f[6], 319, 0, __PYX_ERR(6, 319, __pyx_L1_error)); + __Pyx_TraceCall("info", __pyx_f[6], 329, 0, __PYX_ERR(6, 329, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":330 + /* "src/pyxpdf/document.pxi":340 * PDf's information dictionary. * """ * return self.get_info_dict() # <<<<<<<<<<<<<< * * def xmp_metadata(self): */ - __Pyx_TraceLine(330,0,__PYX_ERR(6, 330, __pyx_L1_error)) + __Pyx_TraceLine(340,0,__PYX_ERR(6, 340, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6pyxpdf_4xpdf_Document *)__pyx_v_self->__pyx_vtab)->get_info_dict(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 330, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_6pyxpdf_4xpdf_Document *)__pyx_v_self->__pyx_vtab)->get_info_dict(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "src/pyxpdf/document.pxi":319 + /* "src/pyxpdf/document.pxi":329 * * * def info(self): # <<<<<<<<<<<<<< @@ -25973,7 +26193,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_16info(struct __pyx_obj_6pyxpd return __pyx_r; } -/* "src/pyxpdf/document.pxi":332 +/* "src/pyxpdf/document.pxi":342 * return self.get_info_dict() * * def xmp_metadata(self): # <<<<<<<<<<<<<< @@ -26004,26 +26224,26 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_18xmp_metadata(struct __pyx_ob int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__81) + __Pyx_TraceFrameInit(__pyx_codeobj__82) __Pyx_RefNannySetupContext("xmp_metadata", 0); - __Pyx_TraceCall("xmp_metadata", __pyx_f[6], 332, 0, __PYX_ERR(6, 332, __pyx_L1_error)); + __Pyx_TraceCall("xmp_metadata", __pyx_f[6], 342, 0, __PYX_ERR(6, 342, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":339 + /* "src/pyxpdf/document.pxi":349 * str * """ * return self.get_metadata() # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(339,0,__PYX_ERR(6, 339, __pyx_L1_error)) + __Pyx_TraceLine(349,0,__PYX_ERR(6, 349, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6pyxpdf_4xpdf_Document *)__pyx_v_self->__pyx_vtab)->get_metadata(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 339, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_6pyxpdf_4xpdf_Document *)__pyx_v_self->__pyx_vtab)->get_metadata(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "src/pyxpdf/document.pxi":332 + /* "src/pyxpdf/document.pxi":342 * return self.get_info_dict() * * def xmp_metadata(self): # <<<<<<<<<<<<<< @@ -26043,7 +26263,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_18xmp_metadata(struct __pyx_ob return __pyx_r; } -/* "src/pyxpdf/document.pxi":342 +/* "src/pyxpdf/document.pxi":352 * * * cpdef text_bytes(self, int start=0, int end=-1, TextControl control=None): # <<<<<<<<<<<<<< @@ -26072,12 +26292,13 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document_text_bytes(struct __pyx_obj_6py PyObject *__pyx_t_8 = NULL; TextOutputControl __pyx_t_9; int __pyx_t_10; + struct __pyx_opt_args_6pyxpdf_4xpdf_8Document_display_pages __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__82) + __Pyx_TraceFrameInit(__pyx_codeobj__83) __Pyx_RefNannySetupContext("text_bytes", 0); - __Pyx_TraceCall("text_bytes", __pyx_f[6], 342, 0, __PYX_ERR(6, 342, __pyx_L1_error)); + __Pyx_TraceCall("text_bytes", __pyx_f[6], 352, 0, __PYX_ERR(6, 352, __pyx_L1_error)); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_start = __pyx_optional_args->start; @@ -26098,13 +26319,13 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document_text_bytes(struct __pyx_obj_6py if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_text_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 342, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_text_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6pyxpdf_4xpdf_8Document_21text_bytes)) { __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 342, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_end); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 342, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_end); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = __pyx_t_1; __pyx_t_6 = NULL; @@ -26122,7 +26343,7 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document_text_bytes(struct __pyx_obj_6py #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_control)}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 342, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 352, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -26132,7 +26353,7 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document_text_bytes(struct __pyx_obj_6py #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_control)}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 342, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 352, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -26140,7 +26361,7 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document_text_bytes(struct __pyx_obj_6py } else #endif { - __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 342, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; @@ -26154,7 +26375,7 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document_text_bytes(struct __pyx_obj_6py PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, ((PyObject *)__pyx_v_control)); __pyx_t_3 = 0; __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 342, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } @@ -26177,15 +26398,15 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document_text_bytes(struct __pyx_obj_6py #endif } - /* "src/pyxpdf/document.pxi":376 + /* "src/pyxpdf/document.pxi":386 * * cdef: * TextOutputControl text_control = deref(control.get_c_control()) if control else TextOutputControl() # <<<<<<<<<<<<<< * unique_ptr[string] out = make_unique[string]() * unique_ptr[TextOutputDev] text_dev = make_unique[TextOutputDev](&append_to_cpp_string, */ - __Pyx_TraceLine(376,0,__PYX_ERR(6, 376, __pyx_L1_error)) - __pyx_t_10 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_control)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(6, 376, __pyx_L1_error) + __Pyx_TraceLine(386,0,__PYX_ERR(6, 386, __pyx_L1_error)) + __pyx_t_10 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_control)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(6, 386, __pyx_L1_error) if (__pyx_t_10) { __pyx_t_9 = (*((struct __pyx_vtabstruct_6pyxpdf_4xpdf_TextControl *)__pyx_v_control->__pyx_vtab)->get_c_control(__pyx_v_control)); } else { @@ -26193,54 +26414,57 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document_text_bytes(struct __pyx_obj_6py } __pyx_v_text_control = __pyx_t_9; - /* "src/pyxpdf/document.pxi":377 + /* "src/pyxpdf/document.pxi":387 * cdef: * TextOutputControl text_control = deref(control.get_c_control()) if control else TextOutputControl() * unique_ptr[string] out = make_unique[string]() # <<<<<<<<<<<<<< * unique_ptr[TextOutputDev] text_dev = make_unique[TextOutputDev](&append_to_cpp_string, * out.get(), &text_control) */ - __Pyx_TraceLine(377,0,__PYX_ERR(6, 377, __pyx_L1_error)) + __Pyx_TraceLine(387,0,__PYX_ERR(6, 387, __pyx_L1_error)) __pyx_v_out = std::make_unique(); - /* "src/pyxpdf/document.pxi":378 + /* "src/pyxpdf/document.pxi":388 * TextOutputControl text_control = deref(control.get_c_control()) if control else TextOutputControl() * unique_ptr[string] out = make_unique[string]() * unique_ptr[TextOutputDev] text_dev = make_unique[TextOutputDev](&append_to_cpp_string, # <<<<<<<<<<<<<< * out.get(), &text_control) * */ - __Pyx_TraceLine(378,0,__PYX_ERR(6, 378, __pyx_L1_error)) + __Pyx_TraceLine(388,0,__PYX_ERR(6, 388, __pyx_L1_error)) __pyx_v_text_dev = std::make_unique((&__pyx_f_6pyxpdf_4xpdf_append_to_cpp_string), __pyx_v_out.get(), (&__pyx_v_text_control)); - /* "src/pyxpdf/document.pxi":381 + /* "src/pyxpdf/document.pxi":391 * out.get(), &text_control) * * self.display_pages(text_dev.get(), start, end) # <<<<<<<<<<<<<< * return deref(out) * */ - __Pyx_TraceLine(381,0,__PYX_ERR(6, 381, __pyx_L1_error)) - __pyx_t_1 = ((struct __pyx_vtabstruct_6pyxpdf_4xpdf_Document *)__pyx_v_self->__pyx_vtab)->display_pages(__pyx_v_self, __pyx_v_text_dev.get(), __pyx_v_start, __pyx_v_end, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 381, __pyx_L1_error) + __Pyx_TraceLine(391,0,__PYX_ERR(6, 391, __pyx_L1_error)) + __pyx_t_11.__pyx_n = 2; + __pyx_t_11.first = __pyx_v_start; + __pyx_t_11.end = __pyx_v_end; + __pyx_t_1 = ((struct __pyx_vtabstruct_6pyxpdf_4xpdf_Document *)__pyx_v_self->__pyx_vtab)->display_pages(__pyx_v_self, __pyx_v_text_dev.get(), &__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "src/pyxpdf/document.pxi":382 + /* "src/pyxpdf/document.pxi":392 * * self.display_pages(text_dev.get(), start, end) * return deref(out) # <<<<<<<<<<<<<< * * cpdef text(self, start=0, end=-1, control=None): */ - __Pyx_TraceLine(382,0,__PYX_ERR(6, 382, __pyx_L1_error)) + __Pyx_TraceLine(392,0,__PYX_ERR(6, 392, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string((*__pyx_v_out)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 382, __pyx_L1_error) + __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string((*__pyx_v_out)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "src/pyxpdf/document.pxi":342 + /* "src/pyxpdf/document.pxi":352 * * * cpdef text_bytes(self, int start=0, int end=-1, TextControl control=None): # <<<<<<<<<<<<<< @@ -26318,7 +26542,7 @@ static PyObject *__pyx_pw_6pyxpdf_4xpdf_8Document_21text_bytes(PyObject *__pyx_v } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "text_bytes") < 0)) __PYX_ERR(6, 342, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "text_bytes") < 0)) __PYX_ERR(6, 352, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -26333,12 +26557,12 @@ static PyObject *__pyx_pw_6pyxpdf_4xpdf_8Document_21text_bytes(PyObject *__pyx_v } } if (values[0]) { - __pyx_v_start = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_start == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 342, __pyx_L3_error) + __pyx_v_start = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_start == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 352, __pyx_L3_error) } else { __pyx_v_start = ((int)0); } if (values[1]) { - __pyx_v_end = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_end == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 342, __pyx_L3_error) + __pyx_v_end = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_end == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 352, __pyx_L3_error) } else { __pyx_v_end = ((int)-1); } @@ -26346,13 +26570,13 @@ static PyObject *__pyx_pw_6pyxpdf_4xpdf_8Document_21text_bytes(PyObject *__pyx_v } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("text_bytes", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 342, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("text_bytes", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 352, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pyxpdf.xpdf.Document.text_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_control), __pyx_ptype_6pyxpdf_4xpdf_TextControl, 1, "control", 0))) __PYX_ERR(6, 342, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_control), __pyx_ptype_6pyxpdf_4xpdf_TextControl, 1, "control", 0))) __PYX_ERR(6, 352, __pyx_L1_error) __pyx_r = __pyx_pf_6pyxpdf_4xpdf_8Document_20text_bytes(((struct __pyx_obj_6pyxpdf_4xpdf_Document *)__pyx_v_self), __pyx_v_start, __pyx_v_end, __pyx_v_control); /* function exit code */ @@ -26373,15 +26597,15 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_20text_bytes(struct __pyx_obj_ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__82) + __Pyx_TraceFrameInit(__pyx_codeobj__83) __Pyx_RefNannySetupContext("text_bytes", 0); - __Pyx_TraceCall("text_bytes (wrapper)", __pyx_f[6], 342, 0, __PYX_ERR(6, 342, __pyx_L1_error)); + __Pyx_TraceCall("text_bytes (wrapper)", __pyx_f[6], 352, 0, __PYX_ERR(6, 352, __pyx_L1_error)); __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 3; __pyx_t_2.start = __pyx_v_start; __pyx_t_2.end = __pyx_v_end; __pyx_t_2.control = __pyx_v_control; - __pyx_t_1 = __pyx_vtabptr_6pyxpdf_4xpdf_Document->text_bytes(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 342, __pyx_L1_error) + __pyx_t_1 = __pyx_vtabptr_6pyxpdf_4xpdf_Document->text_bytes(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -26399,7 +26623,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_20text_bytes(struct __pyx_obj_ return __pyx_r; } -/* "src/pyxpdf/document.pxi":384 +/* "src/pyxpdf/document.pxi":394 * return deref(out) * * cpdef text(self, start=0, end=-1, control=None): # <<<<<<<<<<<<<< @@ -26426,9 +26650,9 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document_text(struct __pyx_obj_6pyxpdf_4 int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__83) + __Pyx_TraceFrameInit(__pyx_codeobj__84) __Pyx_RefNannySetupContext("text", 0); - __Pyx_TraceCall("text", __pyx_f[6], 384, 0, __PYX_ERR(6, 384, __pyx_L1_error)); + __Pyx_TraceCall("text", __pyx_f[6], 394, 0, __PYX_ERR(6, 394, __pyx_L1_error)); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_start = __pyx_optional_args->start; @@ -26449,7 +26673,7 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document_text(struct __pyx_obj_6pyxpdf_4 if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 384, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6pyxpdf_4xpdf_8Document_23text)) { __Pyx_XDECREF(__pyx_r); @@ -26469,7 +26693,7 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document_text(struct __pyx_obj_6pyxpdf_4 #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_start, __pyx_v_end, __pyx_v_control}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 384, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 394, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else @@ -26477,13 +26701,13 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document_text(struct __pyx_obj_6pyxpdf_4 #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_start, __pyx_v_end, __pyx_v_control}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 384, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 394, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { - __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 384, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -26497,7 +26721,7 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document_text(struct __pyx_obj_6pyxpdf_4 __Pyx_INCREF(__pyx_v_control); __Pyx_GIVEREF(__pyx_v_control); PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_control); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 384, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -26520,40 +26744,40 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document_text(struct __pyx_obj_6pyxpdf_4 #endif } - /* "src/pyxpdf/document.pxi":420 + /* "src/pyxpdf/document.pxi":430 * * * return self.text_bytes(start=start, end=end, control=control # <<<<<<<<<<<<<< * ).decode('UTF-8', errors='ignore') * */ - __Pyx_TraceLine(420,0,__PYX_ERR(6, 420, __pyx_L1_error)) + __Pyx_TraceLine(430,0,__PYX_ERR(6, 430, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_start); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 420, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_end); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 420, __pyx_L1_error) - if (!(likely(((__pyx_v_control) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_control, __pyx_ptype_6pyxpdf_4xpdf_TextControl))))) __PYX_ERR(6, 420, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_start); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 430, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_end); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 430, __pyx_L1_error) + if (!(likely(((__pyx_v_control) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_control, __pyx_ptype_6pyxpdf_4xpdf_TextControl))))) __PYX_ERR(6, 430, __pyx_L1_error) __pyx_t_8.__pyx_n = 3; __pyx_t_8.start = __pyx_t_5; __pyx_t_8.end = __pyx_t_7; __pyx_t_8.control = ((struct __pyx_obj_6pyxpdf_4xpdf_TextControl *)__pyx_v_control); - __pyx_t_1 = ((struct __pyx_vtabstruct_6pyxpdf_4xpdf_Document *)__pyx_v_self->__pyx_vtab)->text_bytes(__pyx_v_self, 0, &__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 420, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_6pyxpdf_4xpdf_Document *)__pyx_v_self->__pyx_vtab)->text_bytes(__pyx_v_self, 0, &__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - /* "src/pyxpdf/document.pxi":421 + /* "src/pyxpdf/document.pxi":431 * * return self.text_bytes(start=start, end=end, control=control * ).decode('UTF-8', errors='ignore') # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(421,0,__PYX_ERR(6, 421, __pyx_L1_error)) - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_decode); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 421, __pyx_L1_error) + __Pyx_TraceLine(431,0,__PYX_ERR(6, 431, __pyx_L1_error)) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_decode); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 421, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_errors, __pyx_n_u_ignore) < 0) __PYX_ERR(6, 421, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__3, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 421, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_errors, __pyx_n_u_ignore) < 0) __PYX_ERR(6, 431, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__3, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -26561,7 +26785,7 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_8Document_text(struct __pyx_obj_6pyxpdf_4 __pyx_t_3 = 0; goto __pyx_L0; - /* "src/pyxpdf/document.pxi":384 + /* "src/pyxpdf/document.pxi":394 * return deref(out) * * cpdef text(self, start=0, end=-1, control=None): # <<<<<<<<<<<<<< @@ -26639,7 +26863,7 @@ static PyObject *__pyx_pw_6pyxpdf_4xpdf_8Document_23text(PyObject *__pyx_v_self, } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "text") < 0)) __PYX_ERR(6, 384, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "text") < 0)) __PYX_ERR(6, 394, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -26659,7 +26883,7 @@ static PyObject *__pyx_pw_6pyxpdf_4xpdf_8Document_23text(PyObject *__pyx_v_self, } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("text", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 384, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("text", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 394, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pyxpdf.xpdf.Document.text", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -26681,15 +26905,15 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_22text(struct __pyx_obj_6pyxpd int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__83) + __Pyx_TraceFrameInit(__pyx_codeobj__84) __Pyx_RefNannySetupContext("text", 0); - __Pyx_TraceCall("text (wrapper)", __pyx_f[6], 384, 0, __PYX_ERR(6, 384, __pyx_L1_error)); + __Pyx_TraceCall("text (wrapper)", __pyx_f[6], 394, 0, __PYX_ERR(6, 394, __pyx_L1_error)); __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 3; __pyx_t_2.start = __pyx_v_start; __pyx_t_2.end = __pyx_v_end; __pyx_t_2.control = __pyx_v_control; - __pyx_t_1 = __pyx_vtabptr_6pyxpdf_4xpdf_Document->text(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 384, __pyx_L1_error) + __pyx_t_1 = __pyx_vtabptr_6pyxpdf_4xpdf_Document->text(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -26736,7 +26960,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_24__reduce_cython__(CYTHON_UNU int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__84) + __Pyx_TraceFrameInit(__pyx_codeobj__85) __Pyx_RefNannySetupContext("__reduce_cython__", 0); __Pyx_TraceCall("__reduce_cython__", __pyx_f[7], 1, 0, __PYX_ERR(7, 1, __pyx_L1_error)); @@ -26747,7 +26971,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_24__reduce_cython__(CYTHON_UNU * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __Pyx_TraceLine(2,0,__PYX_ERR(7, 2, __pyx_L1_error)) - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__85, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 2, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__86, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -26800,7 +27024,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_26__setstate_cython__(CYTHON_U int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__86) + __Pyx_TraceFrameInit(__pyx_codeobj__87) __Pyx_RefNannySetupContext("__setstate_cython__", 0); __Pyx_TraceCall("__setstate_cython__", __pyx_f[7], 3, 0, __PYX_ERR(7, 3, __pyx_L1_error)); @@ -26810,7 +27034,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_26__setstate_cython__(CYTHON_U * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __Pyx_TraceLine(4,0,__PYX_ERR(7, 4, __pyx_L1_error)) - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__87, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 4, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__88, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -26834,7 +27058,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8Document_26__setstate_cython__(CYTHON_U return __pyx_r; } -/* "src/pyxpdf/document.pxi":430 +/* "src/pyxpdf/document.pxi":440 * int index * * def __init__(self, doc): # <<<<<<<<<<<<<< @@ -26871,7 +27095,7 @@ static int __pyx_pw_6pyxpdf_4xpdf_20DocumentPageIterator_1__init__(PyObject *__p else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(6, 430, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(6, 440, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -26882,7 +27106,7 @@ static int __pyx_pw_6pyxpdf_4xpdf_20DocumentPageIterator_1__init__(PyObject *__p } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 430, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 440, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pyxpdf.xpdf.DocumentPageIterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -26904,17 +27128,17 @@ static int __pyx_pf_6pyxpdf_4xpdf_20DocumentPageIterator___init__(struct __pyx_o const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - __Pyx_TraceCall("__init__", __pyx_f[6], 430, 0, __PYX_ERR(6, 430, __pyx_L1_error)); + __Pyx_TraceCall("__init__", __pyx_f[6], 440, 0, __PYX_ERR(6, 440, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":431 + /* "src/pyxpdf/document.pxi":441 * * def __init__(self, doc): * self.doc = doc # <<<<<<<<<<<<<< * self.index = -1 * */ - __Pyx_TraceLine(431,0,__PYX_ERR(6, 431, __pyx_L1_error)) - if (!(likely(((__pyx_v_doc) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_doc, __pyx_ptype_6pyxpdf_4xpdf_Document))))) __PYX_ERR(6, 431, __pyx_L1_error) + __Pyx_TraceLine(441,0,__PYX_ERR(6, 441, __pyx_L1_error)) + if (!(likely(((__pyx_v_doc) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_doc, __pyx_ptype_6pyxpdf_4xpdf_Document))))) __PYX_ERR(6, 441, __pyx_L1_error) __pyx_t_1 = __pyx_v_doc; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -26923,17 +27147,17 @@ static int __pyx_pf_6pyxpdf_4xpdf_20DocumentPageIterator___init__(struct __pyx_o __pyx_v_self->doc = ((struct __pyx_obj_6pyxpdf_4xpdf_Document *)__pyx_t_1); __pyx_t_1 = 0; - /* "src/pyxpdf/document.pxi":432 + /* "src/pyxpdf/document.pxi":442 * def __init__(self, doc): * self.doc = doc * self.index = -1 # <<<<<<<<<<<<<< * * def __iter__(self): */ - __Pyx_TraceLine(432,0,__PYX_ERR(6, 432, __pyx_L1_error)) + __Pyx_TraceLine(442,0,__PYX_ERR(6, 442, __pyx_L1_error)) __pyx_v_self->index = -1; - /* "src/pyxpdf/document.pxi":430 + /* "src/pyxpdf/document.pxi":440 * int index * * def __init__(self, doc): # <<<<<<<<<<<<<< @@ -26954,7 +27178,7 @@ static int __pyx_pf_6pyxpdf_4xpdf_20DocumentPageIterator___init__(struct __pyx_o return __pyx_r; } -/* "src/pyxpdf/document.pxi":434 +/* "src/pyxpdf/document.pxi":444 * self.index = -1 * * def __iter__(self): # <<<<<<<<<<<<<< @@ -26983,22 +27207,22 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_20DocumentPageIterator_2__iter__(struct const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__iter__", 0); - __Pyx_TraceCall("__iter__", __pyx_f[6], 434, 0, __PYX_ERR(6, 434, __pyx_L1_error)); + __Pyx_TraceCall("__iter__", __pyx_f[6], 444, 0, __PYX_ERR(6, 444, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":435 + /* "src/pyxpdf/document.pxi":445 * * def __iter__(self): * return self # <<<<<<<<<<<<<< * * def __next__(self): */ - __Pyx_TraceLine(435,0,__PYX_ERR(6, 435, __pyx_L1_error)) + __Pyx_TraceLine(445,0,__PYX_ERR(6, 445, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; - /* "src/pyxpdf/document.pxi":434 + /* "src/pyxpdf/document.pxi":444 * self.index = -1 * * def __iter__(self): # <<<<<<<<<<<<<< @@ -27017,7 +27241,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_20DocumentPageIterator_2__iter__(struct return __pyx_r; } -/* "src/pyxpdf/document.pxi":437 +/* "src/pyxpdf/document.pxi":447 * return self * * def __next__(self): # <<<<<<<<<<<<<< @@ -27049,48 +27273,48 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_20DocumentPageIterator_4__next__(struct const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__next__", 0); - __Pyx_TraceCall("__next__", __pyx_f[6], 437, 0, __PYX_ERR(6, 437, __pyx_L1_error)); + __Pyx_TraceCall("__next__", __pyx_f[6], 447, 0, __PYX_ERR(6, 447, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":438 + /* "src/pyxpdf/document.pxi":448 * * def __next__(self): * self.index += 1 # <<<<<<<<<<<<<< * if self.index >= len(self.doc): * raise StopIteration() */ - __Pyx_TraceLine(438,0,__PYX_ERR(6, 438, __pyx_L1_error)) + __Pyx_TraceLine(448,0,__PYX_ERR(6, 448, __pyx_L1_error)) __pyx_v_self->index = (__pyx_v_self->index + 1); - /* "src/pyxpdf/document.pxi":439 + /* "src/pyxpdf/document.pxi":449 * def __next__(self): * self.index += 1 * if self.index >= len(self.doc): # <<<<<<<<<<<<<< * raise StopIteration() * return self.doc[self.index] */ - __Pyx_TraceLine(439,0,__PYX_ERR(6, 439, __pyx_L1_error)) + __Pyx_TraceLine(449,0,__PYX_ERR(6, 449, __pyx_L1_error)) __pyx_t_1 = ((PyObject *)__pyx_v_self->doc); __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(6, 439, __pyx_L1_error) + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(6, 449, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((__pyx_v_self->index >= __pyx_t_2) != 0); if (unlikely(__pyx_t_3)) { - /* "src/pyxpdf/document.pxi":440 + /* "src/pyxpdf/document.pxi":450 * self.index += 1 * if self.index >= len(self.doc): * raise StopIteration() # <<<<<<<<<<<<<< * return self.doc[self.index] * */ - __Pyx_TraceLine(440,0,__PYX_ERR(6, 440, __pyx_L1_error)) - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_StopIteration); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 440, __pyx_L1_error) + __Pyx_TraceLine(450,0,__PYX_ERR(6, 450, __pyx_L1_error)) + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_StopIteration); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(6, 440, __pyx_L1_error) + __PYX_ERR(6, 450, __pyx_L1_error) - /* "src/pyxpdf/document.pxi":439 + /* "src/pyxpdf/document.pxi":449 * def __next__(self): * self.index += 1 * if self.index >= len(self.doc): # <<<<<<<<<<<<<< @@ -27099,22 +27323,22 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_20DocumentPageIterator_4__next__(struct */ } - /* "src/pyxpdf/document.pxi":441 + /* "src/pyxpdf/document.pxi":451 * if self.index >= len(self.doc): * raise StopIteration() * return self.doc[self.index] # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(441,0,__PYX_ERR(6, 441, __pyx_L1_error)) + __Pyx_TraceLine(451,0,__PYX_ERR(6, 451, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->doc), __pyx_v_self->index, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 441, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->doc), __pyx_v_self->index, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "src/pyxpdf/document.pxi":437 + /* "src/pyxpdf/document.pxi":447 * return self * * def __next__(self): # <<<<<<<<<<<<<< @@ -27170,7 +27394,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_20DocumentPageIterator_6__reduce_cython_ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__88) + __Pyx_TraceFrameInit(__pyx_codeobj__89) __Pyx_RefNannySetupContext("__reduce_cython__", 0); __Pyx_TraceCall("__reduce_cython__", __pyx_f[7], 1, 0, __PYX_ERR(7, 1, __pyx_L1_error)); @@ -27418,7 +27642,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_20DocumentPageIterator_8__setstate_cytho int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__89) + __Pyx_TraceFrameInit(__pyx_codeobj__90) __Pyx_RefNannySetupContext("__setstate_cython__", 0); __Pyx_TraceCall("__setstate_cython__", __pyx_f[7], 16, 0, __PYX_ERR(7, 16, __pyx_L1_error)); @@ -27454,7 +27678,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_20DocumentPageIterator_8__setstate_cytho return __pyx_r; } -/* "src/pyxpdf/document.pxi":502 +/* "src/pyxpdf/document.pxi":512 * * * def __init__(self, doc, index): # <<<<<<<<<<<<<< @@ -27500,11 +27724,11 @@ static int __pyx_pw_6pyxpdf_4xpdf_4Page_1__init__(PyObject *__pyx_v_self, PyObje case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(6, 502, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(6, 512, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(6, 502, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(6, 512, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -27517,7 +27741,7 @@ static int __pyx_pw_6pyxpdf_4xpdf_4Page_1__init__(PyObject *__pyx_v_self, PyObje } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 502, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 512, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pyxpdf.xpdf.Page.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -27538,7 +27762,7 @@ static int __pyx_pf_6pyxpdf_4xpdf_4Page___init__(CYTHON_UNUSED struct __pyx_obj_ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - __Pyx_TraceCall("__init__", __pyx_f[6], 502, 0, __PYX_ERR(6, 502, __pyx_L1_error)); + __Pyx_TraceCall("__init__", __pyx_f[6], 512, 0, __PYX_ERR(6, 512, __pyx_L1_error)); /* function exit code */ __pyx_r = 0; @@ -27552,7 +27776,7 @@ static int __pyx_pf_6pyxpdf_4xpdf_4Page___init__(CYTHON_UNUSED struct __pyx_obj_ return __pyx_r; } -/* "src/pyxpdf/document.pxi":506 +/* "src/pyxpdf/document.pxi":516 * """ * * def __cinit__(self, Document doc not None, int index): # <<<<<<<<<<<<<< @@ -27594,11 +27818,11 @@ static int __pyx_pw_6pyxpdf_4xpdf_4Page_3__cinit__(PyObject *__pyx_v_self, PyObj case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); __PYX_ERR(6, 506, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); __PYX_ERR(6, 516, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(6, 506, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(6, 516, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -27607,17 +27831,17 @@ static int __pyx_pw_6pyxpdf_4xpdf_4Page_3__cinit__(PyObject *__pyx_v_self, PyObj values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_doc = ((struct __pyx_obj_6pyxpdf_4xpdf_Document *)values[0]); - __pyx_v_index = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 506, __pyx_L3_error) + __pyx_v_index = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 516, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 506, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 516, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pyxpdf.xpdf.Page.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_doc), __pyx_ptype_6pyxpdf_4xpdf_Document, 0, "doc", 0))) __PYX_ERR(6, 506, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_doc), __pyx_ptype_6pyxpdf_4xpdf_Document, 0, "doc", 0))) __PYX_ERR(6, 516, __pyx_L1_error) __pyx_r = __pyx_pf_6pyxpdf_4xpdf_4Page_2__cinit__(((struct __pyx_obj_6pyxpdf_4xpdf_Page *)__pyx_v_self), __pyx_v_doc, __pyx_v_index); /* function exit code */ @@ -27642,50 +27866,50 @@ static int __pyx_pf_6pyxpdf_4xpdf_4Page_2__cinit__(struct __pyx_obj_6pyxpdf_4xpd const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - __Pyx_TraceCall("__cinit__", __pyx_f[6], 506, 0, __PYX_ERR(6, 506, __pyx_L1_error)); + __Pyx_TraceCall("__cinit__", __pyx_f[6], 516, 0, __PYX_ERR(6, 516, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":507 + /* "src/pyxpdf/document.pxi":517 * * def __cinit__(self, Document doc not None, int index): * if index < 0 or index >= doc.num_pages: # <<<<<<<<<<<<<< * raise IndexError("Page index must be positive integer less than total pages") * self.page = doc.get_catalog().getPage(index + 1) */ - __Pyx_TraceLine(507,0,__PYX_ERR(6, 507, __pyx_L1_error)) + __Pyx_TraceLine(517,0,__PYX_ERR(6, 517, __pyx_L1_error)) __pyx_t_2 = ((__pyx_v_index < 0) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 507, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_doc), __pyx_n_s_num_pages); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 507, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_doc), __pyx_n_s_num_pages); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 507, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 517, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 507, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 517, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (unlikely(__pyx_t_1)) { - /* "src/pyxpdf/document.pxi":508 + /* "src/pyxpdf/document.pxi":518 * def __cinit__(self, Document doc not None, int index): * if index < 0 or index >= doc.num_pages: * raise IndexError("Page index must be positive integer less than total pages") # <<<<<<<<<<<<<< * self.page = doc.get_catalog().getPage(index + 1) * # self.textpage.reset() */ - __Pyx_TraceLine(508,0,__PYX_ERR(6, 508, __pyx_L1_error)) - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__90, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 508, __pyx_L1_error) + __Pyx_TraceLine(518,0,__PYX_ERR(6, 518, __pyx_L1_error)) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__91, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(6, 508, __pyx_L1_error) + __PYX_ERR(6, 518, __pyx_L1_error) - /* "src/pyxpdf/document.pxi":507 + /* "src/pyxpdf/document.pxi":517 * * def __cinit__(self, Document doc not None, int index): * if index < 0 or index >= doc.num_pages: # <<<<<<<<<<<<<< @@ -27694,49 +27918,49 @@ static int __pyx_pf_6pyxpdf_4xpdf_4Page_2__cinit__(struct __pyx_obj_6pyxpdf_4xpd */ } - /* "src/pyxpdf/document.pxi":509 + /* "src/pyxpdf/document.pxi":519 * if index < 0 or index >= doc.num_pages: * raise IndexError("Page index must be positive integer less than total pages") * self.page = doc.get_catalog().getPage(index + 1) # <<<<<<<<<<<<<< * # self.textpage.reset() * self.doc = doc */ - __Pyx_TraceLine(509,0,__PYX_ERR(6, 509, __pyx_L1_error)) + __Pyx_TraceLine(519,0,__PYX_ERR(6, 519, __pyx_L1_error)) __pyx_v_self->page = ((struct __pyx_vtabstruct_6pyxpdf_4xpdf_Document *)__pyx_v_doc->__pyx_vtab)->get_catalog(__pyx_v_doc)->getPage((__pyx_v_index + 1)); - /* "src/pyxpdf/document.pxi":511 + /* "src/pyxpdf/document.pxi":521 * self.page = doc.get_catalog().getPage(index + 1) * # self.textpage.reset() * self.doc = doc # <<<<<<<<<<<<<< * self.index = index * self.label = self.get_label() */ - __Pyx_TraceLine(511,0,__PYX_ERR(6, 511, __pyx_L1_error)) + __Pyx_TraceLine(521,0,__PYX_ERR(6, 521, __pyx_L1_error)) __Pyx_INCREF(((PyObject *)__pyx_v_doc)); __Pyx_GIVEREF(((PyObject *)__pyx_v_doc)); __Pyx_GOTREF(__pyx_v_self->doc); __Pyx_DECREF(((PyObject *)__pyx_v_self->doc)); __pyx_v_self->doc = __pyx_v_doc; - /* "src/pyxpdf/document.pxi":512 + /* "src/pyxpdf/document.pxi":522 * # self.textpage.reset() * self.doc = doc * self.index = index # <<<<<<<<<<<<<< * self.label = self.get_label() * */ - __Pyx_TraceLine(512,0,__PYX_ERR(6, 512, __pyx_L1_error)) + __Pyx_TraceLine(522,0,__PYX_ERR(6, 522, __pyx_L1_error)) __pyx_v_self->index = __pyx_v_index; - /* "src/pyxpdf/document.pxi":513 + /* "src/pyxpdf/document.pxi":523 * self.doc = doc * self.index = index * self.label = self.get_label() # <<<<<<<<<<<<<< * * def __repr__(self): */ - __Pyx_TraceLine(513,0,__PYX_ERR(6, 513, __pyx_L1_error)) - __pyx_t_5 = ((struct __pyx_vtabstruct_6pyxpdf_4xpdf_Page *)__pyx_v_self->__pyx_vtab)->get_label(__pyx_v_self); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 513, __pyx_L1_error) + __Pyx_TraceLine(523,0,__PYX_ERR(6, 523, __pyx_L1_error)) + __pyx_t_5 = ((struct __pyx_vtabstruct_6pyxpdf_4xpdf_Page *)__pyx_v_self->__pyx_vtab)->get_label(__pyx_v_self); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __Pyx_GOTREF(__pyx_v_self->label); @@ -27744,7 +27968,7 @@ static int __pyx_pf_6pyxpdf_4xpdf_4Page_2__cinit__(struct __pyx_obj_6pyxpdf_4xpd __pyx_v_self->label = __pyx_t_5; __pyx_t_5 = 0; - /* "src/pyxpdf/document.pxi":506 + /* "src/pyxpdf/document.pxi":516 * """ * * def __cinit__(self, Document doc not None, int index): # <<<<<<<<<<<<<< @@ -27767,7 +27991,7 @@ static int __pyx_pf_6pyxpdf_4xpdf_4Page_2__cinit__(struct __pyx_obj_6pyxpdf_4xpd return __pyx_r; } -/* "src/pyxpdf/document.pxi":515 +/* "src/pyxpdf/document.pxi":525 * self.label = self.get_label() * * def __repr__(self): # <<<<<<<<<<<<<< @@ -27800,39 +28024,39 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_4__repr__(struct __pyx_obj_6pyxpdf const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 0); - __Pyx_TraceCall("__repr__", __pyx_f[6], 515, 0, __PYX_ERR(6, 515, __pyx_L1_error)); + __Pyx_TraceCall("__repr__", __pyx_f[6], 525, 0, __PYX_ERR(6, 525, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":516 + /* "src/pyxpdf/document.pxi":526 * * def __repr__(self): * if self.label == None: # <<<<<<<<<<<<<< * return "".format(index=self.index) * else: */ - __Pyx_TraceLine(516,0,__PYX_ERR(6, 516, __pyx_L1_error)) - __pyx_t_1 = PyObject_RichCompare(__pyx_v_self->label, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 516, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 516, __pyx_L1_error) + __Pyx_TraceLine(526,0,__PYX_ERR(6, 526, __pyx_L1_error)) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_self->label, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 526, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 526, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "src/pyxpdf/document.pxi":517 + /* "src/pyxpdf/document.pxi":527 * def __repr__(self): * if self.label == None: * return "".format(index=self.index) # <<<<<<<<<<<<<< * else: * return "".format(index=self.index, label=self.label) */ - __Pyx_TraceLine(517,0,__PYX_ERR(6, 517, __pyx_L1_error)) + __Pyx_TraceLine(527,0,__PYX_ERR(6, 527, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Page_index, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 517, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Page_index, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 517, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->index); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 517, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->index); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_index, __pyx_t_4) < 0) __PYX_ERR(6, 517, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_index, __pyx_t_4) < 0) __PYX_ERR(6, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 517, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -27840,7 +28064,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_4__repr__(struct __pyx_obj_6pyxpdf __pyx_t_4 = 0; goto __pyx_L0; - /* "src/pyxpdf/document.pxi":516 + /* "src/pyxpdf/document.pxi":526 * * def __repr__(self): * if self.label == None: # <<<<<<<<<<<<<< @@ -27849,26 +28073,26 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_4__repr__(struct __pyx_obj_6pyxpdf */ } - /* "src/pyxpdf/document.pxi":519 + /* "src/pyxpdf/document.pxi":529 * return "".format(index=self.index) * else: * return "".format(index=self.index, label=self.label) # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(519,0,__PYX_ERR(6, 519, __pyx_L1_error)) + __Pyx_TraceLine(529,0,__PYX_ERR(6, 529, __pyx_L1_error)) /*else*/ { __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Page_index_label_label, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 519, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Page_index_label_label, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 519, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->index); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 519, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->index); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_index, __pyx_t_1) < 0) __PYX_ERR(6, 519, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_index, __pyx_t_1) < 0) __PYX_ERR(6, 529, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_label, __pyx_v_self->label) < 0) __PYX_ERR(6, 519, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 519, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_label, __pyx_v_self->label) < 0) __PYX_ERR(6, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -27877,7 +28101,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_4__repr__(struct __pyx_obj_6pyxpdf goto __pyx_L0; } - /* "src/pyxpdf/document.pxi":515 + /* "src/pyxpdf/document.pxi":525 * self.label = self.get_label() * * def __repr__(self): # <<<<<<<<<<<<<< @@ -27899,7 +28123,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_4__repr__(struct __pyx_obj_6pyxpdf return __pyx_r; } -/* "src/pyxpdf/document.pxi":522 +/* "src/pyxpdf/document.pxi":532 * * * cdef display_slice(self, OutputDev* out, int x1, int y1, int hgt, int wdt, # <<<<<<<<<<<<<< @@ -27911,9 +28135,9 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_4Page_display_slice(struct __pyx_obj_6pyx double __pyx_v_hDPI = ((double)72.0); double __pyx_v_vDPI = ((double)72.0); int __pyx_v_rotate = ((int)0); - GBool __pyx_v_use_media_box = __pyx_k__91; - GBool __pyx_v_crop = __pyx_k__92; - GBool __pyx_v_printing = __pyx_k__93; + GBool __pyx_v_use_media_box = __pyx_k__92; + GBool __pyx_v_crop = __pyx_k__93; + GBool __pyx_v_printing = __pyx_k__94; PyObject *__pyx_r = NULL; __Pyx_TraceDeclarations __Pyx_RefNannyDeclarations @@ -27921,7 +28145,7 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_4Page_display_slice(struct __pyx_obj_6pyx const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("display_slice", 0); - __Pyx_TraceCall("display_slice", __pyx_f[6], 522, 0, __PYX_ERR(6, 522, __pyx_L1_error)); + __Pyx_TraceCall("display_slice", __pyx_f[6], 532, 0, __PYX_ERR(6, 532, __pyx_L1_error)); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_hDPI = __pyx_optional_args->hDPI; @@ -27943,17 +28167,17 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_4Page_display_slice(struct __pyx_obj_6pyx } } - /* "src/pyxpdf/document.pxi":526 + /* "src/pyxpdf/document.pxi":536 * GBool use_media_box = gFalse, GBool crop = gTrue, * GBool printing = gFalse): * self.page.displaySlice(out, hDPI, vDPI, rotate, use_media_box, crop, # <<<<<<<<<<<<<< * x1, y1, hgt, wdt, printing) * */ - __Pyx_TraceLine(526,0,__PYX_ERR(6, 526, __pyx_L1_error)) + __Pyx_TraceLine(536,0,__PYX_ERR(6, 536, __pyx_L1_error)) __pyx_v_self->page->displaySlice(__pyx_v_out, __pyx_v_hDPI, __pyx_v_vDPI, __pyx_v_rotate, __pyx_v_use_media_box, __pyx_v_crop, __pyx_v_x1, __pyx_v_y1, __pyx_v_hgt, __pyx_v_wdt, __pyx_v_printing, NULL); - /* "src/pyxpdf/document.pxi":522 + /* "src/pyxpdf/document.pxi":532 * * * cdef display_slice(self, OutputDev* out, int x1, int y1, int hgt, int wdt, # <<<<<<<<<<<<<< @@ -27974,7 +28198,7 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_4Page_display_slice(struct __pyx_obj_6pyx return __pyx_r; } -/* "src/pyxpdf/document.pxi":529 +/* "src/pyxpdf/document.pxi":539 * x1, y1, hgt, wdt, printing) * * cdef display(self, OutputDev* out, double hDPI = 72, double vDPI = 72, # <<<<<<<<<<<<<< @@ -27986,9 +28210,9 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_4Page_display(struct __pyx_obj_6pyxpdf_4x double __pyx_v_hDPI = ((double)72.0); double __pyx_v_vDPI = ((double)72.0); int __pyx_v_rotate = ((int)0); - GBool __pyx_v_use_media_box = __pyx_k__94; - GBool __pyx_v_crop = __pyx_k__95; - GBool __pyx_v_printing = __pyx_k__96; + GBool __pyx_v_use_media_box = __pyx_k__95; + GBool __pyx_v_crop = __pyx_k__96; + GBool __pyx_v_printing = __pyx_k__97; PyObject *__pyx_r = NULL; __Pyx_TraceDeclarations __Pyx_RefNannyDeclarations @@ -27998,7 +28222,7 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_4Page_display(struct __pyx_obj_6pyxpdf_4x const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("display", 0); - __Pyx_TraceCall("display", __pyx_f[6], 529, 0, __PYX_ERR(6, 529, __pyx_L1_error)); + __Pyx_TraceCall("display", __pyx_f[6], 539, 0, __PYX_ERR(6, 539, __pyx_L1_error)); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_hDPI = __pyx_optional_args->hDPI; @@ -28020,14 +28244,14 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_4Page_display(struct __pyx_obj_6pyxpdf_4x } } - /* "src/pyxpdf/document.pxi":532 + /* "src/pyxpdf/document.pxi":542 * int rotate = 0, GBool use_media_box = gFalse, * GBool crop = gTrue, GBool printing = gFalse): * self.display_slice(out, -1, -1, -1, -1, hDPI, vDPI, rotate, # <<<<<<<<<<<<<< * use_media_box, crop, printing) * */ - __Pyx_TraceLine(532,0,__PYX_ERR(6, 532, __pyx_L1_error)) + __Pyx_TraceLine(542,0,__PYX_ERR(6, 542, __pyx_L1_error)) __pyx_t_2.__pyx_n = 6; __pyx_t_2.hDPI = __pyx_v_hDPI; __pyx_t_2.vDPI = __pyx_v_vDPI; @@ -28035,11 +28259,11 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_4Page_display(struct __pyx_obj_6pyxpdf_4x __pyx_t_2.use_media_box = __pyx_v_use_media_box; __pyx_t_2.crop = __pyx_v_crop; __pyx_t_2.printing = __pyx_v_printing; - __pyx_t_1 = ((struct __pyx_vtabstruct_6pyxpdf_4xpdf_Page *)__pyx_v_self->__pyx_vtab)->display_slice(__pyx_v_self, __pyx_v_out, -1, -1, -1, -1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 532, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_6pyxpdf_4xpdf_Page *)__pyx_v_self->__pyx_vtab)->display_slice(__pyx_v_self, __pyx_v_out, -1, -1, -1, -1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "src/pyxpdf/document.pxi":529 + /* "src/pyxpdf/document.pxi":539 * x1, y1, hgt, wdt, printing) * * cdef display(self, OutputDev* out, double hDPI = 72, double vDPI = 72, # <<<<<<<<<<<<<< @@ -28061,7 +28285,7 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_4Page_display(struct __pyx_obj_6pyxpdf_4x return __pyx_r; } -/* "src/pyxpdf/document.pxi":535 +/* "src/pyxpdf/document.pxi":545 * use_media_box, crop, printing) * * cdef _init_TextPage(self, int rotation): # <<<<<<<<<<<<<< @@ -28081,55 +28305,55 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_4Page__init_TextPage(struct __pyx_obj_6py const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_init_TextPage", 0); - __Pyx_TraceCall("_init_TextPage", __pyx_f[6], 535, 0, __PYX_ERR(6, 535, __pyx_L1_error)); + __Pyx_TraceCall("_init_TextPage", __pyx_f[6], 545, 0, __PYX_ERR(6, 545, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":540 + /* "src/pyxpdf/document.pxi":550 * unique_ptr[TextOutputDev] td * * text_control = make_unique[TextOutputControl]() # <<<<<<<<<<<<<< * td = make_unique[TextOutputDev](NULL, text_control.get(), gFalse) * */ - __Pyx_TraceLine(540,0,__PYX_ERR(6, 540, __pyx_L1_error)) + __Pyx_TraceLine(550,0,__PYX_ERR(6, 550, __pyx_L1_error)) __pyx_v_text_control = std::make_unique(); - /* "src/pyxpdf/document.pxi":541 + /* "src/pyxpdf/document.pxi":551 * * text_control = make_unique[TextOutputControl]() * td = make_unique[TextOutputDev](NULL, text_control.get(), gFalse) # <<<<<<<<<<<<<< * * self.display(td.get(), 72, 72, rotation) */ - __Pyx_TraceLine(541,0,__PYX_ERR(6, 541, __pyx_L1_error)) + __Pyx_TraceLine(551,0,__PYX_ERR(6, 551, __pyx_L1_error)) __pyx_v_td = std::make_unique(((char *)NULL), __pyx_v_text_control.get(), gFalse); - /* "src/pyxpdf/document.pxi":543 + /* "src/pyxpdf/document.pxi":553 * td = make_unique[TextOutputDev](NULL, text_control.get(), gFalse) * * self.display(td.get(), 72, 72, rotation) # <<<<<<<<<<<<<< * self.textpage.reset(deref(td).takeText()) * */ - __Pyx_TraceLine(543,0,__PYX_ERR(6, 543, __pyx_L1_error)) + __Pyx_TraceLine(553,0,__PYX_ERR(6, 553, __pyx_L1_error)) __pyx_t_2.__pyx_n = 3; __pyx_t_2.hDPI = 72.0; __pyx_t_2.vDPI = 72.0; __pyx_t_2.rotate = __pyx_v_rotation; - __pyx_t_1 = ((struct __pyx_vtabstruct_6pyxpdf_4xpdf_Page *)__pyx_v_self->__pyx_vtab)->display(__pyx_v_self, __pyx_v_td.get(), &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 543, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_6pyxpdf_4xpdf_Page *)__pyx_v_self->__pyx_vtab)->display(__pyx_v_self, __pyx_v_td.get(), &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "src/pyxpdf/document.pxi":544 + /* "src/pyxpdf/document.pxi":554 * * self.display(td.get(), 72, 72, rotation) * self.textpage.reset(deref(td).takeText()) # <<<<<<<<<<<<<< * * cdef get_label(self): */ - __Pyx_TraceLine(544,0,__PYX_ERR(6, 544, __pyx_L1_error)) + __Pyx_TraceLine(554,0,__PYX_ERR(6, 554, __pyx_L1_error)) __pyx_v_self->textpage.reset((*__pyx_v_td).takeText()); - /* "src/pyxpdf/document.pxi":535 + /* "src/pyxpdf/document.pxi":545 * use_media_box, crop, printing) * * cdef _init_TextPage(self, int rotation): # <<<<<<<<<<<<<< @@ -28151,7 +28375,7 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_4Page__init_TextPage(struct __pyx_obj_6py return __pyx_r; } -/* "src/pyxpdf/document.pxi":546 +/* "src/pyxpdf/document.pxi":556 * self.textpage.reset(deref(td).takeText()) * * cdef get_label(self): # <<<<<<<<<<<<<< @@ -28171,66 +28395,66 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_4Page_get_label(struct __pyx_obj_6pyxpdf_ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_label", 0); - __Pyx_TraceCall("get_label", __pyx_f[6], 546, 0, __PYX_ERR(6, 546, __pyx_L1_error)); + __Pyx_TraceCall("get_label", __pyx_f[6], 556, 0, __PYX_ERR(6, 556, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":551 + /* "src/pyxpdf/document.pxi":561 * unique_ptr[TextString] txt_label * * if self.doc.get_catalog().hasPageLabels() == gTrue: # <<<<<<<<<<<<<< * txt_label.reset(self.doc.get_catalog().getPageLabel(self.index + 1)) * if txt_label != NULL: */ - __Pyx_TraceLine(551,0,__PYX_ERR(6, 551, __pyx_L1_error)) + __Pyx_TraceLine(561,0,__PYX_ERR(6, 561, __pyx_L1_error)) __pyx_t_1 = ((((struct __pyx_vtabstruct_6pyxpdf_4xpdf_Document *)__pyx_v_self->doc->__pyx_vtab)->get_catalog(__pyx_v_self->doc)->hasPageLabels() == gTrue) != 0); if (__pyx_t_1) { - /* "src/pyxpdf/document.pxi":552 + /* "src/pyxpdf/document.pxi":562 * * if self.doc.get_catalog().hasPageLabels() == gTrue: * txt_label.reset(self.doc.get_catalog().getPageLabel(self.index + 1)) # <<<<<<<<<<<<<< * if txt_label != NULL: * glabel.reset(deref(txt_label).toPDFTextString()) */ - __Pyx_TraceLine(552,0,__PYX_ERR(6, 552, __pyx_L1_error)) + __Pyx_TraceLine(562,0,__PYX_ERR(6, 562, __pyx_L1_error)) __pyx_v_txt_label.reset(((struct __pyx_vtabstruct_6pyxpdf_4xpdf_Document *)__pyx_v_self->doc->__pyx_vtab)->get_catalog(__pyx_v_self->doc)->getPageLabel((__pyx_v_self->index + 1))); - /* "src/pyxpdf/document.pxi":553 + /* "src/pyxpdf/document.pxi":563 * if self.doc.get_catalog().hasPageLabels() == gTrue: * txt_label.reset(self.doc.get_catalog().getPageLabel(self.index + 1)) * if txt_label != NULL: # <<<<<<<<<<<<<< * glabel.reset(deref(txt_label).toPDFTextString()) * return GString_to_unicode(glabel.get()) */ - __Pyx_TraceLine(553,0,__PYX_ERR(6, 553, __pyx_L1_error)) + __Pyx_TraceLine(563,0,__PYX_ERR(6, 563, __pyx_L1_error)) __pyx_t_1 = ((__pyx_v_txt_label != NULL) != 0); if (__pyx_t_1) { - /* "src/pyxpdf/document.pxi":554 + /* "src/pyxpdf/document.pxi":564 * txt_label.reset(self.doc.get_catalog().getPageLabel(self.index + 1)) * if txt_label != NULL: * glabel.reset(deref(txt_label).toPDFTextString()) # <<<<<<<<<<<<<< * return GString_to_unicode(glabel.get()) * else: */ - __Pyx_TraceLine(554,0,__PYX_ERR(6, 554, __pyx_L1_error)) + __Pyx_TraceLine(564,0,__PYX_ERR(6, 564, __pyx_L1_error)) __pyx_v_glabel.reset((*__pyx_v_txt_label).toPDFTextString()); - /* "src/pyxpdf/document.pxi":555 + /* "src/pyxpdf/document.pxi":565 * if txt_label != NULL: * glabel.reset(deref(txt_label).toPDFTextString()) * return GString_to_unicode(glabel.get()) # <<<<<<<<<<<<<< * else: * return None */ - __Pyx_TraceLine(555,0,__PYX_ERR(6, 555, __pyx_L1_error)) + __Pyx_TraceLine(565,0,__PYX_ERR(6, 565, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_6pyxpdf_4xpdf_GString_to_unicode(__pyx_v_glabel.get()); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 555, __pyx_L1_error) + __pyx_t_2 = __pyx_f_6pyxpdf_4xpdf_GString_to_unicode(__pyx_v_glabel.get()); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "src/pyxpdf/document.pxi":553 + /* "src/pyxpdf/document.pxi":563 * if self.doc.get_catalog().hasPageLabels() == gTrue: * txt_label.reset(self.doc.get_catalog().getPageLabel(self.index + 1)) * if txt_label != NULL: # <<<<<<<<<<<<<< @@ -28239,21 +28463,21 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_4Page_get_label(struct __pyx_obj_6pyxpdf_ */ } - /* "src/pyxpdf/document.pxi":557 + /* "src/pyxpdf/document.pxi":567 * return GString_to_unicode(glabel.get()) * else: * return None # <<<<<<<<<<<<<< * return None * */ - __Pyx_TraceLine(557,0,__PYX_ERR(6, 557, __pyx_L1_error)) + __Pyx_TraceLine(567,0,__PYX_ERR(6, 567, __pyx_L1_error)) /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } - /* "src/pyxpdf/document.pxi":551 + /* "src/pyxpdf/document.pxi":561 * unique_ptr[TextString] txt_label * * if self.doc.get_catalog().hasPageLabels() == gTrue: # <<<<<<<<<<<<<< @@ -28262,19 +28486,19 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_4Page_get_label(struct __pyx_obj_6pyxpdf_ */ } - /* "src/pyxpdf/document.pxi":558 + /* "src/pyxpdf/document.pxi":568 * else: * return None * return None # <<<<<<<<<<<<<< * * cdef _find_text(self, text, search_box=None, start_at_top=True, stop_at_bottom=True, start_at_last=False, */ - __Pyx_TraceLine(558,0,__PYX_ERR(6, 558, __pyx_L1_error)) + __Pyx_TraceLine(568,0,__PYX_ERR(6, 568, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "src/pyxpdf/document.pxi":546 + /* "src/pyxpdf/document.pxi":556 * self.textpage.reset(deref(td).takeText()) * * cdef get_label(self): # <<<<<<<<<<<<<< @@ -28294,7 +28518,7 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_4Page_get_label(struct __pyx_obj_6pyxpdf_ return __pyx_r; } -/* "src/pyxpdf/document.pxi":560 +/* "src/pyxpdf/document.pxi":570 * return None * * cdef _find_text(self, text, search_box=None, start_at_top=True, stop_at_bottom=True, start_at_last=False, # <<<<<<<<<<<<<< @@ -28308,7 +28532,7 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_4Page__find_text(struct __pyx_obj_6pyxpdf PyObject *__pyx_v_stop_at_bottom = ((PyObject *)Py_True); PyObject *__pyx_v_start_at_last = ((PyObject *)Py_False); - /* "src/pyxpdf/document.pxi":561 + /* "src/pyxpdf/document.pxi":571 * * cdef _find_text(self, text, search_box=None, start_at_top=True, stop_at_bottom=True, start_at_last=False, * stop_at_last=False, case_sensitive=False, backward=False, wholeword=False, rotation=0): # <<<<<<<<<<<<<< @@ -28343,7 +28567,7 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_4Page__find_text(struct __pyx_obj_6pyxpdf const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_find_text", 0); - __Pyx_TraceCall("_find_text", __pyx_f[6], 560, 0, __PYX_ERR(6, 560, __pyx_L1_error)); + __Pyx_TraceCall("_find_text", __pyx_f[6], 570, 0, __PYX_ERR(6, 570, __pyx_L1_error)); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_search_box = __pyx_optional_args->search_box; @@ -28374,72 +28598,72 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_4Page__find_text(struct __pyx_obj_6pyxpdf } } - /* "src/pyxpdf/document.pxi":562 + /* "src/pyxpdf/document.pxi":572 * cdef _find_text(self, text, search_box=None, start_at_top=True, stop_at_bottom=True, start_at_last=False, * stop_at_last=False, case_sensitive=False, backward=False, wholeword=False, rotation=0): * cdef double x_min = 0 # <<<<<<<<<<<<<< * cdef double y_min = 0 * cdef double x_max = 0 */ - __Pyx_TraceLine(562,0,__PYX_ERR(6, 562, __pyx_L1_error)) + __Pyx_TraceLine(572,0,__PYX_ERR(6, 572, __pyx_L1_error)) __pyx_v_x_min = 0.0; - /* "src/pyxpdf/document.pxi":563 + /* "src/pyxpdf/document.pxi":573 * stop_at_last=False, case_sensitive=False, backward=False, wholeword=False, rotation=0): * cdef double x_min = 0 * cdef double y_min = 0 # <<<<<<<<<<<<<< * cdef double x_max = 0 * cdef double y_max = 0 */ - __Pyx_TraceLine(563,0,__PYX_ERR(6, 563, __pyx_L1_error)) + __Pyx_TraceLine(573,0,__PYX_ERR(6, 573, __pyx_L1_error)) __pyx_v_y_min = 0.0; - /* "src/pyxpdf/document.pxi":564 + /* "src/pyxpdf/document.pxi":574 * cdef double x_min = 0 * cdef double y_min = 0 * cdef double x_max = 0 # <<<<<<<<<<<<<< * cdef double y_max = 0 * if search_box: */ - __Pyx_TraceLine(564,0,__PYX_ERR(6, 564, __pyx_L1_error)) + __Pyx_TraceLine(574,0,__PYX_ERR(6, 574, __pyx_L1_error)) __pyx_v_x_max = 0.0; - /* "src/pyxpdf/document.pxi":565 + /* "src/pyxpdf/document.pxi":575 * cdef double y_min = 0 * cdef double x_max = 0 * cdef double y_max = 0 # <<<<<<<<<<<<<< * if search_box: * x_min = search_box[0] or 0 */ - __Pyx_TraceLine(565,0,__PYX_ERR(6, 565, __pyx_L1_error)) + __Pyx_TraceLine(575,0,__PYX_ERR(6, 575, __pyx_L1_error)) __pyx_v_y_max = 0.0; - /* "src/pyxpdf/document.pxi":566 + /* "src/pyxpdf/document.pxi":576 * cdef double x_max = 0 * cdef double y_max = 0 * if search_box: # <<<<<<<<<<<<<< * x_min = search_box[0] or 0 * y_min = search_box[1] or 0 */ - __Pyx_TraceLine(566,0,__PYX_ERR(6, 566, __pyx_L1_error)) - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_search_box); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 566, __pyx_L1_error) + __Pyx_TraceLine(576,0,__PYX_ERR(6, 576, __pyx_L1_error)) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_search_box); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 576, __pyx_L1_error) if (__pyx_t_1) { - /* "src/pyxpdf/document.pxi":567 + /* "src/pyxpdf/document.pxi":577 * cdef double y_max = 0 * if search_box: * x_min = search_box[0] or 0 # <<<<<<<<<<<<<< * y_min = search_box[1] or 0 * x_max = search_box[2] or 0 */ - __Pyx_TraceLine(567,0,__PYX_ERR(6, 567, __pyx_L1_error)) - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_search_box, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 567, __pyx_L1_error) + __Pyx_TraceLine(577,0,__PYX_ERR(6, 577, __pyx_L1_error)) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_search_box, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 567, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 577, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(6, 567, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(6, 577, __pyx_L1_error) __pyx_t_2 = __pyx_t_4; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_bool_binop_done; @@ -28448,21 +28672,21 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_4Page__find_text(struct __pyx_obj_6pyxpdf __pyx_L4_bool_binop_done:; __pyx_v_x_min = __pyx_t_2; - /* "src/pyxpdf/document.pxi":568 + /* "src/pyxpdf/document.pxi":578 * if search_box: * x_min = search_box[0] or 0 * y_min = search_box[1] or 0 # <<<<<<<<<<<<<< * x_max = search_box[2] or 0 * y_max = search_box[3] or 0 */ - __Pyx_TraceLine(568,0,__PYX_ERR(6, 568, __pyx_L1_error)) - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_search_box, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 568, __pyx_L1_error) + __Pyx_TraceLine(578,0,__PYX_ERR(6, 578, __pyx_L1_error)) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_search_box, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 568, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 578, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(6, 568, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(6, 578, __pyx_L1_error) __pyx_t_2 = __pyx_t_4; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L6_bool_binop_done; @@ -28471,21 +28695,21 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_4Page__find_text(struct __pyx_obj_6pyxpdf __pyx_L6_bool_binop_done:; __pyx_v_y_min = __pyx_t_2; - /* "src/pyxpdf/document.pxi":569 + /* "src/pyxpdf/document.pxi":579 * x_min = search_box[0] or 0 * y_min = search_box[1] or 0 * x_max = search_box[2] or 0 # <<<<<<<<<<<<<< * y_max = search_box[3] or 0 * */ - __Pyx_TraceLine(569,0,__PYX_ERR(6, 569, __pyx_L1_error)) - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_search_box, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 569, __pyx_L1_error) + __Pyx_TraceLine(579,0,__PYX_ERR(6, 579, __pyx_L1_error)) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_search_box, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 569, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 579, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(6, 569, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(6, 579, __pyx_L1_error) __pyx_t_2 = __pyx_t_4; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L8_bool_binop_done; @@ -28494,21 +28718,21 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_4Page__find_text(struct __pyx_obj_6pyxpdf __pyx_L8_bool_binop_done:; __pyx_v_x_max = __pyx_t_2; - /* "src/pyxpdf/document.pxi":570 + /* "src/pyxpdf/document.pxi":580 * y_min = search_box[1] or 0 * x_max = search_box[2] or 0 * y_max = search_box[3] or 0 # <<<<<<<<<<<<<< * * # Convert python str to xpdf Unicode */ - __Pyx_TraceLine(570,0,__PYX_ERR(6, 570, __pyx_L1_error)) - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_search_box, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 570, __pyx_L1_error) + __Pyx_TraceLine(580,0,__PYX_ERR(6, 580, __pyx_L1_error)) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_search_box, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 570, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 580, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(6, 570, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(6, 580, __pyx_L1_error) __pyx_t_2 = __pyx_t_4; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L10_bool_binop_done; @@ -28517,7 +28741,7 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_4Page__find_text(struct __pyx_obj_6pyxpdf __pyx_L10_bool_binop_done:; __pyx_v_y_max = __pyx_t_2; - /* "src/pyxpdf/document.pxi":566 + /* "src/pyxpdf/document.pxi":576 * cdef double x_max = 0 * cdef double y_max = 0 * if search_box: # <<<<<<<<<<<<<< @@ -28526,41 +28750,41 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_4Page__find_text(struct __pyx_obj_6pyxpdf */ } - /* "src/pyxpdf/document.pxi":574 + /* "src/pyxpdf/document.pxi":584 * # Convert python str to xpdf Unicode * cdef vector[Unicode] u * utf32_to_Unicode_vector(text, u) # <<<<<<<<<<<<<< * * # Lazy load TextPage */ - __Pyx_TraceLine(574,0,__PYX_ERR(6, 574, __pyx_L1_error)) - __pyx_t_5 = __pyx_f_6pyxpdf_4xpdf_utf32_to_Unicode_vector(__pyx_v_text, __pyx_v_u); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(6, 574, __pyx_L1_error) + __Pyx_TraceLine(584,0,__PYX_ERR(6, 584, __pyx_L1_error)) + __pyx_t_5 = __pyx_f_6pyxpdf_4xpdf_utf32_to_Unicode_vector(__pyx_v_text, __pyx_v_u); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(6, 584, __pyx_L1_error) - /* "src/pyxpdf/document.pxi":577 + /* "src/pyxpdf/document.pxi":587 * * # Lazy load TextPage * if self.textpage.get() == NULL: # <<<<<<<<<<<<<< * self._init_TextPage(rotation) * */ - __Pyx_TraceLine(577,0,__PYX_ERR(6, 577, __pyx_L1_error)) + __Pyx_TraceLine(587,0,__PYX_ERR(6, 587, __pyx_L1_error)) __pyx_t_1 = ((__pyx_v_self->textpage.get() == NULL) != 0); if (__pyx_t_1) { - /* "src/pyxpdf/document.pxi":578 + /* "src/pyxpdf/document.pxi":588 * # Lazy load TextPage * if self.textpage.get() == NULL: * self._init_TextPage(rotation) # <<<<<<<<<<<<<< * * cdef GBool res = deref(self.textpage).findText(u.data(), u.size(), to_GBool(start_at_top), */ - __Pyx_TraceLine(578,0,__PYX_ERR(6, 578, __pyx_L1_error)) - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_rotation); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 578, __pyx_L1_error) - __pyx_t_3 = ((struct __pyx_vtabstruct_6pyxpdf_4xpdf_Page *)__pyx_v_self->__pyx_vtab)->_init_TextPage(__pyx_v_self, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 578, __pyx_L1_error) + __Pyx_TraceLine(588,0,__PYX_ERR(6, 588, __pyx_L1_error)) + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_rotation); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 588, __pyx_L1_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_6pyxpdf_4xpdf_Page *)__pyx_v_self->__pyx_vtab)->_init_TextPage(__pyx_v_self, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 588, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "src/pyxpdf/document.pxi":577 + /* "src/pyxpdf/document.pxi":587 * * # Lazy load TextPage * if self.textpage.get() == NULL: # <<<<<<<<<<<<<< @@ -28569,35 +28793,35 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_4Page__find_text(struct __pyx_obj_6pyxpdf */ } - /* "src/pyxpdf/document.pxi":580 + /* "src/pyxpdf/document.pxi":590 * self._init_TextPage(rotation) * * cdef GBool res = deref(self.textpage).findText(u.data(), u.size(), to_GBool(start_at_top), # <<<<<<<<<<<<<< * to_GBool(stop_at_bottom), to_GBool(start_at_last), * to_GBool(stop_at_last), to_GBool(case_sensitive), */ - __Pyx_TraceLine(580,0,__PYX_ERR(6, 580, __pyx_L1_error)) + __Pyx_TraceLine(590,0,__PYX_ERR(6, 590, __pyx_L1_error)) __pyx_v_res = (*__pyx_v_self->textpage).findText(__pyx_v_u.data(), __pyx_v_u.size(), __pyx_f_6pyxpdf_4xpdf_to_GBool(__pyx_v_start_at_top), __pyx_f_6pyxpdf_4xpdf_to_GBool(__pyx_v_stop_at_bottom), __pyx_f_6pyxpdf_4xpdf_to_GBool(__pyx_v_start_at_last), __pyx_f_6pyxpdf_4xpdf_to_GBool(__pyx_v_stop_at_last), __pyx_f_6pyxpdf_4xpdf_to_GBool(__pyx_v_case_sensitive), __pyx_f_6pyxpdf_4xpdf_to_GBool(__pyx_v_backward), __pyx_f_6pyxpdf_4xpdf_to_GBool(__pyx_v_wholeword), (&__pyx_v_x_min), (&__pyx_v_y_min), (&__pyx_v_x_max), (&__pyx_v_y_max)); - /* "src/pyxpdf/document.pxi":586 + /* "src/pyxpdf/document.pxi":596 * &x_min, &y_min, &x_max, &y_max) * * return (x_min, y_min, x_max, y_max) if res == gTrue else None # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(586,0,__PYX_ERR(6, 586, __pyx_L1_error)) + __Pyx_TraceLine(596,0,__PYX_ERR(6, 596, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); if (((__pyx_v_res == gTrue) != 0)) { - __pyx_t_6 = PyFloat_FromDouble(__pyx_v_x_min); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 586, __pyx_L1_error) + __pyx_t_6 = PyFloat_FromDouble(__pyx_v_x_min); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyFloat_FromDouble(__pyx_v_y_min); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 586, __pyx_L1_error) + __pyx_t_7 = PyFloat_FromDouble(__pyx_v_y_min); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyFloat_FromDouble(__pyx_v_x_max); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 586, __pyx_L1_error) + __pyx_t_8 = PyFloat_FromDouble(__pyx_v_x_max); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = PyFloat_FromDouble(__pyx_v_y_max); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 586, __pyx_L1_error) + __pyx_t_9 = PyFloat_FromDouble(__pyx_v_y_max); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyTuple_New(4); if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 586, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(4); if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6); @@ -28621,7 +28845,7 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_4Page__find_text(struct __pyx_obj_6pyxpdf __pyx_t_3 = 0; goto __pyx_L0; - /* "src/pyxpdf/document.pxi":560 + /* "src/pyxpdf/document.pxi":570 * return None * * cdef _find_text(self, text, search_box=None, start_at_top=True, stop_at_bottom=True, start_at_last=False, # <<<<<<<<<<<<<< @@ -28646,7 +28870,7 @@ static PyObject *__pyx_f_6pyxpdf_4xpdf_4Page__find_text(struct __pyx_obj_6pyxpdf return __pyx_r; } -/* "src/pyxpdf/document.pxi":591 +/* "src/pyxpdf/document.pxi":601 * * @property * def rotation(self): # <<<<<<<<<<<<<< @@ -28676,24 +28900,24 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_8rotation___get__(struct __pyx_obj const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[6], 591, 0, __PYX_ERR(6, 591, __pyx_L1_error)); + __Pyx_TraceCall("__get__", __pyx_f[6], 601, 0, __PYX_ERR(6, 601, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":594 + /* "src/pyxpdf/document.pxi":604 * """int: page rotation in degrees * """ * return self.page.getRotate() # <<<<<<<<<<<<<< * * @property */ - __Pyx_TraceLine(594,0,__PYX_ERR(6, 594, __pyx_L1_error)) + __Pyx_TraceLine(604,0,__PYX_ERR(6, 604, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->page->getRotate()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 594, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->page->getRotate()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "src/pyxpdf/document.pxi":591 + /* "src/pyxpdf/document.pxi":601 * * @property * def rotation(self): # <<<<<<<<<<<<<< @@ -28713,7 +28937,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_8rotation___get__(struct __pyx_obj return __pyx_r; } -/* "src/pyxpdf/document.pxi":597 +/* "src/pyxpdf/document.pxi":607 * * @property * def is_cropped(self): # <<<<<<<<<<<<<< @@ -28743,24 +28967,24 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_10is_cropped___get__(struct __pyx_ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[6], 597, 0, __PYX_ERR(6, 597, __pyx_L1_error)); + __Pyx_TraceCall("__get__", __pyx_f[6], 607, 0, __PYX_ERR(6, 607, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":600 + /* "src/pyxpdf/document.pxi":610 * """bool: whether page is cropped or not * """ * return GBool_to_bool(self.page.isCropped()) # <<<<<<<<<<<<<< * * @property */ - __Pyx_TraceLine(600,0,__PYX_ERR(6, 600, __pyx_L1_error)) + __Pyx_TraceLine(610,0,__PYX_ERR(6, 610, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_6pyxpdf_4xpdf_GBool_to_bool(__pyx_v_self->page->isCropped()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 600, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6pyxpdf_4xpdf_GBool_to_bool(__pyx_v_self->page->isCropped()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "src/pyxpdf/document.pxi":597 + /* "src/pyxpdf/document.pxi":607 * * @property * def is_cropped(self): # <<<<<<<<<<<<<< @@ -28780,7 +29004,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_10is_cropped___get__(struct __pyx_ return __pyx_r; } -/* "src/pyxpdf/document.pxi":603 +/* "src/pyxpdf/document.pxi":613 * * @property * def media_height(self): # <<<<<<<<<<<<<< @@ -28810,24 +29034,24 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_12media_height___get__(struct __py const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[6], 603, 0, __PYX_ERR(6, 603, __pyx_L1_error)); + __Pyx_TraceCall("__get__", __pyx_f[6], 613, 0, __PYX_ERR(6, 613, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":606 + /* "src/pyxpdf/document.pxi":616 * """float: page mediabox height * """ * return self.page.getMediaHeight() # <<<<<<<<<<<<<< * * @property */ - __Pyx_TraceLine(606,0,__PYX_ERR(6, 606, __pyx_L1_error)) + __Pyx_TraceLine(616,0,__PYX_ERR(6, 616, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->page->getMediaHeight()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 606, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->page->getMediaHeight()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 616, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "src/pyxpdf/document.pxi":603 + /* "src/pyxpdf/document.pxi":613 * * @property * def media_height(self): # <<<<<<<<<<<<<< @@ -28847,7 +29071,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_12media_height___get__(struct __py return __pyx_r; } -/* "src/pyxpdf/document.pxi":609 +/* "src/pyxpdf/document.pxi":619 * * @property * def media_width(self): # <<<<<<<<<<<<<< @@ -28877,24 +29101,24 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_11media_width___get__(struct __pyx const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[6], 609, 0, __PYX_ERR(6, 609, __pyx_L1_error)); + __Pyx_TraceCall("__get__", __pyx_f[6], 619, 0, __PYX_ERR(6, 619, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":612 + /* "src/pyxpdf/document.pxi":622 * """float: page mediabox width * """ * return self.page.getMediaWidth() # <<<<<<<<<<<<<< * * @property */ - __Pyx_TraceLine(612,0,__PYX_ERR(6, 612, __pyx_L1_error)) + __Pyx_TraceLine(622,0,__PYX_ERR(6, 622, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->page->getMediaWidth()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 612, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->page->getMediaWidth()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 622, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "src/pyxpdf/document.pxi":609 + /* "src/pyxpdf/document.pxi":619 * * @property * def media_width(self): # <<<<<<<<<<<<<< @@ -28914,7 +29138,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_11media_width___get__(struct __pyx return __pyx_r; } -/* "src/pyxpdf/document.pxi":615 +/* "src/pyxpdf/document.pxi":625 * * @property * def crop_height(self): # <<<<<<<<<<<<<< @@ -28944,24 +29168,24 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_11crop_height___get__(struct __pyx const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[6], 615, 0, __PYX_ERR(6, 615, __pyx_L1_error)); + __Pyx_TraceCall("__get__", __pyx_f[6], 625, 0, __PYX_ERR(6, 625, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":618 + /* "src/pyxpdf/document.pxi":628 * """float: page cropbox width * """ * return self.page.getCropHeight() # <<<<<<<<<<<<<< * * @property */ - __Pyx_TraceLine(618,0,__PYX_ERR(6, 618, __pyx_L1_error)) + __Pyx_TraceLine(628,0,__PYX_ERR(6, 628, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->page->getCropHeight()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 618, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->page->getCropHeight()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "src/pyxpdf/document.pxi":615 + /* "src/pyxpdf/document.pxi":625 * * @property * def crop_height(self): # <<<<<<<<<<<<<< @@ -28981,7 +29205,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_11crop_height___get__(struct __pyx return __pyx_r; } -/* "src/pyxpdf/document.pxi":621 +/* "src/pyxpdf/document.pxi":631 * * @property * def crop_width(self): # <<<<<<<<<<<<<< @@ -29011,24 +29235,24 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_10crop_width___get__(struct __pyx_ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[6], 621, 0, __PYX_ERR(6, 621, __pyx_L1_error)); + __Pyx_TraceCall("__get__", __pyx_f[6], 631, 0, __PYX_ERR(6, 631, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":624 + /* "src/pyxpdf/document.pxi":634 * """float: page cropbox width * """ * return self.page.getCropWidth() # <<<<<<<<<<<<<< * * @property */ - __Pyx_TraceLine(624,0,__PYX_ERR(6, 624, __pyx_L1_error)) + __Pyx_TraceLine(634,0,__PYX_ERR(6, 634, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->page->getCropWidth()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 624, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->page->getCropWidth()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "src/pyxpdf/document.pxi":621 + /* "src/pyxpdf/document.pxi":631 * * @property * def crop_width(self): # <<<<<<<<<<<<<< @@ -29048,7 +29272,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_10crop_width___get__(struct __pyx_ return __pyx_r; } -/* "src/pyxpdf/document.pxi":627 +/* "src/pyxpdf/document.pxi":637 * * @property * def mediabox(self): # <<<<<<<<<<<<<< @@ -29078,24 +29302,24 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_8mediabox___get__(struct __pyx_obj const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[6], 627, 0, __PYX_ERR(6, 627, __pyx_L1_error)); + __Pyx_TraceCall("__get__", __pyx_f[6], 637, 0, __PYX_ERR(6, 637, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":630 + /* "src/pyxpdf/document.pxi":640 * """tuple of float, (x1, y1, x2, y2): Page's media box cordinates * """ * return PDFRectangle_to_tuple(self.page.getMediaBox()) # <<<<<<<<<<<<<< * * @property */ - __Pyx_TraceLine(630,0,__PYX_ERR(6, 630, __pyx_L1_error)) + __Pyx_TraceLine(640,0,__PYX_ERR(6, 640, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_6pyxpdf_4xpdf_PDFRectangle_to_tuple(__pyx_v_self->page->getMediaBox()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 630, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6pyxpdf_4xpdf_PDFRectangle_to_tuple(__pyx_v_self->page->getMediaBox()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "src/pyxpdf/document.pxi":627 + /* "src/pyxpdf/document.pxi":637 * * @property * def mediabox(self): # <<<<<<<<<<<<<< @@ -29115,7 +29339,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_8mediabox___get__(struct __pyx_obj return __pyx_r; } -/* "src/pyxpdf/document.pxi":633 +/* "src/pyxpdf/document.pxi":643 * * @property * def cropbox(self): # <<<<<<<<<<<<<< @@ -29145,24 +29369,24 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_7cropbox___get__(struct __pyx_obj_ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[6], 633, 0, __PYX_ERR(6, 633, __pyx_L1_error)); + __Pyx_TraceCall("__get__", __pyx_f[6], 643, 0, __PYX_ERR(6, 643, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":636 + /* "src/pyxpdf/document.pxi":646 * """tuple of float, (x1, y1, x2, y2): Page's crop box cordinates * """ * return PDFRectangle_to_tuple(self.page.getCropBox()) # <<<<<<<<<<<<<< * * @property */ - __Pyx_TraceLine(636,0,__PYX_ERR(6, 636, __pyx_L1_error)) + __Pyx_TraceLine(646,0,__PYX_ERR(6, 646, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_6pyxpdf_4xpdf_PDFRectangle_to_tuple(__pyx_v_self->page->getCropBox()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 636, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6pyxpdf_4xpdf_PDFRectangle_to_tuple(__pyx_v_self->page->getCropBox()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "src/pyxpdf/document.pxi":633 + /* "src/pyxpdf/document.pxi":643 * * @property * def cropbox(self): # <<<<<<<<<<<<<< @@ -29182,7 +29406,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_7cropbox___get__(struct __pyx_obj_ return __pyx_r; } -/* "src/pyxpdf/document.pxi":639 +/* "src/pyxpdf/document.pxi":649 * * @property * def bleedbox(self): # <<<<<<<<<<<<<< @@ -29212,24 +29436,24 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_8bleedbox___get__(struct __pyx_obj const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[6], 639, 0, __PYX_ERR(6, 639, __pyx_L1_error)); + __Pyx_TraceCall("__get__", __pyx_f[6], 649, 0, __PYX_ERR(6, 649, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":642 + /* "src/pyxpdf/document.pxi":652 * """tuple of float, (x1, y1, x2, y2): Page's bleed box cordinates * """ * return PDFRectangle_to_tuple(self.page.getBleedBox()) # <<<<<<<<<<<<<< * * @property */ - __Pyx_TraceLine(642,0,__PYX_ERR(6, 642, __pyx_L1_error)) + __Pyx_TraceLine(652,0,__PYX_ERR(6, 652, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_6pyxpdf_4xpdf_PDFRectangle_to_tuple(__pyx_v_self->page->getBleedBox()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 642, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6pyxpdf_4xpdf_PDFRectangle_to_tuple(__pyx_v_self->page->getBleedBox()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "src/pyxpdf/document.pxi":639 + /* "src/pyxpdf/document.pxi":649 * * @property * def bleedbox(self): # <<<<<<<<<<<<<< @@ -29249,7 +29473,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_8bleedbox___get__(struct __pyx_obj return __pyx_r; } -/* "src/pyxpdf/document.pxi":645 +/* "src/pyxpdf/document.pxi":655 * * @property * def trimbox(self): # <<<<<<<<<<<<<< @@ -29279,24 +29503,24 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_7trimbox___get__(struct __pyx_obj_ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[6], 645, 0, __PYX_ERR(6, 645, __pyx_L1_error)); + __Pyx_TraceCall("__get__", __pyx_f[6], 655, 0, __PYX_ERR(6, 655, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":648 + /* "src/pyxpdf/document.pxi":658 * """tuple of float, (x1, y1, x2, y2): Page's trim box cordinates * """ * return PDFRectangle_to_tuple(self.page.getTrimBox()) # <<<<<<<<<<<<<< * * @property */ - __Pyx_TraceLine(648,0,__PYX_ERR(6, 648, __pyx_L1_error)) + __Pyx_TraceLine(658,0,__PYX_ERR(6, 658, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_6pyxpdf_4xpdf_PDFRectangle_to_tuple(__pyx_v_self->page->getTrimBox()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 648, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6pyxpdf_4xpdf_PDFRectangle_to_tuple(__pyx_v_self->page->getTrimBox()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "src/pyxpdf/document.pxi":645 + /* "src/pyxpdf/document.pxi":655 * * @property * def trimbox(self): # <<<<<<<<<<<<<< @@ -29316,7 +29540,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_7trimbox___get__(struct __pyx_obj_ return __pyx_r; } -/* "src/pyxpdf/document.pxi":651 +/* "src/pyxpdf/document.pxi":661 * * @property * def artbox(self): # <<<<<<<<<<<<<< @@ -29346,24 +29570,24 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_6artbox___get__(struct __pyx_obj_6 const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[6], 651, 0, __PYX_ERR(6, 651, __pyx_L1_error)); + __Pyx_TraceCall("__get__", __pyx_f[6], 661, 0, __PYX_ERR(6, 661, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":654 + /* "src/pyxpdf/document.pxi":664 * """tuple of float, (x1, y1, x2, y2): Page's art box cordinates * """ * return PDFRectangle_to_tuple(self.page.getArtBox()) # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(654,0,__PYX_ERR(6, 654, __pyx_L1_error)) + __Pyx_TraceLine(664,0,__PYX_ERR(6, 664, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_6pyxpdf_4xpdf_PDFRectangle_to_tuple(__pyx_v_self->page->getArtBox()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 654, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6pyxpdf_4xpdf_PDFRectangle_to_tuple(__pyx_v_self->page->getArtBox()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 664, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "src/pyxpdf/document.pxi":651 + /* "src/pyxpdf/document.pxi":661 * * @property * def artbox(self): # <<<<<<<<<<<<<< @@ -29383,7 +29607,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_6artbox___get__(struct __pyx_obj_6 return __pyx_r; } -/* "src/pyxpdf/document.pxi":657 +/* "src/pyxpdf/document.pxi":667 * * * def find_text(self, text, search_box=None, direction="top", case_sensitive=False, # <<<<<<<<<<<<<< @@ -29415,7 +29639,7 @@ static PyObject *__pyx_pw_6pyxpdf_4xpdf_4Page_7find_text(PyObject *__pyx_v_self, values[2] = ((PyObject *)__pyx_n_u_top); values[3] = ((PyObject *)Py_False); - /* "src/pyxpdf/document.pxi":658 + /* "src/pyxpdf/document.pxi":668 * * def find_text(self, text, search_box=None, direction="top", case_sensitive=False, * wholeword=False, rotation=0): # <<<<<<<<<<<<<< @@ -29480,7 +29704,7 @@ static PyObject *__pyx_pw_6pyxpdf_4xpdf_4Page_7find_text(PyObject *__pyx_v_self, } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "find_text") < 0)) __PYX_ERR(6, 657, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "find_text") < 0)) __PYX_ERR(6, 667, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -29508,7 +29732,7 @@ static PyObject *__pyx_pw_6pyxpdf_4xpdf_4Page_7find_text(PyObject *__pyx_v_self, } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("find_text", 0, 1, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 657, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("find_text", 0, 1, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 667, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pyxpdf.xpdf.Page.find_text", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -29516,7 +29740,7 @@ static PyObject *__pyx_pw_6pyxpdf_4xpdf_4Page_7find_text(PyObject *__pyx_v_self, __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6pyxpdf_4xpdf_4Page_6find_text(((struct __pyx_obj_6pyxpdf_4xpdf_Page *)__pyx_v_self), __pyx_v_text, __pyx_v_search_box, __pyx_v_direction, __pyx_v_case_sensitive, __pyx_v_wholeword, __pyx_v_rotation); - /* "src/pyxpdf/document.pxi":657 + /* "src/pyxpdf/document.pxi":667 * * * def find_text(self, text, search_box=None, direction="top", case_sensitive=False, # <<<<<<<<<<<<<< @@ -29540,40 +29764,40 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_6find_text(struct __pyx_obj_6pyxpd int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__97) + __Pyx_TraceFrameInit(__pyx_codeobj__98) __Pyx_RefNannySetupContext("find_text", 0); - __Pyx_TraceCall("find_text", __pyx_f[6], 657, 0, __PYX_ERR(6, 657, __pyx_L1_error)); + __Pyx_TraceCall("find_text", __pyx_f[6], 667, 0, __PYX_ERR(6, 667, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":700 + /* "src/pyxpdf/document.pxi":710 * """ * * result = None # <<<<<<<<<<<<<< * if direction == "top": * result = self._find_text(text, search_box, True, True, False, False, */ - __Pyx_TraceLine(700,0,__PYX_ERR(6, 700, __pyx_L1_error)) + __Pyx_TraceLine(710,0,__PYX_ERR(6, 710, __pyx_L1_error)) __Pyx_INCREF(Py_None); __pyx_v_result = Py_None; - /* "src/pyxpdf/document.pxi":701 + /* "src/pyxpdf/document.pxi":711 * * result = None * if direction == "top": # <<<<<<<<<<<<<< * result = self._find_text(text, search_box, True, True, False, False, * case_sensitive, False, wholeword, rotation) */ - __Pyx_TraceLine(701,0,__PYX_ERR(6, 701, __pyx_L1_error)) - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_direction, __pyx_n_u_top, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 701, __pyx_L1_error) + __Pyx_TraceLine(711,0,__PYX_ERR(6, 711, __pyx_L1_error)) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_direction, __pyx_n_u_top, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 711, __pyx_L1_error) if (__pyx_t_1) { - /* "src/pyxpdf/document.pxi":702 + /* "src/pyxpdf/document.pxi":712 * result = None * if direction == "top": * result = self._find_text(text, search_box, True, True, False, False, # <<<<<<<<<<<<<< * case_sensitive, False, wholeword, rotation) * if direction == "next": */ - __Pyx_TraceLine(702,0,__PYX_ERR(6, 702, __pyx_L1_error)) + __Pyx_TraceLine(712,0,__PYX_ERR(6, 712, __pyx_L1_error)) __pyx_t_3.__pyx_n = 9; __pyx_t_3.search_box = __pyx_v_search_box; __pyx_t_3.start_at_top = Py_True; @@ -29584,12 +29808,12 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_6find_text(struct __pyx_obj_6pyxpd __pyx_t_3.backward = Py_False; __pyx_t_3.wholeword = __pyx_v_wholeword; __pyx_t_3.rotation = __pyx_v_rotation; - __pyx_t_2 = ((struct __pyx_vtabstruct_6pyxpdf_4xpdf_Page *)__pyx_v_self->__pyx_vtab)->_find_text(__pyx_v_self, __pyx_v_text, &__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 702, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_6pyxpdf_4xpdf_Page *)__pyx_v_self->__pyx_vtab)->_find_text(__pyx_v_self, __pyx_v_text, &__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_2); __pyx_t_2 = 0; - /* "src/pyxpdf/document.pxi":701 + /* "src/pyxpdf/document.pxi":711 * * result = None * if direction == "top": # <<<<<<<<<<<<<< @@ -29598,25 +29822,25 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_6find_text(struct __pyx_obj_6pyxpd */ } - /* "src/pyxpdf/document.pxi":704 + /* "src/pyxpdf/document.pxi":714 * result = self._find_text(text, search_box, True, True, False, False, * case_sensitive, False, wholeword, rotation) * if direction == "next": # <<<<<<<<<<<<<< * result = self._find_text(text, search_box, False, True, True, False, * case_sensitive, False, wholeword, rotation) */ - __Pyx_TraceLine(704,0,__PYX_ERR(6, 704, __pyx_L1_error)) - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_direction, __pyx_n_u_next, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 704, __pyx_L1_error) + __Pyx_TraceLine(714,0,__PYX_ERR(6, 714, __pyx_L1_error)) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_direction, __pyx_n_u_next, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 714, __pyx_L1_error) if (__pyx_t_1) { - /* "src/pyxpdf/document.pxi":705 + /* "src/pyxpdf/document.pxi":715 * case_sensitive, False, wholeword, rotation) * if direction == "next": * result = self._find_text(text, search_box, False, True, True, False, # <<<<<<<<<<<<<< * case_sensitive, False, wholeword, rotation) * if direction == "previous": */ - __Pyx_TraceLine(705,0,__PYX_ERR(6, 705, __pyx_L1_error)) + __Pyx_TraceLine(715,0,__PYX_ERR(6, 715, __pyx_L1_error)) __pyx_t_3.__pyx_n = 9; __pyx_t_3.search_box = __pyx_v_search_box; __pyx_t_3.start_at_top = Py_False; @@ -29627,12 +29851,12 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_6find_text(struct __pyx_obj_6pyxpd __pyx_t_3.backward = Py_False; __pyx_t_3.wholeword = __pyx_v_wholeword; __pyx_t_3.rotation = __pyx_v_rotation; - __pyx_t_2 = ((struct __pyx_vtabstruct_6pyxpdf_4xpdf_Page *)__pyx_v_self->__pyx_vtab)->_find_text(__pyx_v_self, __pyx_v_text, &__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 705, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_6pyxpdf_4xpdf_Page *)__pyx_v_self->__pyx_vtab)->_find_text(__pyx_v_self, __pyx_v_text, &__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_2); __pyx_t_2 = 0; - /* "src/pyxpdf/document.pxi":704 + /* "src/pyxpdf/document.pxi":714 * result = self._find_text(text, search_box, True, True, False, False, * case_sensitive, False, wholeword, rotation) * if direction == "next": # <<<<<<<<<<<<<< @@ -29641,25 +29865,25 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_6find_text(struct __pyx_obj_6pyxpd */ } - /* "src/pyxpdf/document.pxi":707 + /* "src/pyxpdf/document.pxi":717 * result = self._find_text(text, search_box, False, True, True, False, * case_sensitive, False, wholeword, rotation) * if direction == "previous": # <<<<<<<<<<<<<< * result = self._find_text(text, search_box, False, True, True, False, * case_sensitive, True, wholeword, rotation) */ - __Pyx_TraceLine(707,0,__PYX_ERR(6, 707, __pyx_L1_error)) - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_direction, __pyx_n_u_previous, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 707, __pyx_L1_error) + __Pyx_TraceLine(717,0,__PYX_ERR(6, 717, __pyx_L1_error)) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_direction, __pyx_n_u_previous, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 717, __pyx_L1_error) if (__pyx_t_1) { - /* "src/pyxpdf/document.pxi":708 + /* "src/pyxpdf/document.pxi":718 * case_sensitive, False, wholeword, rotation) * if direction == "previous": * result = self._find_text(text, search_box, False, True, True, False, # <<<<<<<<<<<<<< * case_sensitive, True, wholeword, rotation) * return result */ - __Pyx_TraceLine(708,0,__PYX_ERR(6, 708, __pyx_L1_error)) + __Pyx_TraceLine(718,0,__PYX_ERR(6, 718, __pyx_L1_error)) __pyx_t_3.__pyx_n = 9; __pyx_t_3.search_box = __pyx_v_search_box; __pyx_t_3.start_at_top = Py_False; @@ -29670,12 +29894,12 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_6find_text(struct __pyx_obj_6pyxpd __pyx_t_3.backward = Py_True; __pyx_t_3.wholeword = __pyx_v_wholeword; __pyx_t_3.rotation = __pyx_v_rotation; - __pyx_t_2 = ((struct __pyx_vtabstruct_6pyxpdf_4xpdf_Page *)__pyx_v_self->__pyx_vtab)->_find_text(__pyx_v_self, __pyx_v_text, &__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 708, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_6pyxpdf_4xpdf_Page *)__pyx_v_self->__pyx_vtab)->_find_text(__pyx_v_self, __pyx_v_text, &__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 718, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_2); __pyx_t_2 = 0; - /* "src/pyxpdf/document.pxi":707 + /* "src/pyxpdf/document.pxi":717 * result = self._find_text(text, search_box, False, True, True, False, * case_sensitive, False, wholeword, rotation) * if direction == "previous": # <<<<<<<<<<<<<< @@ -29684,20 +29908,20 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_6find_text(struct __pyx_obj_6pyxpd */ } - /* "src/pyxpdf/document.pxi":710 + /* "src/pyxpdf/document.pxi":720 * result = self._find_text(text, search_box, False, True, True, False, * case_sensitive, True, wholeword, rotation) * return result # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(710,0,__PYX_ERR(6, 710, __pyx_L1_error)) + __Pyx_TraceLine(720,0,__PYX_ERR(6, 720, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; - /* "src/pyxpdf/document.pxi":657 + /* "src/pyxpdf/document.pxi":667 * * * def find_text(self, text, search_box=None, direction="top", case_sensitive=False, # <<<<<<<<<<<<<< @@ -29719,7 +29943,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_6find_text(struct __pyx_obj_6pyxpd } static PyObject *__pyx_gb_6pyxpdf_4xpdf_4Page_10generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "src/pyxpdf/document.pxi":713 +/* "src/pyxpdf/document.pxi":723 * * * def find_all_text(self, text, search_box=None, case_sensitive=False, wholeword=False, # <<<<<<<<<<<<<< @@ -29798,7 +30022,7 @@ static PyObject *__pyx_pw_6pyxpdf_4xpdf_4Page_9find_all_text(PyObject *__pyx_v_s } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "find_all_text") < 0)) __PYX_ERR(6, 713, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "find_all_text") < 0)) __PYX_ERR(6, 723, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -29823,7 +30047,7 @@ static PyObject *__pyx_pw_6pyxpdf_4xpdf_4Page_9find_all_text(PyObject *__pyx_v_s } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("find_all_text", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 713, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("find_all_text", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 723, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pyxpdf.xpdf.Page.find_all_text", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -29848,7 +30072,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_8find_all_text(struct __pyx_obj_6p if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_6pyxpdf_4xpdf___pyx_scope_struct__find_all_text *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(6, 713, __pyx_L1_error) + __PYX_ERR(6, 723, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } @@ -29871,7 +30095,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_8find_all_text(struct __pyx_obj_6p __Pyx_INCREF(__pyx_cur_scope->__pyx_v_rotation); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_rotation); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6pyxpdf_4xpdf_4Page_10generator, __pyx_codeobj__98, (PyObject *) __pyx_cur_scope, __pyx_n_s_find_all_text, __pyx_n_s_Page_find_all_text, __pyx_n_s_pyxpdf_xpdf); if (unlikely(!gen)) __PYX_ERR(6, 713, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6pyxpdf_4xpdf_4Page_10generator, __pyx_codeobj__99, (PyObject *) __pyx_cur_scope, __pyx_n_s_find_all_text, __pyx_n_s_Page_find_all_text, __pyx_n_s_pyxpdf_xpdf); if (unlikely(!gen)) __PYX_ERR(6, 723, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -29903,8 +30127,8 @@ static PyObject *__pyx_gb_6pyxpdf_4xpdf_4Page_10generator(__pyx_CoroutineObject int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("find_all_text", 0); - __Pyx_TraceFrameInit(__pyx_codeobj__98) - __Pyx_TraceCall("find_all_text", __pyx_f[6], 713, 0, __PYX_ERR(6, 713, __pyx_L1_error)); + __Pyx_TraceFrameInit(__pyx_codeobj__99) + __Pyx_TraceCall("find_all_text", __pyx_f[6], 723, 0, __PYX_ERR(6, 723, __pyx_L1_error)); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L6_resume_from_yield; @@ -29914,27 +30138,27 @@ static PyObject *__pyx_gb_6pyxpdf_4xpdf_4Page_10generator(__pyx_CoroutineObject return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(6, 713, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(6, 723, __pyx_L1_error) - /* "src/pyxpdf/document.pxi":737 + /* "src/pyxpdf/document.pxi":747 * * """ * res = self.find_text(text, search_box, "top", # <<<<<<<<<<<<<< * case_sensitive, wholeword) * while res: */ - __Pyx_TraceLine(737,0,__PYX_ERR(6, 737, __pyx_L1_error)) - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_find_text); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 737, __pyx_L1_error) + __Pyx_TraceLine(747,0,__PYX_ERR(6, 747, __pyx_L1_error)) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_find_text); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "src/pyxpdf/document.pxi":738 + /* "src/pyxpdf/document.pxi":748 * """ * res = self.find_text(text, search_box, "top", * case_sensitive, wholeword) # <<<<<<<<<<<<<< * while res: * yield res */ - __Pyx_TraceLine(738,0,__PYX_ERR(6, 738, __pyx_L1_error)) + __Pyx_TraceLine(748,0,__PYX_ERR(6, 748, __pyx_L1_error)) __pyx_t_3 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -29950,7 +30174,7 @@ static PyObject *__pyx_gb_6pyxpdf_4xpdf_4Page_10generator(__pyx_CoroutineObject #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[6] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_text, __pyx_cur_scope->__pyx_v_search_box, __pyx_n_u_top, __pyx_cur_scope->__pyx_v_case_sensitive, __pyx_cur_scope->__pyx_v_wholeword}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 5+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 737, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 5+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 747, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -29958,13 +30182,13 @@ static PyObject *__pyx_gb_6pyxpdf_4xpdf_4Page_10generator(__pyx_CoroutineObject #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[6] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_text, __pyx_cur_scope->__pyx_v_search_box, __pyx_n_u_top, __pyx_cur_scope->__pyx_v_case_sensitive, __pyx_cur_scope->__pyx_v_wholeword}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 5+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 737, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 5+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 747, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { - __pyx_t_5 = PyTuple_New(5+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 737, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(5+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; @@ -29984,7 +30208,7 @@ static PyObject *__pyx_gb_6pyxpdf_4xpdf_4Page_10generator(__pyx_CoroutineObject __Pyx_INCREF(__pyx_cur_scope->__pyx_v_wholeword); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_wholeword); PyTuple_SET_ITEM(__pyx_t_5, 4+__pyx_t_4, __pyx_cur_scope->__pyx_v_wholeword); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 737, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -29993,26 +30217,26 @@ static PyObject *__pyx_gb_6pyxpdf_4xpdf_4Page_10generator(__pyx_CoroutineObject __pyx_cur_scope->__pyx_v_res = __pyx_t_1; __pyx_t_1 = 0; - /* "src/pyxpdf/document.pxi":739 + /* "src/pyxpdf/document.pxi":749 * res = self.find_text(text, search_box, "top", * case_sensitive, wholeword) * while res: # <<<<<<<<<<<<<< * yield res * res = self.find_text(text, search_box, "next", */ - __Pyx_TraceLine(739,0,__PYX_ERR(6, 739, __pyx_L1_error)) + __Pyx_TraceLine(749,0,__PYX_ERR(6, 749, __pyx_L1_error)) while (1) { - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_res); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(6, 739, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_res); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(6, 749, __pyx_L1_error) if (!__pyx_t_6) break; - /* "src/pyxpdf/document.pxi":740 + /* "src/pyxpdf/document.pxi":750 * case_sensitive, wholeword) * while res: * yield res # <<<<<<<<<<<<<< * res = self.find_text(text, search_box, "next", * case_sensitive, wholeword) */ - __Pyx_TraceLine(740,0,__PYX_ERR(6, 740, __pyx_L1_error)) + __Pyx_TraceLine(750,0,__PYX_ERR(6, 750, __pyx_L1_error)) __Pyx_INCREF(__pyx_cur_scope->__pyx_v_res); __pyx_r = __pyx_cur_scope->__pyx_v_res; __Pyx_XGIVEREF(__pyx_r); @@ -30023,27 +30247,27 @@ static PyObject *__pyx_gb_6pyxpdf_4xpdf_4Page_10generator(__pyx_CoroutineObject __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L6_resume_from_yield:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(6, 740, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(6, 750, __pyx_L1_error) - /* "src/pyxpdf/document.pxi":741 + /* "src/pyxpdf/document.pxi":751 * while res: * yield res * res = self.find_text(text, search_box, "next", # <<<<<<<<<<<<<< * case_sensitive, wholeword) * */ - __Pyx_TraceLine(741,0,__PYX_ERR(6, 741, __pyx_L1_error)) - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_find_text); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 741, __pyx_L1_error) + __Pyx_TraceLine(751,0,__PYX_ERR(6, 751, __pyx_L1_error)) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_find_text); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "src/pyxpdf/document.pxi":742 + /* "src/pyxpdf/document.pxi":752 * yield res * res = self.find_text(text, search_box, "next", * case_sensitive, wholeword) # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(742,0,__PYX_ERR(6, 742, __pyx_L1_error)) + __Pyx_TraceLine(752,0,__PYX_ERR(6, 752, __pyx_L1_error)) __pyx_t_5 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -30059,7 +30283,7 @@ static PyObject *__pyx_gb_6pyxpdf_4xpdf_4Page_10generator(__pyx_CoroutineObject #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[6] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_text, __pyx_cur_scope->__pyx_v_search_box, __pyx_n_u_next, __pyx_cur_scope->__pyx_v_case_sensitive, __pyx_cur_scope->__pyx_v_wholeword}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 5+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 741, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 5+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 751, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -30067,13 +30291,13 @@ static PyObject *__pyx_gb_6pyxpdf_4xpdf_4Page_10generator(__pyx_CoroutineObject #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[6] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_text, __pyx_cur_scope->__pyx_v_search_box, __pyx_n_u_next, __pyx_cur_scope->__pyx_v_case_sensitive, __pyx_cur_scope->__pyx_v_wholeword}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 5+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 741, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 5+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 751, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { - __pyx_t_3 = PyTuple_New(5+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 741, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(5+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL; @@ -30093,7 +30317,7 @@ static PyObject *__pyx_gb_6pyxpdf_4xpdf_4Page_10generator(__pyx_CoroutineObject __Pyx_INCREF(__pyx_cur_scope->__pyx_v_wholeword); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_wholeword); PyTuple_SET_ITEM(__pyx_t_3, 4+__pyx_t_4, __pyx_cur_scope->__pyx_v_wholeword); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 741, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -30105,7 +30329,7 @@ static PyObject *__pyx_gb_6pyxpdf_4xpdf_4Page_10generator(__pyx_CoroutineObject } CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - /* "src/pyxpdf/document.pxi":713 + /* "src/pyxpdf/document.pxi":723 * * * def find_all_text(self, text, search_box=None, case_sensitive=False, wholeword=False, # <<<<<<<<<<<<<< @@ -30134,7 +30358,7 @@ static PyObject *__pyx_gb_6pyxpdf_4xpdf_4Page_10generator(__pyx_CoroutineObject return __pyx_r; } -/* "src/pyxpdf/document.pxi":745 +/* "src/pyxpdf/document.pxi":755 * * * def text_bytes(self, page_area=None, TextControl control = None): # <<<<<<<<<<<<<< @@ -30186,7 +30410,7 @@ static PyObject *__pyx_pw_6pyxpdf_4xpdf_4Page_12text_bytes(PyObject *__pyx_v_sel } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "text_bytes") < 0)) __PYX_ERR(6, 745, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "text_bytes") < 0)) __PYX_ERR(6, 755, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -30203,13 +30427,13 @@ static PyObject *__pyx_pw_6pyxpdf_4xpdf_4Page_12text_bytes(PyObject *__pyx_v_sel } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("text_bytes", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 745, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("text_bytes", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 755, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pyxpdf.xpdf.Page.text_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_control), __pyx_ptype_6pyxpdf_4xpdf_TextControl, 1, "control", 0))) __PYX_ERR(6, 745, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_control), __pyx_ptype_6pyxpdf_4xpdf_TextControl, 1, "control", 0))) __PYX_ERR(6, 755, __pyx_L1_error) __pyx_r = __pyx_pf_6pyxpdf_4xpdf_4Page_11text_bytes(((struct __pyx_obj_6pyxpdf_4xpdf_Page *)__pyx_v_self), __pyx_v_page_area, __pyx_v_control); /* function exit code */ @@ -30238,19 +30462,19 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_11text_bytes(struct __pyx_obj_6pyx int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__99) + __Pyx_TraceFrameInit(__pyx_codeobj__100) __Pyx_RefNannySetupContext("text_bytes", 0); - __Pyx_TraceCall("text_bytes", __pyx_f[6], 745, 0, __PYX_ERR(6, 745, __pyx_L1_error)); + __Pyx_TraceCall("text_bytes", __pyx_f[6], 755, 0, __PYX_ERR(6, 755, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":778 + /* "src/pyxpdf/document.pxi":788 * """ * cdef: * TextOutputControl text_control = deref(control.get_c_control()) if control else TextOutputControl() # <<<<<<<<<<<<<< * unique_ptr[string] out = make_unique[string]() * unique_ptr[TextOutputDev] text_dev = make_unique[TextOutputDev](&append_to_cpp_string, out.get(), &text_control) */ - __Pyx_TraceLine(778,0,__PYX_ERR(6, 778, __pyx_L1_error)) - __pyx_t_2 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_control)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 778, __pyx_L1_error) + __Pyx_TraceLine(788,0,__PYX_ERR(6, 788, __pyx_L1_error)) + __pyx_t_2 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_control)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 788, __pyx_L1_error) if (__pyx_t_2) { __pyx_t_1 = (*((struct __pyx_vtabstruct_6pyxpdf_4xpdf_TextControl *)__pyx_v_control->__pyx_vtab)->get_c_control(__pyx_v_control)); } else { @@ -30258,52 +30482,52 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_11text_bytes(struct __pyx_obj_6pyx } __pyx_v_text_control = __pyx_t_1; - /* "src/pyxpdf/document.pxi":779 + /* "src/pyxpdf/document.pxi":789 * cdef: * TextOutputControl text_control = deref(control.get_c_control()) if control else TextOutputControl() * unique_ptr[string] out = make_unique[string]() # <<<<<<<<<<<<<< * unique_ptr[TextOutputDev] text_dev = make_unique[TextOutputDev](&append_to_cpp_string, out.get(), &text_control) * */ - __Pyx_TraceLine(779,0,__PYX_ERR(6, 779, __pyx_L1_error)) + __Pyx_TraceLine(789,0,__PYX_ERR(6, 789, __pyx_L1_error)) __pyx_v_out = std::make_unique(); - /* "src/pyxpdf/document.pxi":780 + /* "src/pyxpdf/document.pxi":790 * TextOutputControl text_control = deref(control.get_c_control()) if control else TextOutputControl() * unique_ptr[string] out = make_unique[string]() * unique_ptr[TextOutputDev] text_dev = make_unique[TextOutputDev](&append_to_cpp_string, out.get(), &text_control) # <<<<<<<<<<<<<< * * if page_area == None: */ - __Pyx_TraceLine(780,0,__PYX_ERR(6, 780, __pyx_L1_error)) + __Pyx_TraceLine(790,0,__PYX_ERR(6, 790, __pyx_L1_error)) __pyx_v_text_dev = std::make_unique((&__pyx_f_6pyxpdf_4xpdf_append_to_cpp_string), __pyx_v_out.get(), (&__pyx_v_text_control)); - /* "src/pyxpdf/document.pxi":782 + /* "src/pyxpdf/document.pxi":792 * unique_ptr[TextOutputDev] text_dev = make_unique[TextOutputDev](&append_to_cpp_string, out.get(), &text_control) * * if page_area == None: # <<<<<<<<<<<<<< * # Why crop=gTrue in displayPage? * self.display(text_dev.get()) */ - __Pyx_TraceLine(782,0,__PYX_ERR(6, 782, __pyx_L1_error)) - __pyx_t_3 = PyObject_RichCompare(__pyx_v_page_area, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 782, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 782, __pyx_L1_error) + __Pyx_TraceLine(792,0,__PYX_ERR(6, 792, __pyx_L1_error)) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_page_area, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 792, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 792, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { - /* "src/pyxpdf/document.pxi":784 + /* "src/pyxpdf/document.pxi":794 * if page_area == None: * # Why crop=gTrue in displayPage? * self.display(text_dev.get()) # <<<<<<<<<<<<<< * else: * self.display_slice(text_dev.get(), page_area[0], page_area[1], */ - __Pyx_TraceLine(784,0,__PYX_ERR(6, 784, __pyx_L1_error)) - __pyx_t_3 = ((struct __pyx_vtabstruct_6pyxpdf_4xpdf_Page *)__pyx_v_self->__pyx_vtab)->display(__pyx_v_self, __pyx_v_text_dev.get(), NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 784, __pyx_L1_error) + __Pyx_TraceLine(794,0,__PYX_ERR(6, 794, __pyx_L1_error)) + __pyx_t_3 = ((struct __pyx_vtabstruct_6pyxpdf_4xpdf_Page *)__pyx_v_self->__pyx_vtab)->display(__pyx_v_self, __pyx_v_text_dev.get(), NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "src/pyxpdf/document.pxi":782 + /* "src/pyxpdf/document.pxi":792 * unique_ptr[TextOutputDev] text_dev = make_unique[TextOutputDev](&append_to_cpp_string, out.get(), &text_control) * * if page_area == None: # <<<<<<<<<<<<<< @@ -30313,71 +30537,71 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_11text_bytes(struct __pyx_obj_6pyx goto __pyx_L3; } - /* "src/pyxpdf/document.pxi":786 + /* "src/pyxpdf/document.pxi":796 * self.display(text_dev.get()) * else: * self.display_slice(text_dev.get(), page_area[0], page_area[1], # <<<<<<<<<<<<<< * page_area[2], page_area[3]) * */ - __Pyx_TraceLine(786,0,__PYX_ERR(6, 786, __pyx_L1_error)) + __Pyx_TraceLine(796,0,__PYX_ERR(6, 796, __pyx_L1_error)) /*else*/ { - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_page_area, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 786, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_page_area, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 786, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 796, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_page_area, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 786, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_page_area, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 786, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 796, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "src/pyxpdf/document.pxi":787 + /* "src/pyxpdf/document.pxi":797 * else: * self.display_slice(text_dev.get(), page_area[0], page_area[1], * page_area[2], page_area[3]) # <<<<<<<<<<<<<< * * return deref(out) */ - __Pyx_TraceLine(787,0,__PYX_ERR(6, 787, __pyx_L1_error)) - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_page_area, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 787, __pyx_L1_error) + __Pyx_TraceLine(797,0,__PYX_ERR(6, 797, __pyx_L1_error)) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_page_area, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 797, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 787, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 797, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_page_area, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 787, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_page_area, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 797, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 787, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 797, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "src/pyxpdf/document.pxi":786 + /* "src/pyxpdf/document.pxi":796 * self.display(text_dev.get()) * else: * self.display_slice(text_dev.get(), page_area[0], page_area[1], # <<<<<<<<<<<<<< * page_area[2], page_area[3]) * */ - __Pyx_TraceLine(786,0,__PYX_ERR(6, 786, __pyx_L1_error)) - __pyx_t_3 = ((struct __pyx_vtabstruct_6pyxpdf_4xpdf_Page *)__pyx_v_self->__pyx_vtab)->display_slice(__pyx_v_self, __pyx_v_text_dev.get(), __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 786, __pyx_L1_error) + __Pyx_TraceLine(796,0,__PYX_ERR(6, 796, __pyx_L1_error)) + __pyx_t_3 = ((struct __pyx_vtabstruct_6pyxpdf_4xpdf_Page *)__pyx_v_self->__pyx_vtab)->display_slice(__pyx_v_self, __pyx_v_text_dev.get(), __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L3:; - /* "src/pyxpdf/document.pxi":789 + /* "src/pyxpdf/document.pxi":799 * page_area[2], page_area[3]) * * return deref(out) # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(789,0,__PYX_ERR(6, 789, __pyx_L1_error)) + __Pyx_TraceLine(799,0,__PYX_ERR(6, 799, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string((*__pyx_v_out)); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 789, __pyx_L1_error) + __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string((*__pyx_v_out)); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "src/pyxpdf/document.pxi":745 + /* "src/pyxpdf/document.pxi":755 * * * def text_bytes(self, page_area=None, TextControl control = None): # <<<<<<<<<<<<<< @@ -30397,7 +30621,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_11text_bytes(struct __pyx_obj_6pyx return __pyx_r; } -/* "src/pyxpdf/document.pxi":792 +/* "src/pyxpdf/document.pxi":802 * * * def text(self, page_area=None, control=None): # <<<<<<<<<<<<<< @@ -30449,7 +30673,7 @@ static PyObject *__pyx_pw_6pyxpdf_4xpdf_4Page_14text(PyObject *__pyx_v_self, PyO } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "text") < 0)) __PYX_ERR(6, 792, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "text") < 0)) __PYX_ERR(6, 802, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -30466,7 +30690,7 @@ static PyObject *__pyx_pw_6pyxpdf_4xpdf_4Page_14text(PyObject *__pyx_v_self, PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("text", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 792, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("text", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 802, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pyxpdf.xpdf.Page.text", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -30491,20 +30715,20 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_13text(struct __pyx_obj_6pyxpdf_4x int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__100) + __Pyx_TraceFrameInit(__pyx_codeobj__101) __Pyx_RefNannySetupContext("text", 0); - __Pyx_TraceCall("text", __pyx_f[6], 792, 0, __PYX_ERR(6, 792, __pyx_L1_error)); + __Pyx_TraceCall("text", __pyx_f[6], 802, 0, __PYX_ERR(6, 802, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":826 + /* "src/pyxpdf/document.pxi":836 * * """ * return self.text_bytes(page_area, control).decode('UTF-8', errors='ignore') # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(826,0,__PYX_ERR(6, 826, __pyx_L1_error)) + __Pyx_TraceLine(836,0,__PYX_ERR(6, 836, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_text_bytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 826, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_text_bytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -30521,7 +30745,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_13text(struct __pyx_obj_6pyxpdf_4x #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_page_area, __pyx_v_control}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 826, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 836, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -30529,13 +30753,13 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_13text(struct __pyx_obj_6pyxpdf_4x #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_page_area, __pyx_v_control}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 826, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 836, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 826, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; @@ -30546,18 +30770,18 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_13text(struct __pyx_obj_6pyxpdf_4x __Pyx_INCREF(__pyx_v_control); __Pyx_GIVEREF(__pyx_v_control); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_control); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 826, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_decode); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 826, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_decode); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 826, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_errors, __pyx_n_u_ignore) < 0) __PYX_ERR(6, 826, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 826, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_errors, __pyx_n_u_ignore) < 0) __PYX_ERR(6, 836, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -30565,7 +30789,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_13text(struct __pyx_obj_6pyxpdf_4x __pyx_t_5 = 0; goto __pyx_L0; - /* "src/pyxpdf/document.pxi":792 + /* "src/pyxpdf/document.pxi":802 * * * def text(self, page_area=None, control=None): # <<<<<<<<<<<<<< @@ -30588,7 +30812,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_13text(struct __pyx_obj_6pyxpdf_4x return __pyx_r; } -/* "src/pyxpdf/document.pxi":497 +/* "src/pyxpdf/document.pxi":507 * cdef c_Page *page * cdef unique_ptr[TextPage] textpage * cdef readonly int index # <<<<<<<<<<<<<< @@ -30618,9 +30842,9 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_5index___get__(struct __pyx_obj_6p const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[6], 497, 0, __PYX_ERR(6, 497, __pyx_L1_error)); + __Pyx_TraceCall("__get__", __pyx_f[6], 507, 0, __PYX_ERR(6, 507, __pyx_L1_error)); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->index); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 497, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->index); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -30638,7 +30862,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_5index___get__(struct __pyx_obj_6p return __pyx_r; } -/* "src/pyxpdf/document.pxi":498 +/* "src/pyxpdf/document.pxi":508 * cdef unique_ptr[TextPage] textpage * cdef readonly int index * cdef readonly object label # <<<<<<<<<<<<<< @@ -30667,7 +30891,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_5label___get__(struct __pyx_obj_6p const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[6], 498, 0, __PYX_ERR(6, 498, __pyx_L1_error)); + __Pyx_TraceCall("__get__", __pyx_f[6], 508, 0, __PYX_ERR(6, 508, __pyx_L1_error)); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->label); __pyx_r = __pyx_v_self->label; @@ -30684,7 +30908,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_5label___get__(struct __pyx_obj_6p return __pyx_r; } -/* "src/pyxpdf/document.pxi":499 +/* "src/pyxpdf/document.pxi":509 * cdef readonly int index * cdef readonly object label * cdef readonly Document doc # <<<<<<<<<<<<<< @@ -30713,7 +30937,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_3doc___get__(struct __pyx_obj_6pyx const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[6], 499, 0, __PYX_ERR(6, 499, __pyx_L1_error)); + __Pyx_TraceCall("__get__", __pyx_f[6], 509, 0, __PYX_ERR(6, 509, __pyx_L1_error)); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self->doc)); __pyx_r = ((PyObject *)__pyx_v_self->doc); @@ -30759,7 +30983,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_15__reduce_cython__(CYTHON_UNUSED int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__101) + __Pyx_TraceFrameInit(__pyx_codeobj__102) __Pyx_RefNannySetupContext("__reduce_cython__", 0); __Pyx_TraceCall("__reduce_cython__", __pyx_f[7], 1, 0, __PYX_ERR(7, 1, __pyx_L1_error)); @@ -30770,7 +30994,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_15__reduce_cython__(CYTHON_UNUSED * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __Pyx_TraceLine(2,0,__PYX_ERR(7, 2, __pyx_L1_error)) - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__102, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 2, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__103, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -30823,7 +31047,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_17__setstate_cython__(CYTHON_UNUSE int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__103) + __Pyx_TraceFrameInit(__pyx_codeobj__104) __Pyx_RefNannySetupContext("__setstate_cython__", 0); __Pyx_TraceCall("__setstate_cython__", __pyx_f[7], 3, 0, __PYX_ERR(7, 3, __pyx_L1_error)); @@ -30833,7 +31057,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_17__setstate_cython__(CYTHON_UNUSE * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __Pyx_TraceLine(4,0,__PYX_ERR(7, 4, __pyx_L1_error)) - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__104, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 4, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__105, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -30857,7 +31081,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4Page_17__setstate_cython__(CYTHON_UNUSE return __pyx_r; } -/* "src/pyxpdf/document.pxi":861 +/* "src/pyxpdf/document.pxi":871 * dict kwargs * * def __init__(self, output, **kwargs): # <<<<<<<<<<<<<< @@ -30897,7 +31121,7 @@ static int __pyx_pw_6pyxpdf_4xpdf_13page_iterator_1__init__(PyObject *__pyx_v_se else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "__init__") < 0)) __PYX_ERR(6, 861, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "__init__") < 0)) __PYX_ERR(6, 871, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -30908,7 +31132,7 @@ static int __pyx_pw_6pyxpdf_4xpdf_13page_iterator_1__init__(PyObject *__pyx_v_se } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 861, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 871, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("pyxpdf.xpdf.page_iterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -30931,47 +31155,47 @@ static int __pyx_pf_6pyxpdf_4xpdf_13page_iterator___init__(struct __pyx_obj_6pyx const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - __Pyx_TraceCall("__init__", __pyx_f[6], 861, 0, __PYX_ERR(6, 861, __pyx_L1_error)); + __Pyx_TraceCall("__init__", __pyx_f[6], 871, 0, __PYX_ERR(6, 871, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":862 + /* "src/pyxpdf/document.pxi":872 * * def __init__(self, output, **kwargs): * self.output = output # <<<<<<<<<<<<<< * self.index = -1 * self.kwargs = kwargs */ - __Pyx_TraceLine(862,0,__PYX_ERR(6, 862, __pyx_L1_error)) + __Pyx_TraceLine(872,0,__PYX_ERR(6, 872, __pyx_L1_error)) __Pyx_INCREF(__pyx_v_output); __Pyx_GIVEREF(__pyx_v_output); __Pyx_GOTREF(__pyx_v_self->output); __Pyx_DECREF(__pyx_v_self->output); __pyx_v_self->output = __pyx_v_output; - /* "src/pyxpdf/document.pxi":863 + /* "src/pyxpdf/document.pxi":873 * def __init__(self, output, **kwargs): * self.output = output * self.index = -1 # <<<<<<<<<<<<<< * self.kwargs = kwargs * */ - __Pyx_TraceLine(863,0,__PYX_ERR(6, 863, __pyx_L1_error)) + __Pyx_TraceLine(873,0,__PYX_ERR(6, 873, __pyx_L1_error)) __pyx_v_self->index = -1; - /* "src/pyxpdf/document.pxi":864 + /* "src/pyxpdf/document.pxi":874 * self.output = output * self.index = -1 * self.kwargs = kwargs # <<<<<<<<<<<<<< * * def __iter__(self): */ - __Pyx_TraceLine(864,0,__PYX_ERR(6, 864, __pyx_L1_error)) + __Pyx_TraceLine(874,0,__PYX_ERR(6, 874, __pyx_L1_error)) __Pyx_INCREF(__pyx_v_kwargs); __Pyx_GIVEREF(__pyx_v_kwargs); __Pyx_GOTREF(__pyx_v_self->kwargs); __Pyx_DECREF(__pyx_v_self->kwargs); __pyx_v_self->kwargs = __pyx_v_kwargs; - /* "src/pyxpdf/document.pxi":861 + /* "src/pyxpdf/document.pxi":871 * dict kwargs * * def __init__(self, output, **kwargs): # <<<<<<<<<<<<<< @@ -30991,7 +31215,7 @@ static int __pyx_pf_6pyxpdf_4xpdf_13page_iterator___init__(struct __pyx_obj_6pyx return __pyx_r; } -/* "src/pyxpdf/document.pxi":866 +/* "src/pyxpdf/document.pxi":876 * self.kwargs = kwargs * * def __iter__(self): # <<<<<<<<<<<<<< @@ -31020,22 +31244,22 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_13page_iterator_2__iter__(struct __pyx_o const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__iter__", 0); - __Pyx_TraceCall("__iter__", __pyx_f[6], 866, 0, __PYX_ERR(6, 866, __pyx_L1_error)); + __Pyx_TraceCall("__iter__", __pyx_f[6], 876, 0, __PYX_ERR(6, 876, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":867 + /* "src/pyxpdf/document.pxi":877 * * def __iter__(self): * return self # <<<<<<<<<<<<<< * * def __next__(self): */ - __Pyx_TraceLine(867,0,__PYX_ERR(6, 867, __pyx_L1_error)) + __Pyx_TraceLine(877,0,__PYX_ERR(6, 877, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; - /* "src/pyxpdf/document.pxi":866 + /* "src/pyxpdf/document.pxi":876 * self.kwargs = kwargs * * def __iter__(self): # <<<<<<<<<<<<<< @@ -31054,7 +31278,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_13page_iterator_2__iter__(struct __pyx_o return __pyx_r; } -/* "src/pyxpdf/document.pxi":869 +/* "src/pyxpdf/document.pxi":879 * return self * * def __next__(self): # <<<<<<<<<<<<<< @@ -31088,48 +31312,48 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_13page_iterator_4__next__(struct __pyx_o const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__next__", 0); - __Pyx_TraceCall("__next__", __pyx_f[6], 869, 0, __PYX_ERR(6, 869, __pyx_L1_error)); + __Pyx_TraceCall("__next__", __pyx_f[6], 879, 0, __PYX_ERR(6, 879, __pyx_L1_error)); - /* "src/pyxpdf/document.pxi":870 + /* "src/pyxpdf/document.pxi":880 * * def __next__(self): * self.index += 1 # <<<<<<<<<<<<<< * if self.index >= len(self.output.doc): * raise StopIteration() */ - __Pyx_TraceLine(870,0,__PYX_ERR(6, 870, __pyx_L1_error)) + __Pyx_TraceLine(880,0,__PYX_ERR(6, 880, __pyx_L1_error)) __pyx_v_self->index = (__pyx_v_self->index + 1); - /* "src/pyxpdf/document.pxi":871 + /* "src/pyxpdf/document.pxi":881 * def __next__(self): * self.index += 1 * if self.index >= len(self.output.doc): # <<<<<<<<<<<<<< * raise StopIteration() * return self.output.get(self.index, **self.kwargs) */ - __Pyx_TraceLine(871,0,__PYX_ERR(6, 871, __pyx_L1_error)) - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->output, __pyx_n_s_doc); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 871, __pyx_L1_error) + __Pyx_TraceLine(881,0,__PYX_ERR(6, 881, __pyx_L1_error)) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->output, __pyx_n_s_doc); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(6, 871, __pyx_L1_error) + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(6, 881, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((__pyx_v_self->index >= __pyx_t_2) != 0); if (unlikely(__pyx_t_3)) { - /* "src/pyxpdf/document.pxi":872 + /* "src/pyxpdf/document.pxi":882 * self.index += 1 * if self.index >= len(self.output.doc): * raise StopIteration() # <<<<<<<<<<<<<< * return self.output.get(self.index, **self.kwargs) * */ - __Pyx_TraceLine(872,0,__PYX_ERR(6, 872, __pyx_L1_error)) - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_StopIteration); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 872, __pyx_L1_error) + __Pyx_TraceLine(882,0,__PYX_ERR(6, 882, __pyx_L1_error)) + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_StopIteration); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(6, 872, __pyx_L1_error) + __PYX_ERR(6, 882, __pyx_L1_error) - /* "src/pyxpdf/document.pxi":871 + /* "src/pyxpdf/document.pxi":881 * def __next__(self): * self.index += 1 * if self.index >= len(self.output.doc): # <<<<<<<<<<<<<< @@ -31138,29 +31362,29 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_13page_iterator_4__next__(struct __pyx_o */ } - /* "src/pyxpdf/document.pxi":873 + /* "src/pyxpdf/document.pxi":883 * if self.index >= len(self.output.doc): * raise StopIteration() * return self.output.get(self.index, **self.kwargs) # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(873,0,__PYX_ERR(6, 873, __pyx_L1_error)) + __Pyx_TraceLine(883,0,__PYX_ERR(6, 883, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->output, __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 873, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->output, __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 883, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->index); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 873, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->index); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 883, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 873, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 883, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_v_self->kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(6, 873, __pyx_L1_error) + __PYX_ERR(6, 883, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_v_self->kwargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 873, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_v_self->kwargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 883, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -31168,7 +31392,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_13page_iterator_4__next__(struct __pyx_o __pyx_t_4 = 0; goto __pyx_L0; - /* "src/pyxpdf/document.pxi":869 + /* "src/pyxpdf/document.pxi":879 * return self * * def __next__(self): # <<<<<<<<<<<<<< @@ -31227,7 +31451,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_13page_iterator_6__reduce_cython__(struc int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__105) + __Pyx_TraceFrameInit(__pyx_codeobj__106) __Pyx_RefNannySetupContext("__reduce_cython__", 0); __Pyx_TraceCall("__reduce_cython__", __pyx_f[7], 1, 0, __PYX_ERR(7, 1, __pyx_L1_error)); @@ -31488,7 +31712,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_13page_iterator_8__setstate_cython__(str int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__106) + __Pyx_TraceFrameInit(__pyx_codeobj__107) __Pyx_RefNannySetupContext("__setstate_cython__", 0); __Pyx_TraceCall("__setstate_cython__", __pyx_f[7], 16, 0, __PYX_ERR(7, 16, __pyx_L1_error)); @@ -31622,7 +31846,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_2__pyx_unpickle_PDFError(CYTHON_UNUSED P int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__107) + __Pyx_TraceFrameInit(__pyx_codeobj__108) __Pyx_RefNannySetupContext("__pyx_unpickle_PDFError", 0); __Pyx_TraceCall("__pyx_unpickle_PDFError", __pyx_f[7], 1, 0, __PYX_ERR(7, 1, __pyx_L1_error)); @@ -32017,7 +32241,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_4__pyx_unpickle_XPDFError(CYTHON_UNUSED int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__108) + __Pyx_TraceFrameInit(__pyx_codeobj__109) __Pyx_RefNannySetupContext("__pyx_unpickle_XPDFError", 0); __Pyx_TraceCall("__pyx_unpickle_XPDFError", __pyx_f[7], 1, 0, __PYX_ERR(7, 1, __pyx_L1_error)); @@ -32412,7 +32636,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_6__pyx_unpickle_PDFSyntaxError(CYTHON_UN int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__109) + __Pyx_TraceFrameInit(__pyx_codeobj__110) __Pyx_RefNannySetupContext("__pyx_unpickle_PDFSyntaxError", 0); __Pyx_TraceCall("__pyx_unpickle_PDFSyntaxError", __pyx_f[7], 1, 0, __PYX_ERR(7, 1, __pyx_L1_error)); @@ -32807,7 +33031,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_8__pyx_unpickle_XPDFConfigError(CYTHON_U int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__110) + __Pyx_TraceFrameInit(__pyx_codeobj__111) __Pyx_RefNannySetupContext("__pyx_unpickle_XPDFConfigError", 0); __Pyx_TraceCall("__pyx_unpickle_XPDFConfigError", __pyx_f[7], 1, 0, __PYX_ERR(7, 1, __pyx_L1_error)); @@ -33202,7 +33426,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_10__pyx_unpickle_PDFIOError(CYTHON_UNUSE int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__111) + __Pyx_TraceFrameInit(__pyx_codeobj__112) __Pyx_RefNannySetupContext("__pyx_unpickle_PDFIOError", 0); __Pyx_TraceCall("__pyx_unpickle_PDFIOError", __pyx_f[7], 1, 0, __PYX_ERR(7, 1, __pyx_L1_error)); @@ -33597,7 +33821,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_12__pyx_unpickle_PDFPermissionError(CYTH int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__112) + __Pyx_TraceFrameInit(__pyx_codeobj__113) __Pyx_RefNannySetupContext("__pyx_unpickle_PDFPermissionError", 0); __Pyx_TraceCall("__pyx_unpickle_PDFPermissionError", __pyx_f[7], 1, 0, __PYX_ERR(7, 1, __pyx_L1_error)); @@ -33992,7 +34216,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_14__pyx_unpickle_XPDFInternalError(CYTHO int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__113) + __Pyx_TraceFrameInit(__pyx_codeobj__114) __Pyx_RefNannySetupContext("__pyx_unpickle_XPDFInternalError", 0); __Pyx_TraceCall("__pyx_unpickle_XPDFInternalError", __pyx_f[7], 1, 0, __PYX_ERR(7, 1, __pyx_L1_error)); @@ -34387,7 +34611,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_16__pyx_unpickle_XPDFNotInplementedError int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__114) + __Pyx_TraceFrameInit(__pyx_codeobj__115) __Pyx_RefNannySetupContext("__pyx_unpickle_XPDFNotInplementedError", 0); __Pyx_TraceCall("__pyx_unpickle_XPDFNotInplementedError", __pyx_f[7], 1, 0, __PYX_ERR(7, 1, __pyx_L1_error)); @@ -34782,7 +35006,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_18__pyx_unpickle_PDFOutputDevice(CYTHON_ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__115) + __Pyx_TraceFrameInit(__pyx_codeobj__116) __Pyx_RefNannySetupContext("__pyx_unpickle_PDFOutputDevice", 0); __Pyx_TraceCall("__pyx_unpickle_PDFOutputDevice", __pyx_f[7], 1, 0, __PYX_ERR(7, 1, __pyx_L1_error)); @@ -35177,7 +35401,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_20__pyx_unpickle_RawImageControl(CYTHON_ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__116) + __Pyx_TraceFrameInit(__pyx_codeobj__117) __Pyx_RefNannySetupContext("__pyx_unpickle_RawImageControl", 0); __Pyx_TraceCall("__pyx_unpickle_RawImageControl", __pyx_f[7], 1, 0, __PYX_ERR(7, 1, __pyx_L1_error)); @@ -35572,7 +35796,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_22__pyx_unpickle_PDFImage(CYTHON_UNUSED int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__117) + __Pyx_TraceFrameInit(__pyx_codeobj__118) __Pyx_RefNannySetupContext("__pyx_unpickle_PDFImage", 0); __Pyx_TraceCall("__pyx_unpickle_PDFImage", __pyx_f[7], 1, 0, __PYX_ERR(7, 1, __pyx_L1_error)); @@ -36097,7 +36321,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_24__pyx_unpickle_DocumentPageIterator(CY int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__118) + __Pyx_TraceFrameInit(__pyx_codeobj__119) __Pyx_RefNannySetupContext("__pyx_unpickle_DocumentPageIterator", 0); __Pyx_TraceCall("__pyx_unpickle_DocumentPageIterator", __pyx_f[7], 1, 0, __PYX_ERR(7, 1, __pyx_L1_error)); @@ -36523,7 +36747,7 @@ static PyObject *__pyx_pf_6pyxpdf_4xpdf_26__pyx_unpickle_page_iterator(CYTHON_UN int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__119) + __Pyx_TraceFrameInit(__pyx_codeobj__120) __Pyx_RefNannySetupContext("__pyx_unpickle_page_iterator", 0); __Pyx_TraceCall("__pyx_unpickle_page_iterator", __pyx_f[7], 1, 0, __PYX_ERR(7, 1, __pyx_L1_error)); @@ -37857,9 +38081,9 @@ static void __pyx_tp_dealloc_6pyxpdf_4xpdf__GlobalParamsConfig(PyObject *o) { { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); - ++Py_REFCNT(o); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_6pyxpdf_4xpdf_19_GlobalParamsConfig_7__dealloc__(o); - --Py_REFCNT(o); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } Py_CLEAR(p->cfg_path); @@ -38058,6 +38282,19 @@ static PyObject *__pyx_getprop_6pyxpdf_4xpdf_19_GlobalParamsConfig_default_text_ return __pyx_pw_6pyxpdf_4xpdf_19_GlobalParamsConfig_21default_text_encoding_1__get__(o); } +static PyObject *__pyx_getprop_6pyxpdf_4xpdf_19_GlobalParamsConfig_cfg_path(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pyxpdf_4xpdf_19_GlobalParamsConfig_8cfg_path_1__get__(o); +} + +static int __pyx_setprop_6pyxpdf_4xpdf_19_GlobalParamsConfig_cfg_path(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pyxpdf_4xpdf_19_GlobalParamsConfig_8cfg_path_3__set__(o, v); + } + else { + return __pyx_pw_6pyxpdf_4xpdf_19_GlobalParamsConfig_8cfg_path_5__del__(o); + } +} + static PyObject *__pyx_getprop_6pyxpdf_4xpdf_19_GlobalParamsConfig___doc__(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_6pyxpdf_4xpdf_19_GlobalParamsConfig_7__doc___1__get__(o); } @@ -38096,6 +38333,7 @@ static struct PyGetSetDef __pyx_getsets_6pyxpdf_4xpdf__GlobalParamsConfig[] = { {(char *)"print_commands", __pyx_getprop_6pyxpdf_4xpdf_19_GlobalParamsConfig_print_commands, __pyx_setprop_6pyxpdf_4xpdf_19_GlobalParamsConfig_print_commands, (char *)0, 0}, {(char *)"error_quiet", __pyx_getprop_6pyxpdf_4xpdf_19_GlobalParamsConfig_error_quiet, __pyx_setprop_6pyxpdf_4xpdf_19_GlobalParamsConfig_error_quiet, (char *)0, 0}, {(char *)"default_text_encoding", __pyx_getprop_6pyxpdf_4xpdf_19_GlobalParamsConfig_default_text_encoding, 0, (char *)0, 0}, + {(char *)"cfg_path", __pyx_getprop_6pyxpdf_4xpdf_19_GlobalParamsConfig_cfg_path, __pyx_setprop_6pyxpdf_4xpdf_19_GlobalParamsConfig_cfg_path, (char *)"cfg_path: object", 0}, {(char *)"__doc__", __pyx_getprop_6pyxpdf_4xpdf_19_GlobalParamsConfig___doc__, __pyx_setprop_6pyxpdf_4xpdf_19_GlobalParamsConfig___doc__, (char *)"__doc__: object", 0}, {0, 0, 0, 0, 0} }; @@ -39195,9 +39433,9 @@ static void __pyx_tp_dealloc_6pyxpdf_4xpdf_Document(PyObject *o) { { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); - ++Py_REFCNT(o); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_6pyxpdf_4xpdf_8Document_5__dealloc__(o); - --Py_REFCNT(o); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } Py_CLEAR(p->doc_data); @@ -40112,6 +40350,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_u_Page_index_must_be_positive_inte, __pyx_k_Page_index_must_be_positive_inte, sizeof(__pyx_k_Page_index_must_be_positive_inte), 0, 1, 0, 0}, {&__pyx_n_s_Page_text, __pyx_k_Page_text, sizeof(__pyx_k_Page_text), 0, 0, 1, 1}, {&__pyx_n_s_Page_text_bytes, __pyx_k_Page_text_bytes, sizeof(__pyx_k_Page_text_bytes), 0, 0, 1, 1}, + {&__pyx_n_s_Path, __pyx_k_Path, sizeof(__pyx_k_Path), 0, 0, 1, 1}, {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1}, {&__pyx_kp_u_Pillow_is_not_installed_Please, __pyx_k_Pillow_is_not_installed_Please, sizeof(__pyx_k_Pillow_is_not_installed_Please), 0, 1, 0, 0}, {&__pyx_n_u_RGB, __pyx_k_RGB, sizeof(__pyx_k_RGB), 0, 1, 0, 1}, @@ -40143,6 +40382,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_u_UTF_8, __pyx_k_UTF_8, sizeof(__pyx_k_UTF_8), 0, 1, 0, 0}, {&__pyx_kp_u_Uncaught_error_in_xpdf_library, __pyx_k_Uncaught_error_in_xpdf_library, sizeof(__pyx_k_Uncaught_error_in_xpdf_library), 0, 1, 0, 0}, {&__pyx_kp_u_Unknown_layout, __pyx_k_Unknown_layout, sizeof(__pyx_k_Unknown_layout), 0, 1, 0, 0}, + {&__pyx_kp_u_Unsupported_Bitmap_SplashColorMo, __pyx_k_Unsupported_Bitmap_SplashColorMo, sizeof(__pyx_k_Unsupported_Bitmap_SplashColorMo), 0, 1, 0, 0}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_n_s_XPDFConfigError, __pyx_k_XPDFConfigError, sizeof(__pyx_k_XPDFConfigError), 0, 0, 1, 1}, {&__pyx_n_u_XPDFConfigError, __pyx_k_XPDFConfigError, sizeof(__pyx_k_XPDFConfigError), 0, 1, 0, 1}, @@ -40163,7 +40403,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_u__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0, 0}, {&__pyx_kp_u__44, __pyx_k__44, sizeof(__pyx_k__44), 0, 1, 0, 0}, {&__pyx_kp_u__52, __pyx_k__52, sizeof(__pyx_k__52), 0, 1, 0, 0}, - {&__pyx_kp_u__65, __pyx_k__65, sizeof(__pyx_k__65), 0, 1, 0, 0}, + {&__pyx_kp_u__66, __pyx_k__66, sizeof(__pyx_k__66), 0, 1, 0, 0}, {&__pyx_n_s_add_font_file, __pyx_k_add_font_file, sizeof(__pyx_k_add_font_file), 0, 0, 1, 1}, {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, {&__pyx_n_s_anti_alias, __pyx_k_anti_alias, sizeof(__pyx_k_anti_alias), 0, 0, 1, 1}, @@ -40242,6 +40482,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_u_lineprinter, __pyx_k_lineprinter, sizeof(__pyx_k_lineprinter), 0, 1, 0, 1}, {&__pyx_n_s_load_file, __pyx_k_load_file, sizeof(__pyx_k_load_file), 0, 0, 1, 1}, {&__pyx_n_s_loader, __pyx_k_loader, sizeof(__pyx_k_loader), 0, 0, 1, 1}, + {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1}, {&__pyx_n_u_lzw, __pyx_k_lzw, sizeof(__pyx_k_lzw), 0, 1, 0, 1}, {&__pyx_n_u_mac, __pyx_k_mac, sizeof(__pyx_k_mac), 0, 1, 0, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, @@ -40273,6 +40514,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_pages, __pyx_k_pages, sizeof(__pyx_k_pages), 0, 0, 1, 1}, {&__pyx_n_s_paper_color, __pyx_k_paper_color, sizeof(__pyx_k_paper_color), 0, 0, 1, 1}, {&__pyx_kp_u_paper_color_must_be_3_RGB_or_4, __pyx_k_paper_color_must_be_3_RGB_or_4, sizeof(__pyx_k_paper_color_must_be_3_RGB_or_4), 0, 1, 0, 0}, + {&__pyx_n_s_pathlib, __pyx_k_pathlib, sizeof(__pyx_k_pathlib), 0, 0, 1, 1}, {&__pyx_n_s_pdf, __pyx_k_pdf, sizeof(__pyx_k_pdf), 0, 0, 1, 1}, {&__pyx_kp_u_pdf_argument_must_be_a_string_or, __pyx_k_pdf_argument_must_be_a_string_or, sizeof(__pyx_k_pdf_argument_must_be_a_string_or), 0, 1, 0, 0}, {&__pyx_n_s_pdf_file, __pyx_k_pdf_file, sizeof(__pyx_k_pdf_file), 0, 0, 1, 1}, @@ -40375,9 +40617,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(3, 46, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(4, 65, __pyx_L1_error) __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(5, 11, __pyx_L1_error) - __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(6, 134, __pyx_L1_error) - __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(6, 225, __pyx_L1_error) - __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(6, 440, __pyx_L1_error) + __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(6, 140, __pyx_L1_error) + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(6, 235, __pyx_L1_error) + __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(6, 450, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -40584,79 +40826,90 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__63); __Pyx_GIVEREF(__pyx_tuple__63); - /* "src/pyxpdf/imageoutput.pxi":598 + /* "src/pyxpdf/imageoutput.pxi":596 * img.image_type = "smask" * else: * raise ValueError(f"unexpected value of imgType") # <<<<<<<<<<<<<< * * bmap = c_img.bitmap.get() */ - __pyx_tuple__64 = PyTuple_Pack(1, __pyx_kp_u_unexpected_value_of_imgType); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(9, 598, __pyx_L1_error) + __pyx_tuple__64 = PyTuple_Pack(1, __pyx_kp_u_unexpected_value_of_imgType); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(9, 596, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__64); __Pyx_GIVEREF(__pyx_tuple__64); + /* "src/pyxpdf/imageoutput.pxi":606 + * mode = "RGB" + * else: + * raise XPDFInternalError(f"Unsupported Bitmap SplashColorMode.") # <<<<<<<<<<<<<< + * buff = splash_bitmap_to_buffer(bmap, mode) + * img.image = pillow_image_from_buffer(mode, bmap.getHeight(), bmap.getWidth(), buff) + */ + __pyx_tuple__65 = PyTuple_Pack(1, __pyx_kp_u_Unsupported_Bitmap_SplashColorMo); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(9, 606, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__65); + __Pyx_GIVEREF(__pyx_tuple__65); + /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - __pyx_tuple__70 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(7, 2, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__70); - __Pyx_GIVEREF(__pyx_tuple__70); + __pyx_tuple__71 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(7, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__71); + __Pyx_GIVEREF(__pyx_tuple__71); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ - __pyx_tuple__72 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(7, 4, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__72); - __Pyx_GIVEREF(__pyx_tuple__72); + __pyx_tuple__73 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(7, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__73); + __Pyx_GIVEREF(__pyx_tuple__73); - /* "src/pyxpdf/document.pxi":105 + /* "src/pyxpdf/document.pxi":111 * self._load_from_char_array(self.doc_data, len(self.doc_data)) * else: * raise ValueError(f"pdf argument must be a string or a file-like object.") # <<<<<<<<<<<<<< * * # check PDFDoc */ - __pyx_tuple__73 = PyTuple_Pack(1, __pyx_kp_u_pdf_argument_must_be_a_string_or); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(6, 105, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__73); - __Pyx_GIVEREF(__pyx_tuple__73); + __pyx_tuple__74 = PyTuple_Pack(1, __pyx_kp_u_pdf_argument_must_be_a_string_or); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(6, 111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__74); + __Pyx_GIVEREF(__pyx_tuple__74); - /* "src/pyxpdf/document.pxi":146 + /* "src/pyxpdf/document.pxi":152 * return [self[i] for i in range(*key.indices(self.num_pages))] * else: * raise TypeError("Invalid Key type") # <<<<<<<<<<<<<< * * def __iter__(self): */ - __pyx_tuple__74 = PyTuple_Pack(1, __pyx_kp_u_Invalid_Key_type); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(6, 146, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__74); - __Pyx_GIVEREF(__pyx_tuple__74); + __pyx_tuple__75 = PyTuple_Pack(1, __pyx_kp_u_Invalid_Key_type); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(6, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__75); + __Pyx_GIVEREF(__pyx_tuple__75); - /* "src/pyxpdf/document.pxi":185 + /* "src/pyxpdf/document.pxi":195 * self.doc = new PDFDoc(pdf, self.ownerpass, self.userpass) * if self.doc == NULL: * raise MemoryError("Cannot allocate memory for internal objects") # <<<<<<<<<<<<<< * * cdef _load_from_char_array(self, char *pdf, int data_length): */ - __pyx_tuple__78 = PyTuple_Pack(1, __pyx_kp_u_Cannot_allocate_memory_for_inter); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(6, 185, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__78); - __Pyx_GIVEREF(__pyx_tuple__78); + __pyx_tuple__79 = PyTuple_Pack(1, __pyx_kp_u_Cannot_allocate_memory_for_inter); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(6, 195, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__79); + __Pyx_GIVEREF(__pyx_tuple__79); - /* "src/pyxpdf/document.pxi":204 + /* "src/pyxpdf/document.pxi":214 * if self.doc.isOk() == gTrue or self.doc.getErrorCode() == errEncrypted: * if self.doc.getErrorCode() == errEncrypted: * raise PDFPermissionError("PDF cannot be decrypted please provide correct passwords.") # <<<<<<<<<<<<<< * elif self.doc.getErrorCode() == errOpenFile: * raise PDFIOError(f"Failed to load {self.filename}") */ - __pyx_tuple__79 = PyTuple_Pack(1, __pyx_kp_u_PDF_cannot_be_decrypted_please_p); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(6, 204, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__79); - __Pyx_GIVEREF(__pyx_tuple__79); + __pyx_tuple__80 = PyTuple_Pack(1, __pyx_kp_u_PDF_cannot_be_decrypted_please_p); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(6, 214, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__80); + __Pyx_GIVEREF(__pyx_tuple__80); /* "(tree fragment)":2 * def __reduce_cython__(self): @@ -40664,29 +40917,29 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - __pyx_tuple__85 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(7, 2, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__85); - __Pyx_GIVEREF(__pyx_tuple__85); + __pyx_tuple__86 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(7, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__86); + __Pyx_GIVEREF(__pyx_tuple__86); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ - __pyx_tuple__87 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(7, 4, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__87); - __Pyx_GIVEREF(__pyx_tuple__87); + __pyx_tuple__88 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(7, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__88); + __Pyx_GIVEREF(__pyx_tuple__88); - /* "src/pyxpdf/document.pxi":508 + /* "src/pyxpdf/document.pxi":518 * def __cinit__(self, Document doc not None, int index): * if index < 0 or index >= doc.num_pages: * raise IndexError("Page index must be positive integer less than total pages") # <<<<<<<<<<<<<< * self.page = doc.get_catalog().getPage(index + 1) * # self.textpage.reset() */ - __pyx_tuple__90 = PyTuple_Pack(1, __pyx_kp_u_Page_index_must_be_positive_inte); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(6, 508, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__90); - __Pyx_GIVEREF(__pyx_tuple__90); + __pyx_tuple__91 = PyTuple_Pack(1, __pyx_kp_u_Page_index_must_be_positive_inte); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(6, 518, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__91); + __Pyx_GIVEREF(__pyx_tuple__91); /* "(tree fragment)":2 * def __reduce_cython__(self): @@ -40694,18 +40947,18 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - __pyx_tuple__102 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__102)) __PYX_ERR(7, 2, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__102); - __Pyx_GIVEREF(__pyx_tuple__102); + __pyx_tuple__103 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(7, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__103); + __Pyx_GIVEREF(__pyx_tuple__103); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ - __pyx_tuple__104 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(7, 4, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__104); - __Pyx_GIVEREF(__pyx_tuple__104); + __pyx_tuple__105 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(7, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__105); + __Pyx_GIVEREF(__pyx_tuple__105); /* "pyxpdf/xpdf.pyx":46 * # load optional dependencies @@ -40714,19 +40967,19 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * cdef dict available_deps = dict() * */ - __pyx_tuple__120 = PyTuple_Pack(2, __pyx_n_u_pyxpdf_data, __pyx_kp_u_PIL_Image); if (unlikely(!__pyx_tuple__120)) __PYX_ERR(0, 46, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__120); - __Pyx_GIVEREF(__pyx_tuple__120); + __pyx_tuple__121 = PyTuple_Pack(2, __pyx_n_u_pyxpdf_data, __pyx_kp_u_PIL_Image); if (unlikely(!__pyx_tuple__121)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__121); + __Pyx_GIVEREF(__pyx_tuple__121); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ - __pyx_tuple__121 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__121)) __PYX_ERR(7, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__121); - __Pyx_GIVEREF(__pyx_tuple__121); - __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__121, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_tuple__122 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__122)) __PYX_ERR(7, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__122); + __Pyx_GIVEREF(__pyx_tuple__122); + __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__122, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(7, 1, __pyx_L1_error) /* "(tree fragment)":16 * else: @@ -40734,20 +40987,20 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_PDFError__set_state(self, __pyx_state) */ - __pyx_tuple__122 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__122)) __PYX_ERR(7, 16, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__122); - __Pyx_GIVEREF(__pyx_tuple__122); - __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__122, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(7, 16, __pyx_L1_error) + __pyx_tuple__123 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__123)) __PYX_ERR(7, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__123); + __Pyx_GIVEREF(__pyx_tuple__123); + __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__123, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(7, 16, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ - __pyx_tuple__123 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__123)) __PYX_ERR(7, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__123); - __Pyx_GIVEREF(__pyx_tuple__123); - __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__123, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_tuple__124 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(7, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__124); + __Pyx_GIVEREF(__pyx_tuple__124); + __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__124, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(7, 1, __pyx_L1_error) /* "(tree fragment)":16 * else: @@ -40755,20 +41008,20 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_XPDFError__set_state(self, __pyx_state) */ - __pyx_tuple__124 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(7, 16, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__124); - __Pyx_GIVEREF(__pyx_tuple__124); - __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__124, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(7, 16, __pyx_L1_error) + __pyx_tuple__125 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__125)) __PYX_ERR(7, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__125); + __Pyx_GIVEREF(__pyx_tuple__125); + __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__125, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(7, 16, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ - __pyx_tuple__125 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__125)) __PYX_ERR(7, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__125); - __Pyx_GIVEREF(__pyx_tuple__125); - __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__125, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_tuple__126 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__126)) __PYX_ERR(7, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__126); + __Pyx_GIVEREF(__pyx_tuple__126); + __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__126, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(7, 1, __pyx_L1_error) /* "(tree fragment)":16 * else: @@ -40776,20 +41029,20 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_PDFSyntaxError__set_state(self, __pyx_state) */ - __pyx_tuple__126 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__126)) __PYX_ERR(7, 16, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__126); - __Pyx_GIVEREF(__pyx_tuple__126); - __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__126, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(7, 16, __pyx_L1_error) + __pyx_tuple__127 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__127)) __PYX_ERR(7, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__127); + __Pyx_GIVEREF(__pyx_tuple__127); + __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__127, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(7, 16, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ - __pyx_tuple__127 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__127)) __PYX_ERR(7, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__127); - __Pyx_GIVEREF(__pyx_tuple__127); - __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__127, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_tuple__128 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__128)) __PYX_ERR(7, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__128); + __Pyx_GIVEREF(__pyx_tuple__128); + __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__128, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(7, 1, __pyx_L1_error) /* "(tree fragment)":16 * else: @@ -40797,20 +41050,20 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_XPDFConfigError__set_state(self, __pyx_state) */ - __pyx_tuple__128 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__128)) __PYX_ERR(7, 16, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__128); - __Pyx_GIVEREF(__pyx_tuple__128); - __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__128, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(7, 16, __pyx_L1_error) + __pyx_tuple__129 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__129)) __PYX_ERR(7, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__129); + __Pyx_GIVEREF(__pyx_tuple__129); + __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__129, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(7, 16, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ - __pyx_tuple__129 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__129)) __PYX_ERR(7, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__129); - __Pyx_GIVEREF(__pyx_tuple__129); - __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__129, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_tuple__130 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__130)) __PYX_ERR(7, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__130); + __Pyx_GIVEREF(__pyx_tuple__130); + __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__130, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(7, 1, __pyx_L1_error) /* "(tree fragment)":16 * else: @@ -40818,20 +41071,20 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_PDFIOError__set_state(self, __pyx_state) */ - __pyx_tuple__130 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__130)) __PYX_ERR(7, 16, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__130); - __Pyx_GIVEREF(__pyx_tuple__130); - __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__130, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(7, 16, __pyx_L1_error) + __pyx_tuple__131 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__131)) __PYX_ERR(7, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__131); + __Pyx_GIVEREF(__pyx_tuple__131); + __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__131, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(7, 16, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ - __pyx_tuple__131 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__131)) __PYX_ERR(7, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__131); - __Pyx_GIVEREF(__pyx_tuple__131); - __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__131, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_tuple__132 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__132)) __PYX_ERR(7, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__132); + __Pyx_GIVEREF(__pyx_tuple__132); + __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__132, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(7, 1, __pyx_L1_error) /* "(tree fragment)":16 * else: @@ -40839,20 +41092,20 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_PDFPermissionError__set_state(self, __pyx_state) */ - __pyx_tuple__132 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__132)) __PYX_ERR(7, 16, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__132); - __Pyx_GIVEREF(__pyx_tuple__132); - __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__132, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(7, 16, __pyx_L1_error) + __pyx_tuple__133 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__133)) __PYX_ERR(7, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__133); + __Pyx_GIVEREF(__pyx_tuple__133); + __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__133, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(7, 16, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ - __pyx_tuple__133 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__133)) __PYX_ERR(7, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__133); - __Pyx_GIVEREF(__pyx_tuple__133); - __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__133, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_tuple__134 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__134)) __PYX_ERR(7, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__134); + __Pyx_GIVEREF(__pyx_tuple__134); + __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(7, 1, __pyx_L1_error) /* "(tree fragment)":16 * else: @@ -40860,20 +41113,20 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_XPDFInternalError__set_state(self, __pyx_state) */ - __pyx_tuple__134 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__134)) __PYX_ERR(7, 16, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__134); - __Pyx_GIVEREF(__pyx_tuple__134); - __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(7, 16, __pyx_L1_error) + __pyx_tuple__135 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__135)) __PYX_ERR(7, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__135); + __Pyx_GIVEREF(__pyx_tuple__135); + __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__135, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(7, 16, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ - __pyx_tuple__135 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__135)) __PYX_ERR(7, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__135); - __Pyx_GIVEREF(__pyx_tuple__135); - __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__135, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_tuple__136 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__136)) __PYX_ERR(7, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__136); + __Pyx_GIVEREF(__pyx_tuple__136); + __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__136, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(7, 1, __pyx_L1_error) /* "(tree fragment)":16 * else: @@ -40881,10 +41134,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_XPDFNotInplementedError__set_state(self, __pyx_state) */ - __pyx_tuple__136 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__136)) __PYX_ERR(7, 16, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__136); - __Pyx_GIVEREF(__pyx_tuple__136); - __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__136, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(7, 16, __pyx_L1_error) + __pyx_tuple__137 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__137)) __PYX_ERR(7, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__137); + __Pyx_GIVEREF(__pyx_tuple__137); + __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__137, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(7, 16, __pyx_L1_error) /* "src/pyxpdf/globalconfig.pxi":35 * return cfg @@ -40893,10 +41146,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * global globalParams * if globalParams != NULL: */ - __pyx_tuple__137 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_cfg_path); if (unlikely(!__pyx_tuple__137)) __PYX_ERR(3, 35, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__137); - __Pyx_GIVEREF(__pyx_tuple__137); - __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__137, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pyxpdf_globalconfig_pxi, __pyx_n_s_load_file, 35, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(3, 35, __pyx_L1_error) + __pyx_tuple__138 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_cfg_path); if (unlikely(!__pyx_tuple__138)) __PYX_ERR(3, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__138); + __Pyx_GIVEREF(__pyx_tuple__138); + __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__138, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pyxpdf_globalconfig_pxi, __pyx_n_s_load_file, 35, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(3, 35, __pyx_L1_error) /* "src/pyxpdf/globalconfig.pxi":51 * globalParams = self._global @@ -40905,10 +41158,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * self.load_file(self.cfg_path) * */ - __pyx_tuple__138 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__138)) __PYX_ERR(3, 51, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__138); - __Pyx_GIVEREF(__pyx_tuple__138); - __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__138, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pyxpdf_globalconfig_pxi, __pyx_n_s_reset, 51, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(3, 51, __pyx_L1_error) + __pyx_tuple__139 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__139)) __PYX_ERR(3, 51, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__139); + __Pyx_GIVEREF(__pyx_tuple__139); + __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__139, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pyxpdf_globalconfig_pxi, __pyx_n_s_reset, 51, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(3, 51, __pyx_L1_error) /* "src/pyxpdf/globalconfig.pxi":65 * @@ -40917,10 +41170,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * self._global.setupBaseFonts(_chars(dir)) * */ - __pyx_tuple__139 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_dir); if (unlikely(!__pyx_tuple__139)) __PYX_ERR(3, 65, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__139); - __Pyx_GIVEREF(__pyx_tuple__139); - __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__139, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pyxpdf_globalconfig_pxi, __pyx_n_s_setup_base_fonts, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(3, 65, __pyx_L1_error) + __pyx_tuple__140 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_dir); if (unlikely(!__pyx_tuple__140)) __PYX_ERR(3, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__140); + __Pyx_GIVEREF(__pyx_tuple__140); + __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__140, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pyxpdf_globalconfig_pxi, __pyx_n_s_setup_base_fonts, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(3, 65, __pyx_L1_error) /* "src/pyxpdf/globalconfig.pxi":68 * self._global.setupBaseFonts(_chars(dir)) @@ -40929,10 +41182,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * # GlobalParams free these GStrings in its destructor * self._global.addFontFile(to_GString(font_name), to_GString(file)) */ - __pyx_tuple__140 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_font_name, __pyx_n_s_file); if (unlikely(!__pyx_tuple__140)) __PYX_ERR(3, 68, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__140); - __Pyx_GIVEREF(__pyx_tuple__140); - __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__140, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pyxpdf_globalconfig_pxi, __pyx_n_s_add_font_file, 68, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(3, 68, __pyx_L1_error) + __pyx_tuple__141 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_font_name, __pyx_n_s_file); if (unlikely(!__pyx_tuple__141)) __PYX_ERR(3, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__141); + __Pyx_GIVEREF(__pyx_tuple__141); + __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__141, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pyxpdf_globalconfig_pxi, __pyx_n_s_add_font_file, 68, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(3, 68, __pyx_L1_error) /* "src/pyxpdf/globalconfig.pxi":82 * @@ -40941,20 +41194,20 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * return self._global.mapNameToUnicode(_chars(char_name)) * */ - __pyx_tuple__141 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_char_name); if (unlikely(!__pyx_tuple__141)) __PYX_ERR(3, 82, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__141); - __Pyx_GIVEREF(__pyx_tuple__141); - __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__141, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pyxpdf_globalconfig_pxi, __pyx_n_s_map_name_to_unicode, 82, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(3, 82, __pyx_L1_error) + __pyx_tuple__142 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_char_name); if (unlikely(!__pyx_tuple__142)) __PYX_ERR(3, 82, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__142); + __Pyx_GIVEREF(__pyx_tuple__142); + __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__142, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pyxpdf_globalconfig_pxi, __pyx_n_s_map_name_to_unicode, 82, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(3, 82, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ - __pyx_tuple__142 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__142)) __PYX_ERR(7, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__142); - __Pyx_GIVEREF(__pyx_tuple__142); - __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__142, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_tuple__143 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__143)) __PYX_ERR(7, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__143); + __Pyx_GIVEREF(__pyx_tuple__143); + __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__143, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(7, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): @@ -40962,10 +41215,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - __pyx_tuple__143 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__143)) __PYX_ERR(7, 3, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__143); - __Pyx_GIVEREF(__pyx_tuple__143); - __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__143, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(7, 3, __pyx_L1_error) + __pyx_tuple__144 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__144)) __PYX_ERR(7, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__144); + __Pyx_GIVEREF(__pyx_tuple__144); + __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__144, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(7, 3, __pyx_L1_error) /* "src/pyxpdf/pdftotext.pxi":7 * @@ -40974,10 +41227,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * userpass=None, layout = "reading", double fixed_pitch=0, * double fixed_line_spacing=0, discard_clipped=False, discard_diagonal=False, */ - __pyx_tuple__144 = PyTuple_Pack(15, __pyx_n_s_pdf_file, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_ownerpass, __pyx_n_s_userpass, __pyx_n_s_layout, __pyx_n_s_fixed_pitch, __pyx_n_s_fixed_line_spacing, __pyx_n_s_discard_clipped, __pyx_n_s_discard_diagonal, __pyx_n_s_insert_bom, __pyx_n_s_margin_left, __pyx_n_s_margin_right, __pyx_n_s_margin_top, __pyx_n_s_margin_bottom); if (unlikely(!__pyx_tuple__144)) __PYX_ERR(4, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__144); - __Pyx_GIVEREF(__pyx_tuple__144); - __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(15, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__144, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pyxpdf_pdftotext_pxi, __pyx_n_s_pdftotext_raw, 7, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(4, 7, __pyx_L1_error) + __pyx_tuple__145 = PyTuple_Pack(15, __pyx_n_s_pdf_file, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_ownerpass, __pyx_n_s_userpass, __pyx_n_s_layout, __pyx_n_s_fixed_pitch, __pyx_n_s_fixed_line_spacing, __pyx_n_s_discard_clipped, __pyx_n_s_discard_diagonal, __pyx_n_s_insert_bom, __pyx_n_s_margin_left, __pyx_n_s_margin_right, __pyx_n_s_margin_top, __pyx_n_s_margin_bottom); if (unlikely(!__pyx_tuple__145)) __PYX_ERR(4, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__145); + __Pyx_GIVEREF(__pyx_tuple__145); + __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(15, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__145, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pyxpdf_pdftotext_pxi, __pyx_n_s_pdftotext_raw, 7, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(4, 7, __pyx_L1_error) /* "src/pyxpdf/pdfoutput.pxi":8 * All PDF Output Device inherit from this. @@ -40986,20 +41239,20 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * """Get the output of `page_no` indexed page * """ */ - __pyx_tuple__145 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_page_no, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__145)) __PYX_ERR(5, 8, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__145); - __Pyx_GIVEREF(__pyx_tuple__145); - __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__145, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pyxpdf_pdfoutput_pxi, __pyx_n_s_get, 8, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(5, 8, __pyx_L1_error) + __pyx_tuple__146 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_page_no, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__146)) __PYX_ERR(5, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__146); + __Pyx_GIVEREF(__pyx_tuple__146); + __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__146, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pyxpdf_pdfoutput_pxi, __pyx_n_s_get, 8, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(5, 8, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ - __pyx_tuple__146 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__146)) __PYX_ERR(7, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__146); - __Pyx_GIVEREF(__pyx_tuple__146); - __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__146, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_tuple__147 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__147)) __PYX_ERR(7, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__147); + __Pyx_GIVEREF(__pyx_tuple__147); + __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__147, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(7, 1, __pyx_L1_error) /* "(tree fragment)":16 * else: @@ -41007,20 +41260,20 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_PDFOutputDevice__set_state(self, __pyx_state) */ - __pyx_tuple__147 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__147)) __PYX_ERR(7, 16, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__147); - __Pyx_GIVEREF(__pyx_tuple__147); - __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__147, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(7, 16, __pyx_L1_error) + __pyx_tuple__148 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__148)) __PYX_ERR(7, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__148); + __Pyx_GIVEREF(__pyx_tuple__148); + __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__148, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(7, 16, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ - __pyx_tuple__148 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__148)) __PYX_ERR(7, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__148); - __Pyx_GIVEREF(__pyx_tuple__148); - __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__148, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_tuple__149 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__149)) __PYX_ERR(7, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__149); + __Pyx_GIVEREF(__pyx_tuple__149); + __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__149, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(7, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): @@ -41028,10 +41281,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - __pyx_tuple__149 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__149)) __PYX_ERR(7, 3, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__149); - __Pyx_GIVEREF(__pyx_tuple__149); - __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__149, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(7, 3, __pyx_L1_error) + __pyx_tuple__150 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__150)) __PYX_ERR(7, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__150); + __Pyx_GIVEREF(__pyx_tuple__150); + __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__150, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(7, 3, __pyx_L1_error) /* "src/pyxpdf/textoutput.pxi":249 * # PUBLIC METHODS @@ -41040,10 +41293,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * """Get the extracted text bytes from `page_no` indexed page * */ - __pyx_tuple__150 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_page_no, __pyx_n_s_page_no); if (unlikely(!__pyx_tuple__150)) __PYX_ERR(8, 249, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__150); - __Pyx_GIVEREF(__pyx_tuple__150); - __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__150, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pyxpdf_textoutput_pxi, __pyx_n_s_get_bytes, 249, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(8, 249, __pyx_L1_error) + __pyx_tuple__151 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_page_no, __pyx_n_s_page_no); if (unlikely(!__pyx_tuple__151)) __PYX_ERR(8, 249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__151); + __Pyx_GIVEREF(__pyx_tuple__151); + __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__151, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pyxpdf_textoutput_pxi, __pyx_n_s_get_bytes, 249, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(8, 249, __pyx_L1_error) /* "src/pyxpdf/textoutput.pxi":268 * return self._get_bytes(page_no) @@ -41052,10 +41305,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * """Get the extracted `UTF-8` decoded :any:`str` from `page_no` indexed * page */ - __pyx_tuple__151 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_page_no, __pyx_n_s_page_no); if (unlikely(!__pyx_tuple__151)) __PYX_ERR(8, 268, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__151); - __Pyx_GIVEREF(__pyx_tuple__151); - __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__151, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pyxpdf_textoutput_pxi, __pyx_n_s_get, 268, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(8, 268, __pyx_L1_error) + __pyx_tuple__152 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_page_no, __pyx_n_s_page_no); if (unlikely(!__pyx_tuple__152)) __PYX_ERR(8, 268, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__152); + __Pyx_GIVEREF(__pyx_tuple__152); + __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__152, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pyxpdf_textoutput_pxi, __pyx_n_s_get, 268, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(8, 268, __pyx_L1_error) /* "src/pyxpdf/textoutput.pxi":288 * return self._get_bytes(page_no).decode('UTF-8', errors='ignore') @@ -41064,20 +41317,20 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * """Get the extracted `UTF-8` decoded text from all pages * */ - __pyx_tuple__152 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__152)) __PYX_ERR(8, 288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__152); - __Pyx_GIVEREF(__pyx_tuple__152); - __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__152, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pyxpdf_textoutput_pxi, __pyx_n_s_get_all, 288, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(8, 288, __pyx_L1_error) + __pyx_tuple__153 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__153)) __PYX_ERR(8, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__153); + __Pyx_GIVEREF(__pyx_tuple__153); + __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__153, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pyxpdf_textoutput_pxi, __pyx_n_s_get_all, 288, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(8, 288, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ - __pyx_tuple__153 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__153)) __PYX_ERR(7, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__153); - __Pyx_GIVEREF(__pyx_tuple__153); - __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__153, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_tuple__154 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__154)) __PYX_ERR(7, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__154); + __Pyx_GIVEREF(__pyx_tuple__154); + __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__154, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(7, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): @@ -41085,20 +41338,20 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - __pyx_tuple__154 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__154)) __PYX_ERR(7, 3, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__154); - __Pyx_GIVEREF(__pyx_tuple__154); - __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__154, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(7, 3, __pyx_L1_error) + __pyx_tuple__155 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__155)) __PYX_ERR(7, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__155); + __Pyx_GIVEREF(__pyx_tuple__155); + __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__155, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(7, 3, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ - __pyx_tuple__155 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__155)) __PYX_ERR(7, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__155); - __Pyx_GIVEREF(__pyx_tuple__155); - __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__155, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_tuple__156 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__156)) __PYX_ERR(7, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__156); + __Pyx_GIVEREF(__pyx_tuple__156); + __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__156, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(7, 1, __pyx_L1_error) /* "(tree fragment)":16 * else: @@ -41106,32 +41359,32 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_RawImageControl__set_state(self, __pyx_state) */ - __pyx_tuple__156 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__156)) __PYX_ERR(7, 16, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__156); - __Pyx_GIVEREF(__pyx_tuple__156); - __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__156, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(7, 16, __pyx_L1_error) + __pyx_tuple__157 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__157)) __PYX_ERR(7, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__157); + __Pyx_GIVEREF(__pyx_tuple__157); + __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__157, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(7, 16, __pyx_L1_error) - /* "src/pyxpdf/imageoutput.pxi":429 + /* "src/pyxpdf/imageoutput.pxi":427 * * * cpdef object get(self, int page_no, crop_box=(0,0,0,0), scale_pixel_box = None): # <<<<<<<<<<<<<< * """Get the rendered :class:`~PIL.Image.Image` for `page_no` indexed page * */ - __pyx_tuple__157 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_page_no, __pyx_n_s_crop_box, __pyx_n_s_scale_pixel_box); if (unlikely(!__pyx_tuple__157)) __PYX_ERR(9, 429, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__157); - __Pyx_GIVEREF(__pyx_tuple__157); - __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__157, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pyxpdf_imageoutput_pxi, __pyx_n_s_get, 429, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(9, 429, __pyx_L1_error) + __pyx_tuple__158 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_page_no, __pyx_n_s_crop_box, __pyx_n_s_scale_pixel_box); if (unlikely(!__pyx_tuple__158)) __PYX_ERR(9, 427, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__158); + __Pyx_GIVEREF(__pyx_tuple__158); + __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__158, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pyxpdf_imageoutput_pxi, __pyx_n_s_get, 427, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(9, 427, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ - __pyx_tuple__158 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__158)) __PYX_ERR(7, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__158); - __Pyx_GIVEREF(__pyx_tuple__158); - __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__158, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_tuple__159 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__159)) __PYX_ERR(7, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__159); + __Pyx_GIVEREF(__pyx_tuple__159); + __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__159, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(7, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): @@ -41139,20 +41392,20 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - __pyx_tuple__159 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__159)) __PYX_ERR(7, 3, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__159); - __Pyx_GIVEREF(__pyx_tuple__159); - __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__159, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(7, 3, __pyx_L1_error) + __pyx_tuple__160 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__160)) __PYX_ERR(7, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__160); + __Pyx_GIVEREF(__pyx_tuple__160); + __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__160, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(7, 3, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ - __pyx_tuple__160 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__160)) __PYX_ERR(7, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__160); - __Pyx_GIVEREF(__pyx_tuple__160); - __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__160, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_tuple__161 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__161)) __PYX_ERR(7, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__161); + __Pyx_GIVEREF(__pyx_tuple__161); + __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__161, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(7, 1, __pyx_L1_error) /* "(tree fragment)":16 * else: @@ -41160,10 +41413,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_PDFImage__set_state(self, __pyx_state) */ - __pyx_tuple__161 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__161)) __PYX_ERR(7, 16, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__161); - __Pyx_GIVEREF(__pyx_tuple__161); - __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__161, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(7, 16, __pyx_L1_error) + __pyx_tuple__162 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__162)) __PYX_ERR(7, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__162); + __Pyx_GIVEREF(__pyx_tuple__162); + __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__162, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(7, 16, __pyx_L1_error) /* "src/pyxpdf/imageoutput.pxi":661 * @@ -41172,20 +41425,20 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * """Get all the images from `page_no` indexed page. * */ - __pyx_tuple__162 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_page_no); if (unlikely(!__pyx_tuple__162)) __PYX_ERR(9, 661, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__162); - __Pyx_GIVEREF(__pyx_tuple__162); - __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__162, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pyxpdf_imageoutput_pxi, __pyx_n_s_get, 661, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(9, 661, __pyx_L1_error) + __pyx_tuple__163 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_page_no); if (unlikely(!__pyx_tuple__163)) __PYX_ERR(9, 661, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__163); + __Pyx_GIVEREF(__pyx_tuple__163); + __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__163, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pyxpdf_imageoutput_pxi, __pyx_n_s_get, 661, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(9, 661, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ - __pyx_tuple__163 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__163)) __PYX_ERR(7, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__163); - __Pyx_GIVEREF(__pyx_tuple__163); - __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__163, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_tuple__164 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__164)) __PYX_ERR(7, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__164); + __Pyx_GIVEREF(__pyx_tuple__164); + __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__164, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(7, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): @@ -41193,68 +41446,68 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - __pyx_tuple__164 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__164)) __PYX_ERR(7, 3, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__164); - __Pyx_GIVEREF(__pyx_tuple__164); - __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__164, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(7, 3, __pyx_L1_error) + __pyx_tuple__165 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__165)) __PYX_ERR(7, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__165); + __Pyx_GIVEREF(__pyx_tuple__165); + __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__165, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(7, 3, __pyx_L1_error) - /* "src/pyxpdf/document.pxi":319 + /* "src/pyxpdf/document.pxi":329 * * * def info(self): # <<<<<<<<<<<<<< * """Get the PDF's info dictionary. * */ - __pyx_tuple__165 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__165)) __PYX_ERR(6, 319, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__165); - __Pyx_GIVEREF(__pyx_tuple__165); - __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__165, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pyxpdf_document_pxi, __pyx_n_s_info, 319, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(6, 319, __pyx_L1_error) + __pyx_tuple__166 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__166)) __PYX_ERR(6, 329, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__166); + __Pyx_GIVEREF(__pyx_tuple__166); + __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__166, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pyxpdf_document_pxi, __pyx_n_s_info, 329, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) __PYX_ERR(6, 329, __pyx_L1_error) - /* "src/pyxpdf/document.pxi":332 + /* "src/pyxpdf/document.pxi":342 * return self.get_info_dict() * * def xmp_metadata(self): # <<<<<<<<<<<<<< * """Get the PDF's xmp metadata. * */ - __pyx_tuple__166 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__166)) __PYX_ERR(6, 332, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__166); - __Pyx_GIVEREF(__pyx_tuple__166); - __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__166, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pyxpdf_document_pxi, __pyx_n_s_xmp_metadata, 332, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) __PYX_ERR(6, 332, __pyx_L1_error) + __pyx_tuple__167 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__167)) __PYX_ERR(6, 342, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__167); + __Pyx_GIVEREF(__pyx_tuple__167); + __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__167, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pyxpdf_document_pxi, __pyx_n_s_xmp_metadata, 342, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) __PYX_ERR(6, 342, __pyx_L1_error) - /* "src/pyxpdf/document.pxi":342 + /* "src/pyxpdf/document.pxi":352 * * * cpdef text_bytes(self, int start=0, int end=-1, TextControl control=None): # <<<<<<<<<<<<<< * """Parse and extract text from given page range. * */ - __pyx_tuple__167 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_control); if (unlikely(!__pyx_tuple__167)) __PYX_ERR(6, 342, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__167); - __Pyx_GIVEREF(__pyx_tuple__167); - __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__167, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pyxpdf_document_pxi, __pyx_n_s_text_bytes, 342, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) __PYX_ERR(6, 342, __pyx_L1_error) + __pyx_tuple__168 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_control); if (unlikely(!__pyx_tuple__168)) __PYX_ERR(6, 352, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__168); + __Pyx_GIVEREF(__pyx_tuple__168); + __pyx_codeobj__83 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__168, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pyxpdf_document_pxi, __pyx_n_s_text_bytes, 352, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__83)) __PYX_ERR(6, 352, __pyx_L1_error) - /* "src/pyxpdf/document.pxi":384 + /* "src/pyxpdf/document.pxi":394 * return deref(out) * * cpdef text(self, start=0, end=-1, control=None): # <<<<<<<<<<<<<< * """Parse and extract UTF-8 decoded text from given page range. * */ - __pyx_tuple__168 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_control); if (unlikely(!__pyx_tuple__168)) __PYX_ERR(6, 384, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__168); - __Pyx_GIVEREF(__pyx_tuple__168); - __pyx_codeobj__83 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__168, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pyxpdf_document_pxi, __pyx_n_s_text, 384, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__83)) __PYX_ERR(6, 384, __pyx_L1_error) + __pyx_tuple__169 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_control); if (unlikely(!__pyx_tuple__169)) __PYX_ERR(6, 394, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__169); + __Pyx_GIVEREF(__pyx_tuple__169); + __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__169, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pyxpdf_document_pxi, __pyx_n_s_text, 394, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) __PYX_ERR(6, 394, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ - __pyx_tuple__169 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__169)) __PYX_ERR(7, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__169); - __Pyx_GIVEREF(__pyx_tuple__169); - __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__169, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_tuple__170 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__170)) __PYX_ERR(7, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__170); + __Pyx_GIVEREF(__pyx_tuple__170); + __pyx_codeobj__85 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__170, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__85)) __PYX_ERR(7, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): @@ -41262,20 +41515,20 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - __pyx_tuple__170 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__170)) __PYX_ERR(7, 3, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__170); - __Pyx_GIVEREF(__pyx_tuple__170); - __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__170, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) __PYX_ERR(7, 3, __pyx_L1_error) + __pyx_tuple__171 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__171)) __PYX_ERR(7, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__171); + __Pyx_GIVEREF(__pyx_tuple__171); + __pyx_codeobj__87 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__171, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__87)) __PYX_ERR(7, 3, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ - __pyx_tuple__171 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__171)) __PYX_ERR(7, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__171); - __Pyx_GIVEREF(__pyx_tuple__171); - __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__171, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_tuple__172 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__172)) __PYX_ERR(7, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__172); + __Pyx_GIVEREF(__pyx_tuple__172); + __pyx_codeobj__89 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__172, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__89)) __PYX_ERR(7, 1, __pyx_L1_error) /* "(tree fragment)":16 * else: @@ -41283,68 +41536,68 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_DocumentPageIterator__set_state(self, __pyx_state) */ - __pyx_tuple__172 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__172)) __PYX_ERR(7, 16, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__172); - __Pyx_GIVEREF(__pyx_tuple__172); - __pyx_codeobj__89 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__172, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__89)) __PYX_ERR(7, 16, __pyx_L1_error) + __pyx_tuple__173 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__173)) __PYX_ERR(7, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__173); + __Pyx_GIVEREF(__pyx_tuple__173); + __pyx_codeobj__90 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__173, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__90)) __PYX_ERR(7, 16, __pyx_L1_error) - /* "src/pyxpdf/document.pxi":657 + /* "src/pyxpdf/document.pxi":667 * * * def find_text(self, text, search_box=None, direction="top", case_sensitive=False, # <<<<<<<<<<<<<< * wholeword=False, rotation=0): * """Find the text in Page. */ - __pyx_tuple__173 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_text, __pyx_n_s_search_box, __pyx_n_s_direction, __pyx_n_s_case_sensitive, __pyx_n_s_wholeword, __pyx_n_s_rotation, __pyx_n_s_result); if (unlikely(!__pyx_tuple__173)) __PYX_ERR(6, 657, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__173); - __Pyx_GIVEREF(__pyx_tuple__173); - __pyx_codeobj__97 = (PyObject*)__Pyx_PyCode_New(7, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__173, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pyxpdf_document_pxi, __pyx_n_s_find_text, 657, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__97)) __PYX_ERR(6, 657, __pyx_L1_error) + __pyx_tuple__174 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_text, __pyx_n_s_search_box, __pyx_n_s_direction, __pyx_n_s_case_sensitive, __pyx_n_s_wholeword, __pyx_n_s_rotation, __pyx_n_s_result); if (unlikely(!__pyx_tuple__174)) __PYX_ERR(6, 667, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__174); + __Pyx_GIVEREF(__pyx_tuple__174); + __pyx_codeobj__98 = (PyObject*)__Pyx_PyCode_New(7, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__174, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pyxpdf_document_pxi, __pyx_n_s_find_text, 667, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__98)) __PYX_ERR(6, 667, __pyx_L1_error) - /* "src/pyxpdf/document.pxi":713 + /* "src/pyxpdf/document.pxi":723 * * * def find_all_text(self, text, search_box=None, case_sensitive=False, wholeword=False, # <<<<<<<<<<<<<< * rotation=0): * """Find the `text` and get all the matches */ - __pyx_tuple__174 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_text, __pyx_n_s_search_box, __pyx_n_s_case_sensitive, __pyx_n_s_wholeword, __pyx_n_s_rotation, __pyx_n_s_res); if (unlikely(!__pyx_tuple__174)) __PYX_ERR(6, 713, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__174); - __Pyx_GIVEREF(__pyx_tuple__174); - __pyx_codeobj__98 = (PyObject*)__Pyx_PyCode_New(6, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__174, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pyxpdf_document_pxi, __pyx_n_s_find_all_text, 713, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__98)) __PYX_ERR(6, 713, __pyx_L1_error) + __pyx_tuple__175 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_text, __pyx_n_s_search_box, __pyx_n_s_case_sensitive, __pyx_n_s_wholeword, __pyx_n_s_rotation, __pyx_n_s_res); if (unlikely(!__pyx_tuple__175)) __PYX_ERR(6, 723, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__175); + __Pyx_GIVEREF(__pyx_tuple__175); + __pyx_codeobj__99 = (PyObject*)__Pyx_PyCode_New(6, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__175, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pyxpdf_document_pxi, __pyx_n_s_find_all_text, 723, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__99)) __PYX_ERR(6, 723, __pyx_L1_error) - /* "src/pyxpdf/document.pxi":745 + /* "src/pyxpdf/document.pxi":755 * * * def text_bytes(self, page_area=None, TextControl control = None): # <<<<<<<<<<<<<< * """Parse and extract text bytes from current page. * */ - __pyx_tuple__175 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_page_area, __pyx_n_s_control, __pyx_n_s_text_control, __pyx_n_s_out, __pyx_n_s_text_dev); if (unlikely(!__pyx_tuple__175)) __PYX_ERR(6, 745, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__175); - __Pyx_GIVEREF(__pyx_tuple__175); - __pyx_codeobj__99 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__175, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pyxpdf_document_pxi, __pyx_n_s_text_bytes, 745, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__99)) __PYX_ERR(6, 745, __pyx_L1_error) + __pyx_tuple__176 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_page_area, __pyx_n_s_control, __pyx_n_s_text_control, __pyx_n_s_out, __pyx_n_s_text_dev); if (unlikely(!__pyx_tuple__176)) __PYX_ERR(6, 755, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__176); + __Pyx_GIVEREF(__pyx_tuple__176); + __pyx_codeobj__100 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__176, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pyxpdf_document_pxi, __pyx_n_s_text_bytes, 755, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__100)) __PYX_ERR(6, 755, __pyx_L1_error) - /* "src/pyxpdf/document.pxi":792 + /* "src/pyxpdf/document.pxi":802 * * * def text(self, page_area=None, control=None): # <<<<<<<<<<<<<< * """Parse and extract UTF-8 decoded text from current page. * */ - __pyx_tuple__176 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_page_area, __pyx_n_s_control); if (unlikely(!__pyx_tuple__176)) __PYX_ERR(6, 792, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__176); - __Pyx_GIVEREF(__pyx_tuple__176); - __pyx_codeobj__100 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__176, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pyxpdf_document_pxi, __pyx_n_s_text, 792, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__100)) __PYX_ERR(6, 792, __pyx_L1_error) + __pyx_tuple__177 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_page_area, __pyx_n_s_control); if (unlikely(!__pyx_tuple__177)) __PYX_ERR(6, 802, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__177); + __Pyx_GIVEREF(__pyx_tuple__177); + __pyx_codeobj__101 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__177, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pyxpdf_document_pxi, __pyx_n_s_text, 802, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__101)) __PYX_ERR(6, 802, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ - __pyx_tuple__177 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__177)) __PYX_ERR(7, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__177); - __Pyx_GIVEREF(__pyx_tuple__177); - __pyx_codeobj__101 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__177, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__101)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_tuple__178 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__178)) __PYX_ERR(7, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__178); + __Pyx_GIVEREF(__pyx_tuple__178); + __pyx_codeobj__102 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__178, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__102)) __PYX_ERR(7, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): @@ -41352,20 +41605,20 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - __pyx_tuple__178 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__178)) __PYX_ERR(7, 3, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__178); - __Pyx_GIVEREF(__pyx_tuple__178); - __pyx_codeobj__103 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__178, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__103)) __PYX_ERR(7, 3, __pyx_L1_error) + __pyx_tuple__179 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__179)) __PYX_ERR(7, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__179); + __Pyx_GIVEREF(__pyx_tuple__179); + __pyx_codeobj__104 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__179, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__104)) __PYX_ERR(7, 3, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ - __pyx_tuple__179 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__179)) __PYX_ERR(7, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__179); - __Pyx_GIVEREF(__pyx_tuple__179); - __pyx_codeobj__105 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__179, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__105)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_tuple__180 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__180)) __PYX_ERR(7, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__180); + __Pyx_GIVEREF(__pyx_tuple__180); + __pyx_codeobj__106 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__180, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__106)) __PYX_ERR(7, 1, __pyx_L1_error) /* "(tree fragment)":16 * else: @@ -41373,68 +41626,68 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_page_iterator__set_state(self, __pyx_state) */ - __pyx_tuple__180 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__180)) __PYX_ERR(7, 16, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__180); - __Pyx_GIVEREF(__pyx_tuple__180); - __pyx_codeobj__106 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__180, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__106)) __PYX_ERR(7, 16, __pyx_L1_error) + __pyx_tuple__181 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__181)) __PYX_ERR(7, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__181); + __Pyx_GIVEREF(__pyx_tuple__181); + __pyx_codeobj__107 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__181, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__107)) __PYX_ERR(7, 16, __pyx_L1_error) /* "(tree fragment)":1 * def __pyx_unpickle_PDFError(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ - __pyx_tuple__181 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__181)) __PYX_ERR(7, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__181); - __Pyx_GIVEREF(__pyx_tuple__181); - __pyx_codeobj__107 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__181, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_PDFError, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__107)) __PYX_ERR(7, 1, __pyx_L1_error) __pyx_tuple__182 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__182)) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__182); __Pyx_GIVEREF(__pyx_tuple__182); - __pyx_codeobj__108 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__182, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_XPDFError, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__108)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_codeobj__108 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__182, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_PDFError, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__108)) __PYX_ERR(7, 1, __pyx_L1_error) __pyx_tuple__183 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__183)) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__183); __Pyx_GIVEREF(__pyx_tuple__183); - __pyx_codeobj__109 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__183, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_PDFSyntaxError, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__109)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_codeobj__109 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__183, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_XPDFError, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__109)) __PYX_ERR(7, 1, __pyx_L1_error) __pyx_tuple__184 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__184)) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__184); __Pyx_GIVEREF(__pyx_tuple__184); - __pyx_codeobj__110 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__184, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_XPDFConfigError, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__110)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_codeobj__110 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__184, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_PDFSyntaxError, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__110)) __PYX_ERR(7, 1, __pyx_L1_error) __pyx_tuple__185 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__185)) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__185); __Pyx_GIVEREF(__pyx_tuple__185); - __pyx_codeobj__111 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__185, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_PDFIOError, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__111)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_codeobj__111 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__185, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_XPDFConfigError, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__111)) __PYX_ERR(7, 1, __pyx_L1_error) __pyx_tuple__186 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__186)) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__186); __Pyx_GIVEREF(__pyx_tuple__186); - __pyx_codeobj__112 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__186, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_PDFPermissionErro, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__112)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_codeobj__112 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__186, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_PDFIOError, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__112)) __PYX_ERR(7, 1, __pyx_L1_error) __pyx_tuple__187 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__187)) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__187); __Pyx_GIVEREF(__pyx_tuple__187); - __pyx_codeobj__113 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__187, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_XPDFInternalError, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__113)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_codeobj__113 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__187, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_PDFPermissionErro, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__113)) __PYX_ERR(7, 1, __pyx_L1_error) __pyx_tuple__188 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__188)) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__188); __Pyx_GIVEREF(__pyx_tuple__188); - __pyx_codeobj__114 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__188, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_XPDFNotInplemente, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__114)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_codeobj__114 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__188, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_XPDFInternalError, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__114)) __PYX_ERR(7, 1, __pyx_L1_error) __pyx_tuple__189 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__189)) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__189); __Pyx_GIVEREF(__pyx_tuple__189); - __pyx_codeobj__115 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__189, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_PDFOutputDevice, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__115)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_codeobj__115 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__189, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_XPDFNotInplemente, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__115)) __PYX_ERR(7, 1, __pyx_L1_error) __pyx_tuple__190 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__190)) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__190); __Pyx_GIVEREF(__pyx_tuple__190); - __pyx_codeobj__116 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__190, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_RawImageControl, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__116)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_codeobj__116 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__190, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_PDFOutputDevice, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__116)) __PYX_ERR(7, 1, __pyx_L1_error) __pyx_tuple__191 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__191)) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__191); __Pyx_GIVEREF(__pyx_tuple__191); - __pyx_codeobj__117 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__191, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_PDFImage, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__117)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_codeobj__117 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__191, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_RawImageControl, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__117)) __PYX_ERR(7, 1, __pyx_L1_error) __pyx_tuple__192 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__192)) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__192); __Pyx_GIVEREF(__pyx_tuple__192); - __pyx_codeobj__118 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__192, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_DocumentPageItera, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__118)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_codeobj__118 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__192, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_PDFImage, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__118)) __PYX_ERR(7, 1, __pyx_L1_error) __pyx_tuple__193 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__193)) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__193); __Pyx_GIVEREF(__pyx_tuple__193); - __pyx_codeobj__119 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__193, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_page_iterator, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__119)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_codeobj__119 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__193, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_DocumentPageItera, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__119)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_tuple__194 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__194)) __PYX_ERR(7, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__194); + __Pyx_GIVEREF(__pyx_tuple__194); + __pyx_codeobj__120 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__194, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_page_iterator, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__120)) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -41675,16 +41928,16 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_ptype_6pyxpdf_4xpdf_RawImageOutput = &__pyx_type_6pyxpdf_4xpdf_RawImageOutput; __pyx_vtabptr_6pyxpdf_4xpdf_PDFImage = &__pyx_vtable_6pyxpdf_4xpdf_PDFImage; __pyx_vtable_6pyxpdf_4xpdf_PDFImage.from_ptr = (struct __pyx_obj_6pyxpdf_4xpdf_PDFImage *(*)(PDFBitmapImage *))__pyx_f_6pyxpdf_4xpdf_8PDFImage_from_ptr; - if (PyType_Ready(&__pyx_type_6pyxpdf_4xpdf_PDFImage) < 0) __PYX_ERR(9, 503, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_6pyxpdf_4xpdf_PDFImage) < 0) __PYX_ERR(9, 501, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_6pyxpdf_4xpdf_PDFImage.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6pyxpdf_4xpdf_PDFImage.tp_dictoffset && __pyx_type_6pyxpdf_4xpdf_PDFImage.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_6pyxpdf_4xpdf_PDFImage.tp_getattro = __Pyx_PyObject_GenericGetAttr; } - if (__Pyx_SetVtable(__pyx_type_6pyxpdf_4xpdf_PDFImage.tp_dict, __pyx_vtabptr_6pyxpdf_4xpdf_PDFImage) < 0) __PYX_ERR(9, 503, __pyx_L1_error) - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_PDFImage, (PyObject *)&__pyx_type_6pyxpdf_4xpdf_PDFImage) < 0) __PYX_ERR(9, 503, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6pyxpdf_4xpdf_PDFImage) < 0) __PYX_ERR(9, 503, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_6pyxpdf_4xpdf_PDFImage.tp_dict, __pyx_vtabptr_6pyxpdf_4xpdf_PDFImage) < 0) __PYX_ERR(9, 501, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_PDFImage, (PyObject *)&__pyx_type_6pyxpdf_4xpdf_PDFImage) < 0) __PYX_ERR(9, 501, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6pyxpdf_4xpdf_PDFImage) < 0) __PYX_ERR(9, 501, __pyx_L1_error) __pyx_ptype_6pyxpdf_4xpdf_PDFImage = &__pyx_type_6pyxpdf_4xpdf_PDFImage; __pyx_vtabptr_6pyxpdf_4xpdf_PDFImageOutput = &__pyx_vtable_6pyxpdf_4xpdf_PDFImageOutput; __pyx_vtable_6pyxpdf_4xpdf_PDFImageOutput._get_PDFBitmapImages = (int (*)(struct __pyx_obj_6pyxpdf_4xpdf_PDFImageOutput *, PyObject *, std::vector *))__pyx_f_6pyxpdf_4xpdf_14PDFImageOutput__get_PDFBitmapImages; @@ -41703,7 +41956,7 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_ptype_6pyxpdf_4xpdf_PDFImageOutput = &__pyx_type_6pyxpdf_4xpdf_PDFImageOutput; __pyx_vtabptr_6pyxpdf_4xpdf_Document = &__pyx_vtable_6pyxpdf_4xpdf_Document; __pyx_vtable_6pyxpdf_4xpdf_Document.get_catalog = (Catalog *(*)(struct __pyx_obj_6pyxpdf_4xpdf_Document *))__pyx_f_6pyxpdf_4xpdf_8Document_get_catalog; - __pyx_vtable_6pyxpdf_4xpdf_Document.display_pages = (PyObject *(*)(struct __pyx_obj_6pyxpdf_4xpdf_Document *, OutputDev *, int, int, struct __pyx_opt_args_6pyxpdf_4xpdf_8Document_display_pages *__pyx_optional_args))__pyx_f_6pyxpdf_4xpdf_8Document_display_pages; + __pyx_vtable_6pyxpdf_4xpdf_Document.display_pages = (PyObject *(*)(struct __pyx_obj_6pyxpdf_4xpdf_Document *, OutputDev *, struct __pyx_opt_args_6pyxpdf_4xpdf_8Document_display_pages *__pyx_optional_args))__pyx_f_6pyxpdf_4xpdf_8Document_display_pages; __pyx_vtable_6pyxpdf_4xpdf_Document.get_info_dict = (PyObject *(*)(struct __pyx_obj_6pyxpdf_4xpdf_Document *))__pyx_f_6pyxpdf_4xpdf_8Document_get_info_dict; __pyx_vtable_6pyxpdf_4xpdf_Document.get_metadata = (PyObject *(*)(struct __pyx_obj_6pyxpdf_4xpdf_Document *))__pyx_f_6pyxpdf_4xpdf_8Document_get_metadata; __pyx_vtable_6pyxpdf_4xpdf_Document._load_from_file = (PyObject *(*)(struct __pyx_obj_6pyxpdf_4xpdf_Document *, GString *))__pyx_f_6pyxpdf_4xpdf_8Document__load_from_file; @@ -41734,15 +41987,15 @@ static int __Pyx_modinit_type_init_code(void) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Document, (PyObject *)&__pyx_type_6pyxpdf_4xpdf_Document) < 0) __PYX_ERR(6, 17, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6pyxpdf_4xpdf_Document) < 0) __PYX_ERR(6, 17, __pyx_L1_error) __pyx_ptype_6pyxpdf_4xpdf_Document = &__pyx_type_6pyxpdf_4xpdf_Document; - if (PyType_Ready(&__pyx_type_6pyxpdf_4xpdf_DocumentPageIterator) < 0) __PYX_ERR(6, 425, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_6pyxpdf_4xpdf_DocumentPageIterator) < 0) __PYX_ERR(6, 435, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_6pyxpdf_4xpdf_DocumentPageIterator.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6pyxpdf_4xpdf_DocumentPageIterator.tp_dictoffset && __pyx_type_6pyxpdf_4xpdf_DocumentPageIterator.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_6pyxpdf_4xpdf_DocumentPageIterator.tp_getattro = __Pyx_PyObject_GenericGetAttr; } - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DocumentPageIterator, (PyObject *)&__pyx_type_6pyxpdf_4xpdf_DocumentPageIterator) < 0) __PYX_ERR(6, 425, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6pyxpdf_4xpdf_DocumentPageIterator) < 0) __PYX_ERR(6, 425, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DocumentPageIterator, (PyObject *)&__pyx_type_6pyxpdf_4xpdf_DocumentPageIterator) < 0) __PYX_ERR(6, 435, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6pyxpdf_4xpdf_DocumentPageIterator) < 0) __PYX_ERR(6, 435, __pyx_L1_error) __pyx_ptype_6pyxpdf_4xpdf_DocumentPageIterator = &__pyx_type_6pyxpdf_4xpdf_DocumentPageIterator; __pyx_vtabptr_6pyxpdf_4xpdf_Page = &__pyx_vtable_6pyxpdf_4xpdf_Page; __pyx_vtable_6pyxpdf_4xpdf_Page.display_slice = (PyObject *(*)(struct __pyx_obj_6pyxpdf_4xpdf_Page *, OutputDev *, int, int, int, int, struct __pyx_opt_args_6pyxpdf_4xpdf_4Page_display_slice *__pyx_optional_args))__pyx_f_6pyxpdf_4xpdf_4Page_display_slice; @@ -41750,7 +42003,7 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtable_6pyxpdf_4xpdf_Page._init_TextPage = (PyObject *(*)(struct __pyx_obj_6pyxpdf_4xpdf_Page *, int))__pyx_f_6pyxpdf_4xpdf_4Page__init_TextPage; __pyx_vtable_6pyxpdf_4xpdf_Page.get_label = (PyObject *(*)(struct __pyx_obj_6pyxpdf_4xpdf_Page *))__pyx_f_6pyxpdf_4xpdf_4Page_get_label; __pyx_vtable_6pyxpdf_4xpdf_Page._find_text = (PyObject *(*)(struct __pyx_obj_6pyxpdf_4xpdf_Page *, PyObject *, struct __pyx_opt_args_6pyxpdf_4xpdf_4Page__find_text *__pyx_optional_args))__pyx_f_6pyxpdf_4xpdf_4Page__find_text; - if (PyType_Ready(&__pyx_type_6pyxpdf_4xpdf_Page) < 0) __PYX_ERR(6, 445, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_6pyxpdf_4xpdf_Page) < 0) __PYX_ERR(6, 455, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_6pyxpdf_4xpdf_Page.tp_print = 0; #endif @@ -41759,7 +42012,7 @@ static int __Pyx_modinit_type_init_code(void) { } #if CYTHON_COMPILING_IN_CPYTHON { - PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_6pyxpdf_4xpdf_Page, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(6, 445, __pyx_L1_error) + PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_6pyxpdf_4xpdf_Page, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(6, 455, __pyx_L1_error) if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { __pyx_wrapperbase_6pyxpdf_4xpdf_4Page___init__ = *((PyWrapperDescrObject *)wrapper)->d_base; __pyx_wrapperbase_6pyxpdf_4xpdf_4Page___init__.doc = __pyx_doc_6pyxpdf_4xpdf_4Page___init__; @@ -41767,21 +42020,21 @@ static int __Pyx_modinit_type_init_code(void) { } } #endif - if (__Pyx_SetVtable(__pyx_type_6pyxpdf_4xpdf_Page.tp_dict, __pyx_vtabptr_6pyxpdf_4xpdf_Page) < 0) __PYX_ERR(6, 445, __pyx_L1_error) - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Page, (PyObject *)&__pyx_type_6pyxpdf_4xpdf_Page) < 0) __PYX_ERR(6, 445, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6pyxpdf_4xpdf_Page) < 0) __PYX_ERR(6, 445, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_6pyxpdf_4xpdf_Page.tp_dict, __pyx_vtabptr_6pyxpdf_4xpdf_Page) < 0) __PYX_ERR(6, 455, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Page, (PyObject *)&__pyx_type_6pyxpdf_4xpdf_Page) < 0) __PYX_ERR(6, 455, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6pyxpdf_4xpdf_Page) < 0) __PYX_ERR(6, 455, __pyx_L1_error) __pyx_ptype_6pyxpdf_4xpdf_Page = &__pyx_type_6pyxpdf_4xpdf_Page; - if (PyType_Ready(&__pyx_type_6pyxpdf_4xpdf_page_iterator) < 0) __PYX_ERR(6, 831, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_6pyxpdf_4xpdf_page_iterator) < 0) __PYX_ERR(6, 841, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_6pyxpdf_4xpdf_page_iterator.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6pyxpdf_4xpdf_page_iterator.tp_dictoffset && __pyx_type_6pyxpdf_4xpdf_page_iterator.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_6pyxpdf_4xpdf_page_iterator.tp_getattro = __Pyx_PyObject_GenericGetAttr; } - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_page_iterator, (PyObject *)&__pyx_type_6pyxpdf_4xpdf_page_iterator) < 0) __PYX_ERR(6, 831, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6pyxpdf_4xpdf_page_iterator) < 0) __PYX_ERR(6, 831, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_page_iterator, (PyObject *)&__pyx_type_6pyxpdf_4xpdf_page_iterator) < 0) __PYX_ERR(6, 841, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6pyxpdf_4xpdf_page_iterator) < 0) __PYX_ERR(6, 841, __pyx_L1_error) __pyx_ptype_6pyxpdf_4xpdf_page_iterator = &__pyx_type_6pyxpdf_4xpdf_page_iterator; - if (PyType_Ready(&__pyx_type_6pyxpdf_4xpdf___pyx_scope_struct__find_all_text) < 0) __PYX_ERR(6, 713, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_6pyxpdf_4xpdf___pyx_scope_struct__find_all_text) < 0) __PYX_ERR(6, 723, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_6pyxpdf_4xpdf___pyx_scope_struct__find_all_text.tp_print = 0; #endif @@ -42102,10 +42355,10 @@ if (!__Pyx_RefNanny) { * */ __Pyx_TraceLine(46,0,__PYX_ERR(0, 46, __pyx_L1_error)) - __Pyx_INCREF(__pyx_tuple__120); + __Pyx_INCREF(__pyx_tuple__121); __Pyx_XGOTREF(__pyx_v_6pyxpdf_4xpdf_optional_deps); - __Pyx_DECREF_SET(__pyx_v_6pyxpdf_4xpdf_optional_deps, __pyx_tuple__120); - __Pyx_GIVEREF(__pyx_tuple__120); + __Pyx_DECREF_SET(__pyx_v_6pyxpdf_4xpdf_optional_deps, __pyx_tuple__121); + __Pyx_GIVEREF(__pyx_tuple__121); /* "pyxpdf/xpdf.pyx":47 * ####################################################### @@ -42764,7 +43017,7 @@ if (!__Pyx_RefNanny) { * public object __doc__ * * cdef _set_defaults(self): # <<<<<<<<<<<<<< - * # only call after initialising self._global + * # only call after initializing self._global * # default text encoding */ __Pyx_TraceLine(17,0,__PYX_ERR(3, 17, __pyx_L1_error)) @@ -42873,30 +43126,30 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(7, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "src/pyxpdf/globalconfig.pxi":215 + /* "src/pyxpdf/globalconfig.pxi":210 * * * Config = _GlobalParamsConfig.__new__(_GlobalParamsConfig) # <<<<<<<<<<<<<< * Config.__doc__ = \ * """ */ - __Pyx_TraceLine(215,0,__PYX_ERR(3, 215, __pyx_L1_error)) - __pyx_t_1 = ((PyObject *)__pyx_tp_new_6pyxpdf_4xpdf__GlobalParamsConfig(((PyTypeObject *)__pyx_ptype_6pyxpdf_4xpdf__GlobalParamsConfig), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 215, __pyx_L1_error) + __Pyx_TraceLine(210,0,__PYX_ERR(3, 210, __pyx_L1_error)) + __pyx_t_1 = ((PyObject *)__pyx_tp_new_6pyxpdf_4xpdf__GlobalParamsConfig(((PyTypeObject *)__pyx_ptype_6pyxpdf_4xpdf__GlobalParamsConfig), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 210, __pyx_L1_error) __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Config, ((PyObject *)__pyx_t_1)) < 0) __PYX_ERR(3, 215, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Config, ((PyObject *)__pyx_t_1)) < 0) __PYX_ERR(3, 210, __pyx_L1_error) __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* "src/pyxpdf/globalconfig.pxi":216 + /* "src/pyxpdf/globalconfig.pxi":211 * * Config = _GlobalParamsConfig.__new__(_GlobalParamsConfig) * Config.__doc__ = \ # <<<<<<<<<<<<<< * """ * Global XPDF config object */ - __Pyx_TraceLine(216,0,__PYX_ERR(3, 216, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Config); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 216, __pyx_L1_error) + __Pyx_TraceLine(211,0,__PYX_ERR(3, 211, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Config); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_t_1, __pyx_n_s_doc_2, __pyx_kp_u_Global_XPDF_config_object_Metho) < 0) __PYX_ERR(3, 216, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_t_1, __pyx_n_s_doc_2, __pyx_kp_u_Global_XPDF_config_object_Metho) < 0) __PYX_ERR(3, 211, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "src/pyxpdf/pdftotext.pxi":7 @@ -43088,7 +43341,7 @@ if (!__Pyx_RefNanny) { * #FIXME: buggy as hell, text does not render properly. * cdef bytearray splash_bitmap_to_1bpc_1comp(SplashBitmap *bitmap): # <<<<<<<<<<<<<< * cdef: - * int idx, x, y, i + * int idx, y, i */ __Pyx_TraceLine(40,0,__PYX_ERR(9, 40, __pyx_L1_error)) @@ -43392,18 +43645,18 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(374,0,__PYX_ERR(9, 374, __pyx_L1_error)) - /* "src/pyxpdf/imageoutput.pxi":429 + /* "src/pyxpdf/imageoutput.pxi":427 * * * cpdef object get(self, int page_no, crop_box=(0,0,0,0), scale_pixel_box = None): # <<<<<<<<<<<<<< * """Get the rendered :class:`~PIL.Image.Image` for `page_no` indexed page * */ - __Pyx_TraceLine(429,0,__PYX_ERR(9, 429, __pyx_L1_error)) + __Pyx_TraceLine(427,0,__PYX_ERR(9, 427, __pyx_L1_error)) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_14RawImageOutput_3get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RawImageOutput_get, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 429, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_14RawImageOutput_3get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RawImageOutput_get, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem((PyObject *)__pyx_ptype_6pyxpdf_4xpdf_RawImageOutput->tp_dict, __pyx_n_s_get, __pyx_t_1) < 0) __PYX_ERR(9, 429, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pyxpdf_4xpdf_RawImageOutput->tp_dict, __pyx_n_s_get, __pyx_t_1) < 0) __PYX_ERR(9, 427, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_6pyxpdf_4xpdf_RawImageOutput); @@ -43430,247 +43683,247 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(7, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "src/pyxpdf/imageoutput.pxi":479 + /* "src/pyxpdf/imageoutput.pxi":477 * * cdef dict GFX_COLOR_SPACE_NAMES = { * GfxColorSpaceMode.csDeviceGray : u"gray", # <<<<<<<<<<<<<< * GfxColorSpaceMode.csCalGray : u"gray", * GfxColorSpaceMode.csDeviceRGB : u"rgb", */ - __Pyx_TraceLine(479,0,__PYX_ERR(9, 479, __pyx_L1_error)) - __pyx_t_1 = __Pyx_PyDict_NewPresized(10); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 479, __pyx_L1_error) + __Pyx_TraceLine(477,0,__PYX_ERR(9, 477, __pyx_L1_error)) + __pyx_t_1 = __Pyx_PyDict_NewPresized(10); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_From_GfxColorSpaceMode(csDeviceGray); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 479, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_GfxColorSpaceMode(csDeviceGray); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_n_u_gray) < 0) __PYX_ERR(9, 479, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_n_u_gray) < 0) __PYX_ERR(9, 477, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "src/pyxpdf/imageoutput.pxi":480 + /* "src/pyxpdf/imageoutput.pxi":478 * cdef dict GFX_COLOR_SPACE_NAMES = { * GfxColorSpaceMode.csDeviceGray : u"gray", * GfxColorSpaceMode.csCalGray : u"gray", # <<<<<<<<<<<<<< * GfxColorSpaceMode.csDeviceRGB : u"rgb", * GfxColorSpaceMode.csCalRGB : u"rgb", */ - __Pyx_TraceLine(480,0,__PYX_ERR(9, 480, __pyx_L1_error)) - __pyx_t_3 = __Pyx_PyInt_From_GfxColorSpaceMode(csCalGray); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 480, __pyx_L1_error) + __Pyx_TraceLine(478,0,__PYX_ERR(9, 478, __pyx_L1_error)) + __pyx_t_3 = __Pyx_PyInt_From_GfxColorSpaceMode(csCalGray); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_n_u_gray) < 0) __PYX_ERR(9, 479, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_n_u_gray) < 0) __PYX_ERR(9, 477, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "src/pyxpdf/imageoutput.pxi":481 + /* "src/pyxpdf/imageoutput.pxi":479 * GfxColorSpaceMode.csDeviceGray : u"gray", * GfxColorSpaceMode.csCalGray : u"gray", * GfxColorSpaceMode.csDeviceRGB : u"rgb", # <<<<<<<<<<<<<< * GfxColorSpaceMode.csCalRGB : u"rgb", * GfxColorSpaceMode.csDeviceCMYK : u"cmyk", */ - __Pyx_TraceLine(481,0,__PYX_ERR(9, 481, __pyx_L1_error)) - __pyx_t_3 = __Pyx_PyInt_From_GfxColorSpaceMode(csDeviceRGB); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 481, __pyx_L1_error) + __Pyx_TraceLine(479,0,__PYX_ERR(9, 479, __pyx_L1_error)) + __pyx_t_3 = __Pyx_PyInt_From_GfxColorSpaceMode(csDeviceRGB); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_n_u_rgb) < 0) __PYX_ERR(9, 479, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_n_u_rgb) < 0) __PYX_ERR(9, 477, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "src/pyxpdf/imageoutput.pxi":482 + /* "src/pyxpdf/imageoutput.pxi":480 * GfxColorSpaceMode.csCalGray : u"gray", * GfxColorSpaceMode.csDeviceRGB : u"rgb", * GfxColorSpaceMode.csCalRGB : u"rgb", # <<<<<<<<<<<<<< * GfxColorSpaceMode.csDeviceCMYK : u"cmyk", * GfxColorSpaceMode.csLab : u"lab", */ - __Pyx_TraceLine(482,0,__PYX_ERR(9, 482, __pyx_L1_error)) - __pyx_t_3 = __Pyx_PyInt_From_GfxColorSpaceMode(csCalRGB); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 482, __pyx_L1_error) + __Pyx_TraceLine(480,0,__PYX_ERR(9, 480, __pyx_L1_error)) + __pyx_t_3 = __Pyx_PyInt_From_GfxColorSpaceMode(csCalRGB); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_n_u_rgb) < 0) __PYX_ERR(9, 479, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_n_u_rgb) < 0) __PYX_ERR(9, 477, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "src/pyxpdf/imageoutput.pxi":483 + /* "src/pyxpdf/imageoutput.pxi":481 * GfxColorSpaceMode.csDeviceRGB : u"rgb", * GfxColorSpaceMode.csCalRGB : u"rgb", * GfxColorSpaceMode.csDeviceCMYK : u"cmyk", # <<<<<<<<<<<<<< * GfxColorSpaceMode.csLab : u"lab", * GfxColorSpaceMode.csICCBased : u"icc", */ - __Pyx_TraceLine(483,0,__PYX_ERR(9, 483, __pyx_L1_error)) - __pyx_t_3 = __Pyx_PyInt_From_GfxColorSpaceMode(csDeviceCMYK); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 483, __pyx_L1_error) + __Pyx_TraceLine(481,0,__PYX_ERR(9, 481, __pyx_L1_error)) + __pyx_t_3 = __Pyx_PyInt_From_GfxColorSpaceMode(csDeviceCMYK); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_n_u_cmyk) < 0) __PYX_ERR(9, 479, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_n_u_cmyk) < 0) __PYX_ERR(9, 477, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "src/pyxpdf/imageoutput.pxi":484 + /* "src/pyxpdf/imageoutput.pxi":482 * GfxColorSpaceMode.csCalRGB : u"rgb", * GfxColorSpaceMode.csDeviceCMYK : u"cmyk", * GfxColorSpaceMode.csLab : u"lab", # <<<<<<<<<<<<<< * GfxColorSpaceMode.csICCBased : u"icc", * GfxColorSpaceMode.csIndexed : u"index", */ - __Pyx_TraceLine(484,0,__PYX_ERR(9, 484, __pyx_L1_error)) - __pyx_t_3 = __Pyx_PyInt_From_GfxColorSpaceMode(csLab); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 484, __pyx_L1_error) + __Pyx_TraceLine(482,0,__PYX_ERR(9, 482, __pyx_L1_error)) + __pyx_t_3 = __Pyx_PyInt_From_GfxColorSpaceMode(csLab); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_n_u_lab) < 0) __PYX_ERR(9, 479, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_n_u_lab) < 0) __PYX_ERR(9, 477, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "src/pyxpdf/imageoutput.pxi":485 + /* "src/pyxpdf/imageoutput.pxi":483 * GfxColorSpaceMode.csDeviceCMYK : u"cmyk", * GfxColorSpaceMode.csLab : u"lab", * GfxColorSpaceMode.csICCBased : u"icc", # <<<<<<<<<<<<<< * GfxColorSpaceMode.csIndexed : u"index", * GfxColorSpaceMode.csSeparation : u"sep", */ - __Pyx_TraceLine(485,0,__PYX_ERR(9, 485, __pyx_L1_error)) - __pyx_t_3 = __Pyx_PyInt_From_GfxColorSpaceMode(csICCBased); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 485, __pyx_L1_error) + __Pyx_TraceLine(483,0,__PYX_ERR(9, 483, __pyx_L1_error)) + __pyx_t_3 = __Pyx_PyInt_From_GfxColorSpaceMode(csICCBased); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_n_u_icc) < 0) __PYX_ERR(9, 479, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_n_u_icc) < 0) __PYX_ERR(9, 477, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "src/pyxpdf/imageoutput.pxi":486 + /* "src/pyxpdf/imageoutput.pxi":484 * GfxColorSpaceMode.csLab : u"lab", * GfxColorSpaceMode.csICCBased : u"icc", * GfxColorSpaceMode.csIndexed : u"index", # <<<<<<<<<<<<<< * GfxColorSpaceMode.csSeparation : u"sep", * GfxColorSpaceMode.csDeviceN : u"devn", */ - __Pyx_TraceLine(486,0,__PYX_ERR(9, 486, __pyx_L1_error)) - __pyx_t_3 = __Pyx_PyInt_From_GfxColorSpaceMode(csIndexed); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 486, __pyx_L1_error) + __Pyx_TraceLine(484,0,__PYX_ERR(9, 484, __pyx_L1_error)) + __pyx_t_3 = __Pyx_PyInt_From_GfxColorSpaceMode(csIndexed); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_n_u_index) < 0) __PYX_ERR(9, 479, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_n_u_index) < 0) __PYX_ERR(9, 477, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "src/pyxpdf/imageoutput.pxi":487 + /* "src/pyxpdf/imageoutput.pxi":485 * GfxColorSpaceMode.csICCBased : u"icc", * GfxColorSpaceMode.csIndexed : u"index", * GfxColorSpaceMode.csSeparation : u"sep", # <<<<<<<<<<<<<< * GfxColorSpaceMode.csDeviceN : u"devn", * # not including csPattern */ - __Pyx_TraceLine(487,0,__PYX_ERR(9, 487, __pyx_L1_error)) - __pyx_t_3 = __Pyx_PyInt_From_GfxColorSpaceMode(csSeparation); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 487, __pyx_L1_error) + __Pyx_TraceLine(485,0,__PYX_ERR(9, 485, __pyx_L1_error)) + __pyx_t_3 = __Pyx_PyInt_From_GfxColorSpaceMode(csSeparation); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_n_u_sep) < 0) __PYX_ERR(9, 479, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_n_u_sep) < 0) __PYX_ERR(9, 477, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "src/pyxpdf/imageoutput.pxi":488 + /* "src/pyxpdf/imageoutput.pxi":486 * GfxColorSpaceMode.csIndexed : u"index", * GfxColorSpaceMode.csSeparation : u"sep", * GfxColorSpaceMode.csDeviceN : u"devn", # <<<<<<<<<<<<<< * # not including csPattern * #GfxColorSpaceMode.csPattern : u"" */ - __Pyx_TraceLine(488,0,__PYX_ERR(9, 488, __pyx_L1_error)) - __pyx_t_3 = __Pyx_PyInt_From_GfxColorSpaceMode(csDeviceN); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 488, __pyx_L1_error) + __Pyx_TraceLine(486,0,__PYX_ERR(9, 486, __pyx_L1_error)) + __pyx_t_3 = __Pyx_PyInt_From_GfxColorSpaceMode(csDeviceN); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_n_u_devn) < 0) __PYX_ERR(9, 479, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_n_u_devn) < 0) __PYX_ERR(9, 477, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_v_6pyxpdf_4xpdf_GFX_COLOR_SPACE_NAMES); __Pyx_DECREF_SET(__pyx_v_6pyxpdf_4xpdf_GFX_COLOR_SPACE_NAMES, ((PyObject*)__pyx_t_1)); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "src/pyxpdf/imageoutput.pxi":494 + /* "src/pyxpdf/imageoutput.pxi":492 * * cdef dict IMAGE_STREAM_TYPES = { * StreamKind.strCCITTFax : u"ccitt", # <<<<<<<<<<<<<< * StreamKind.strDCT : u"jpeg", * StreamKind.strJPX : u"jpx", */ - __Pyx_TraceLine(494,0,__PYX_ERR(9, 494, __pyx_L1_error)) - __pyx_t_1 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 494, __pyx_L1_error) + __Pyx_TraceLine(492,0,__PYX_ERR(9, 492, __pyx_L1_error)) + __pyx_t_1 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 492, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_From_StreamKind(strCCITTFax); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 494, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_StreamKind(strCCITTFax); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 492, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_n_u_ccitt) < 0) __PYX_ERR(9, 494, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_n_u_ccitt) < 0) __PYX_ERR(9, 492, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "src/pyxpdf/imageoutput.pxi":495 + /* "src/pyxpdf/imageoutput.pxi":493 * cdef dict IMAGE_STREAM_TYPES = { * StreamKind.strCCITTFax : u"ccitt", * StreamKind.strDCT : u"jpeg", # <<<<<<<<<<<<<< * StreamKind.strJPX : u"jpx", * StreamKind.strJBIG2 : u"jbig2", */ - __Pyx_TraceLine(495,0,__PYX_ERR(9, 495, __pyx_L1_error)) - __pyx_t_3 = __Pyx_PyInt_From_StreamKind(strDCT); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 495, __pyx_L1_error) + __Pyx_TraceLine(493,0,__PYX_ERR(9, 493, __pyx_L1_error)) + __pyx_t_3 = __Pyx_PyInt_From_StreamKind(strDCT); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_n_u_jpeg) < 0) __PYX_ERR(9, 494, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_n_u_jpeg) < 0) __PYX_ERR(9, 492, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "src/pyxpdf/imageoutput.pxi":496 + /* "src/pyxpdf/imageoutput.pxi":494 * StreamKind.strCCITTFax : u"ccitt", * StreamKind.strDCT : u"jpeg", * StreamKind.strJPX : u"jpx", # <<<<<<<<<<<<<< * StreamKind.strJBIG2 : u"jbig2", * StreamKind.strFlate : u"flate", */ - __Pyx_TraceLine(496,0,__PYX_ERR(9, 496, __pyx_L1_error)) - __pyx_t_3 = __Pyx_PyInt_From_StreamKind(strJPX); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 496, __pyx_L1_error) + __Pyx_TraceLine(494,0,__PYX_ERR(9, 494, __pyx_L1_error)) + __pyx_t_3 = __Pyx_PyInt_From_StreamKind(strJPX); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_n_u_jpx) < 0) __PYX_ERR(9, 494, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_n_u_jpx) < 0) __PYX_ERR(9, 492, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "src/pyxpdf/imageoutput.pxi":497 + /* "src/pyxpdf/imageoutput.pxi":495 * StreamKind.strDCT : u"jpeg", * StreamKind.strJPX : u"jpx", * StreamKind.strJBIG2 : u"jbig2", # <<<<<<<<<<<<<< * StreamKind.strFlate : u"flate", * StreamKind.strLZW : u"lzw", */ - __Pyx_TraceLine(497,0,__PYX_ERR(9, 497, __pyx_L1_error)) - __pyx_t_3 = __Pyx_PyInt_From_StreamKind(strJBIG2); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 497, __pyx_L1_error) + __Pyx_TraceLine(495,0,__PYX_ERR(9, 495, __pyx_L1_error)) + __pyx_t_3 = __Pyx_PyInt_From_StreamKind(strJBIG2); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_n_u_jbig2) < 0) __PYX_ERR(9, 494, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_n_u_jbig2) < 0) __PYX_ERR(9, 492, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "src/pyxpdf/imageoutput.pxi":498 + /* "src/pyxpdf/imageoutput.pxi":496 * StreamKind.strJPX : u"jpx", * StreamKind.strJBIG2 : u"jbig2", * StreamKind.strFlate : u"flate", # <<<<<<<<<<<<<< * StreamKind.strLZW : u"lzw", * StreamKind.strRunLength : u"rle", */ - __Pyx_TraceLine(498,0,__PYX_ERR(9, 498, __pyx_L1_error)) - __pyx_t_3 = __Pyx_PyInt_From_StreamKind(strFlate); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 498, __pyx_L1_error) + __Pyx_TraceLine(496,0,__PYX_ERR(9, 496, __pyx_L1_error)) + __pyx_t_3 = __Pyx_PyInt_From_StreamKind(strFlate); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_n_u_flate) < 0) __PYX_ERR(9, 494, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_n_u_flate) < 0) __PYX_ERR(9, 492, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "src/pyxpdf/imageoutput.pxi":499 + /* "src/pyxpdf/imageoutput.pxi":497 * StreamKind.strJBIG2 : u"jbig2", * StreamKind.strFlate : u"flate", * StreamKind.strLZW : u"lzw", # <<<<<<<<<<<<<< * StreamKind.strRunLength : u"rle", * } */ - __Pyx_TraceLine(499,0,__PYX_ERR(9, 499, __pyx_L1_error)) - __pyx_t_3 = __Pyx_PyInt_From_StreamKind(strLZW); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 499, __pyx_L1_error) + __Pyx_TraceLine(497,0,__PYX_ERR(9, 497, __pyx_L1_error)) + __pyx_t_3 = __Pyx_PyInt_From_StreamKind(strLZW); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_n_u_lzw) < 0) __PYX_ERR(9, 494, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_n_u_lzw) < 0) __PYX_ERR(9, 492, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "src/pyxpdf/imageoutput.pxi":500 + /* "src/pyxpdf/imageoutput.pxi":498 * StreamKind.strFlate : u"flate", * StreamKind.strLZW : u"lzw", * StreamKind.strRunLength : u"rle", # <<<<<<<<<<<<<< * } * */ - __Pyx_TraceLine(500,0,__PYX_ERR(9, 500, __pyx_L1_error)) - __pyx_t_3 = __Pyx_PyInt_From_StreamKind(strRunLength); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 500, __pyx_L1_error) + __Pyx_TraceLine(498,0,__PYX_ERR(9, 498, __pyx_L1_error)) + __pyx_t_3 = __Pyx_PyInt_From_StreamKind(strRunLength); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_n_u_rle) < 0) __PYX_ERR(9, 494, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_n_u_rle) < 0) __PYX_ERR(9, 492, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_v_6pyxpdf_4xpdf_IMAGE_STREAM_TYPES); __Pyx_DECREF_SET(__pyx_v_6pyxpdf_4xpdf_IMAGE_STREAM_TYPES, ((PyObject*)__pyx_t_1)); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "src/pyxpdf/imageoutput.pxi":566 + /* "src/pyxpdf/imageoutput.pxi":564 * * @staticmethod * cdef PDFImage from_ptr(PDFBitmapImage *c_img): # <<<<<<<<<<<<<< * cdef: * PDFImage img = PDFImage.__new__(PDFImage) */ - __Pyx_TraceLine(566,0,__PYX_ERR(9, 566, __pyx_L1_error)) + __Pyx_TraceLine(564,0,__PYX_ERR(9, 564, __pyx_L1_error)) /* "(tree fragment)":1 @@ -43679,7 +43932,7 @@ if (!__Pyx_RefNanny) { * cdef object _dict */ __Pyx_TraceLine(1,0,__PYX_ERR(7, 1, __pyx_L1_error)) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_8PDFImage_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PDFImage___reduce_cython, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__66)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_8PDFImage_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PDFImage___reduce_cython, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__67)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem((PyObject *)__pyx_ptype_6pyxpdf_4xpdf_PDFImage->tp_dict, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -43692,7 +43945,7 @@ if (!__Pyx_RefNanny) { * __pyx_unpickle_PDFImage__set_state(self, __pyx_state) */ __Pyx_TraceLine(16,0,__PYX_ERR(7, 16, __pyx_L1_error)) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_8PDFImage_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PDFImage___setstate_cython, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__67)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 16, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_8PDFImage_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PDFImage___setstate_cython, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__68)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem((PyObject *)__pyx_ptype_6pyxpdf_4xpdf_PDFImage->tp_dict, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(7, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -43727,7 +43980,7 @@ if (!__Pyx_RefNanny) { */ __Pyx_TraceLine(661,0,__PYX_ERR(9, 661, __pyx_L1_error)) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_14PDFImageOutput_3get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PDFImageOutput_get, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__68)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 661, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_14PDFImageOutput_3get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PDFImageOutput_get, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__69)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 661, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem((PyObject *)__pyx_ptype_6pyxpdf_4xpdf_PDFImageOutput->tp_dict, __pyx_n_s_get, __pyx_t_1) < 0) __PYX_ERR(9, 661, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -43739,7 +43992,7 @@ if (!__Pyx_RefNanny) { * def __setstate_cython__(self, __pyx_state): */ __Pyx_TraceLine(1,0,__PYX_ERR(7, 1, __pyx_L1_error)) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_14PDFImageOutput_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PDFImageOutput___reduce_cython, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__69)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_14PDFImageOutput_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PDFImageOutput___reduce_cython, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -43751,177 +44004,177 @@ if (!__Pyx_RefNanny) { * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __Pyx_TraceLine(3,0,__PYX_ERR(7, 3, __pyx_L1_error)) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_14PDFImageOutput_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PDFImageOutput___setstate_cython, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 3, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_14PDFImageOutput_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PDFImageOutput___setstate_cython, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(7, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "src/pyxpdf/document.pxi":152 + /* "src/pyxpdf/document.pxi":158 * * * cdef Catalog *get_catalog(self): # <<<<<<<<<<<<<< * return self.doc.getCatalog() * */ - __Pyx_TraceLine(152,0,__PYX_ERR(6, 152, __pyx_L1_error)) + __Pyx_TraceLine(158,0,__PYX_ERR(6, 158, __pyx_L1_error)) - /* "src/pyxpdf/document.pxi":155 + /* "src/pyxpdf/document.pxi":161 * return self.doc.getCatalog() * - * cdef display_pages(self, OutputDev* out, int first, int end, # <<<<<<<<<<<<<< + * cdef display_pages(self, OutputDev* out, int first = 0, int end = -1, # <<<<<<<<<<<<<< * double hDPI = 72, double vDPI = 72, int rotate = 0, * GBool use_media_box = gFalse, GBool crop = gTrue, */ - __Pyx_TraceLine(155,0,__PYX_ERR(6, 155, __pyx_L1_error)) + __Pyx_TraceLine(161,0,__PYX_ERR(6, 161, __pyx_L1_error)) - /* "src/pyxpdf/document.pxi":157 - * cdef display_pages(self, OutputDev* out, int first, int end, + /* "src/pyxpdf/document.pxi":163 + * cdef display_pages(self, OutputDev* out, int first = 0, int end = -1, * double hDPI = 72, double vDPI = 72, int rotate = 0, * GBool use_media_box = gFalse, GBool crop = gTrue, # <<<<<<<<<<<<<< * GBool printing = gFalse): - * if first < 0 or first >= self.num_pages: + * if first < 0 or first >= self.doc.getNumPages(): */ - __Pyx_TraceLine(157,0,__PYX_ERR(6, 157, __pyx_L1_error)) - __pyx_k__75 = gFalse; - __pyx_k__76 = gTrue; + __Pyx_TraceLine(163,0,__PYX_ERR(6, 163, __pyx_L1_error)) + __pyx_k__76 = gFalse; + __pyx_k__77 = gTrue; - /* "src/pyxpdf/document.pxi":158 + /* "src/pyxpdf/document.pxi":164 * double hDPI = 72, double vDPI = 72, int rotate = 0, * GBool use_media_box = gFalse, GBool crop = gTrue, * GBool printing = gFalse): # <<<<<<<<<<<<<< - * if first < 0 or first >= self.num_pages: + * if first < 0 or first >= self.doc.getNumPages(): * first = 0 */ - __Pyx_TraceLine(158,0,__PYX_ERR(6, 158, __pyx_L1_error)) - __pyx_k__77 = gFalse; + __Pyx_TraceLine(164,0,__PYX_ERR(6, 164, __pyx_L1_error)) + __pyx_k__78 = gFalse; - /* "src/pyxpdf/document.pxi":166 - * use_media_box, crop, printing) + /* "src/pyxpdf/document.pxi":176 + * use_media_box, crop, printing) * * cdef dict get_info_dict(self): # <<<<<<<<<<<<<< * cdef: * Object info */ - __Pyx_TraceLine(166,0,__PYX_ERR(6, 166, __pyx_L1_error)) + __Pyx_TraceLine(176,0,__PYX_ERR(6, 176, __pyx_L1_error)) - /* "src/pyxpdf/document.pxi":175 + /* "src/pyxpdf/document.pxi":185 * return result * * cdef get_metadata(self): # <<<<<<<<<<<<<< * cdef unique_ptr[GString] meta * meta.reset(self.doc.readMetadata()) */ - __Pyx_TraceLine(175,0,__PYX_ERR(6, 175, __pyx_L1_error)) + __Pyx_TraceLine(185,0,__PYX_ERR(6, 185, __pyx_L1_error)) - /* "src/pyxpdf/document.pxi":182 + /* "src/pyxpdf/document.pxi":192 * return None * * cdef _load_from_file(self, GString *pdf): # <<<<<<<<<<<<<< * self.doc = new PDFDoc(pdf, self.ownerpass, self.userpass) * if self.doc == NULL: */ - __Pyx_TraceLine(182,0,__PYX_ERR(6, 182, __pyx_L1_error)) + __Pyx_TraceLine(192,0,__PYX_ERR(6, 192, __pyx_L1_error)) - /* "src/pyxpdf/document.pxi":187 + /* "src/pyxpdf/document.pxi":197 * raise MemoryError("Cannot allocate memory for internal objects") * * cdef _load_from_char_array(self, char *pdf, int data_length): # <<<<<<<<<<<<<< * cdef: * Object *obj_null */ - __Pyx_TraceLine(187,0,__PYX_ERR(6, 187, __pyx_L1_error)) + __Pyx_TraceLine(197,0,__PYX_ERR(6, 197, __pyx_L1_error)) - /* "src/pyxpdf/document.pxi":201 + /* "src/pyxpdf/document.pxi":211 * del obj_null * * cdef check(self): # <<<<<<<<<<<<<< * if self.doc.isOk() == gTrue or self.doc.getErrorCode() == errEncrypted: * if self.doc.getErrorCode() == errEncrypted: */ - __Pyx_TraceLine(201,0,__PYX_ERR(6, 201, __pyx_L1_error)) + __Pyx_TraceLine(211,0,__PYX_ERR(6, 211, __pyx_L1_error)) - /* "src/pyxpdf/document.pxi":211 + /* "src/pyxpdf/document.pxi":221 * raise ErrorCodeMapping[err_code] * * cdef int label_to_index(self, label): # <<<<<<<<<<<<<< * cdef: * int pgno */ - __Pyx_TraceLine(211,0,__PYX_ERR(6, 211, __pyx_L1_error)) + __Pyx_TraceLine(221,0,__PYX_ERR(6, 221, __pyx_L1_error)) - /* "src/pyxpdf/document.pxi":223 + /* "src/pyxpdf/document.pxi":233 * return pgno * * cdef get_page(self, int idx): # <<<<<<<<<<<<<< * if idx < 0 or idx >= self.num_pages: * raise IndexError( */ - __Pyx_TraceLine(223,0,__PYX_ERR(6, 223, __pyx_L1_error)) + __Pyx_TraceLine(233,0,__PYX_ERR(6, 233, __pyx_L1_error)) - /* "src/pyxpdf/document.pxi":319 + /* "src/pyxpdf/document.pxi":329 * * * def info(self): # <<<<<<<<<<<<<< * """Get the PDF's info dictionary. * */ - __Pyx_TraceLine(319,0,__PYX_ERR(6, 319, __pyx_L1_error)) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_8Document_17info, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Document_info, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 319, __pyx_L1_error) + __Pyx_TraceLine(329,0,__PYX_ERR(6, 329, __pyx_L1_error)) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_8Document_17info, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Document_info, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__81)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem((PyObject *)__pyx_ptype_6pyxpdf_4xpdf_Document->tp_dict, __pyx_n_s_info, __pyx_t_1) < 0) __PYX_ERR(6, 319, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pyxpdf_4xpdf_Document->tp_dict, __pyx_n_s_info, __pyx_t_1) < 0) __PYX_ERR(6, 329, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_6pyxpdf_4xpdf_Document); - /* "src/pyxpdf/document.pxi":332 + /* "src/pyxpdf/document.pxi":342 * return self.get_info_dict() * * def xmp_metadata(self): # <<<<<<<<<<<<<< * """Get the PDF's xmp metadata. * */ - __Pyx_TraceLine(332,0,__PYX_ERR(6, 332, __pyx_L1_error)) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_8Document_19xmp_metadata, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Document_xmp_metadata, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__81)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 332, __pyx_L1_error) + __Pyx_TraceLine(342,0,__PYX_ERR(6, 342, __pyx_L1_error)) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_8Document_19xmp_metadata, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Document_xmp_metadata, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__82)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem((PyObject *)__pyx_ptype_6pyxpdf_4xpdf_Document->tp_dict, __pyx_n_s_xmp_metadata, __pyx_t_1) < 0) __PYX_ERR(6, 332, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pyxpdf_4xpdf_Document->tp_dict, __pyx_n_s_xmp_metadata, __pyx_t_1) < 0) __PYX_ERR(6, 342, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_6pyxpdf_4xpdf_Document); - /* "src/pyxpdf/document.pxi":342 + /* "src/pyxpdf/document.pxi":352 * * * cpdef text_bytes(self, int start=0, int end=-1, TextControl control=None): # <<<<<<<<<<<<<< * """Parse and extract text from given page range. * */ - __Pyx_TraceLine(342,0,__PYX_ERR(6, 342, __pyx_L1_error)) + __Pyx_TraceLine(352,0,__PYX_ERR(6, 352, __pyx_L1_error)) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_8Document_21text_bytes, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Document_text_bytes, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__82)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 342, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_8Document_21text_bytes, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Document_text_bytes, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem((PyObject *)__pyx_ptype_6pyxpdf_4xpdf_Document->tp_dict, __pyx_n_s_text_bytes, __pyx_t_1) < 0) __PYX_ERR(6, 342, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pyxpdf_4xpdf_Document->tp_dict, __pyx_n_s_text_bytes, __pyx_t_1) < 0) __PYX_ERR(6, 352, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_6pyxpdf_4xpdf_Document); - /* "src/pyxpdf/document.pxi":384 + /* "src/pyxpdf/document.pxi":394 * return deref(out) * * cpdef text(self, start=0, end=-1, control=None): # <<<<<<<<<<<<<< * """Parse and extract UTF-8 decoded text from given page range. * */ - __Pyx_TraceLine(384,0,__PYX_ERR(6, 384, __pyx_L1_error)) + __Pyx_TraceLine(394,0,__PYX_ERR(6, 394, __pyx_L1_error)) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_8Document_23text, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Document_text, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 384, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_8Document_23text, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Document_text, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__84)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem((PyObject *)__pyx_ptype_6pyxpdf_4xpdf_Document->tp_dict, __pyx_n_s_text, __pyx_t_1) < 0) __PYX_ERR(6, 384, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pyxpdf_4xpdf_Document->tp_dict, __pyx_n_s_text, __pyx_t_1) < 0) __PYX_ERR(6, 394, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_6pyxpdf_4xpdf_Document); @@ -43931,7 +44184,7 @@ if (!__Pyx_RefNanny) { * def __setstate_cython__(self, __pyx_state): */ __Pyx_TraceLine(1,0,__PYX_ERR(7, 1, __pyx_L1_error)) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_8Document_25__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Document___reduce_cython, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__84)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_8Document_25__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Document___reduce_cython, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__85)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -43943,7 +44196,7 @@ if (!__Pyx_RefNanny) { * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __Pyx_TraceLine(3,0,__PYX_ERR(7, 3, __pyx_L1_error)) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_8Document_27__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Document___setstate_cython, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__86)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 3, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_8Document_27__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Document___setstate_cython, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(7, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -43954,7 +44207,7 @@ if (!__Pyx_RefNanny) { * cdef object _dict */ __Pyx_TraceLine(1,0,__PYX_ERR(7, 1, __pyx_L1_error)) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_20DocumentPageIterator_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DocumentPageIterator___reduce_cy, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__88)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_20DocumentPageIterator_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DocumentPageIterator___reduce_cy, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__89)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem((PyObject *)__pyx_ptype_6pyxpdf_4xpdf_DocumentPageIterator->tp_dict, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -43967,157 +44220,157 @@ if (!__Pyx_RefNanny) { * __pyx_unpickle_DocumentPageIterator__set_state(self, __pyx_state) */ __Pyx_TraceLine(16,0,__PYX_ERR(7, 16, __pyx_L1_error)) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_20DocumentPageIterator_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DocumentPageIterator___setstate, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__89)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 16, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_20DocumentPageIterator_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DocumentPageIterator___setstate, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__90)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem((PyObject *)__pyx_ptype_6pyxpdf_4xpdf_DocumentPageIterator->tp_dict, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(7, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_6pyxpdf_4xpdf_DocumentPageIterator); - /* "src/pyxpdf/document.pxi":522 + /* "src/pyxpdf/document.pxi":532 * * * cdef display_slice(self, OutputDev* out, int x1, int y1, int hgt, int wdt, # <<<<<<<<<<<<<< * double hDPI = 72, double vDPI = 72, int rotate = 0, * GBool use_media_box = gFalse, GBool crop = gTrue, */ - __Pyx_TraceLine(522,0,__PYX_ERR(6, 522, __pyx_L1_error)) + __Pyx_TraceLine(532,0,__PYX_ERR(6, 532, __pyx_L1_error)) - /* "src/pyxpdf/document.pxi":524 + /* "src/pyxpdf/document.pxi":534 * cdef display_slice(self, OutputDev* out, int x1, int y1, int hgt, int wdt, * double hDPI = 72, double vDPI = 72, int rotate = 0, * GBool use_media_box = gFalse, GBool crop = gTrue, # <<<<<<<<<<<<<< * GBool printing = gFalse): * self.page.displaySlice(out, hDPI, vDPI, rotate, use_media_box, crop, */ - __Pyx_TraceLine(524,0,__PYX_ERR(6, 524, __pyx_L1_error)) - __pyx_k__91 = gFalse; - __pyx_k__92 = gTrue; + __Pyx_TraceLine(534,0,__PYX_ERR(6, 534, __pyx_L1_error)) + __pyx_k__92 = gFalse; + __pyx_k__93 = gTrue; - /* "src/pyxpdf/document.pxi":525 + /* "src/pyxpdf/document.pxi":535 * double hDPI = 72, double vDPI = 72, int rotate = 0, * GBool use_media_box = gFalse, GBool crop = gTrue, * GBool printing = gFalse): # <<<<<<<<<<<<<< * self.page.displaySlice(out, hDPI, vDPI, rotate, use_media_box, crop, * x1, y1, hgt, wdt, printing) */ - __Pyx_TraceLine(525,0,__PYX_ERR(6, 525, __pyx_L1_error)) - __pyx_k__93 = gFalse; + __Pyx_TraceLine(535,0,__PYX_ERR(6, 535, __pyx_L1_error)) + __pyx_k__94 = gFalse; - /* "src/pyxpdf/document.pxi":529 + /* "src/pyxpdf/document.pxi":539 * x1, y1, hgt, wdt, printing) * * cdef display(self, OutputDev* out, double hDPI = 72, double vDPI = 72, # <<<<<<<<<<<<<< * int rotate = 0, GBool use_media_box = gFalse, * GBool crop = gTrue, GBool printing = gFalse): */ - __Pyx_TraceLine(529,0,__PYX_ERR(6, 529, __pyx_L1_error)) + __Pyx_TraceLine(539,0,__PYX_ERR(6, 539, __pyx_L1_error)) - /* "src/pyxpdf/document.pxi":530 + /* "src/pyxpdf/document.pxi":540 * * cdef display(self, OutputDev* out, double hDPI = 72, double vDPI = 72, * int rotate = 0, GBool use_media_box = gFalse, # <<<<<<<<<<<<<< * GBool crop = gTrue, GBool printing = gFalse): * self.display_slice(out, -1, -1, -1, -1, hDPI, vDPI, rotate, */ - __Pyx_TraceLine(530,0,__PYX_ERR(6, 530, __pyx_L1_error)) - __pyx_k__94 = gFalse; + __Pyx_TraceLine(540,0,__PYX_ERR(6, 540, __pyx_L1_error)) + __pyx_k__95 = gFalse; - /* "src/pyxpdf/document.pxi":531 + /* "src/pyxpdf/document.pxi":541 * cdef display(self, OutputDev* out, double hDPI = 72, double vDPI = 72, * int rotate = 0, GBool use_media_box = gFalse, * GBool crop = gTrue, GBool printing = gFalse): # <<<<<<<<<<<<<< * self.display_slice(out, -1, -1, -1, -1, hDPI, vDPI, rotate, * use_media_box, crop, printing) */ - __Pyx_TraceLine(531,0,__PYX_ERR(6, 531, __pyx_L1_error)) - __pyx_k__95 = gTrue; - __pyx_k__96 = gFalse; + __Pyx_TraceLine(541,0,__PYX_ERR(6, 541, __pyx_L1_error)) + __pyx_k__96 = gTrue; + __pyx_k__97 = gFalse; - /* "src/pyxpdf/document.pxi":535 + /* "src/pyxpdf/document.pxi":545 * use_media_box, crop, printing) * * cdef _init_TextPage(self, int rotation): # <<<<<<<<<<<<<< * cdef: * unique_ptr[TextOutputControl] text_control */ - __Pyx_TraceLine(535,0,__PYX_ERR(6, 535, __pyx_L1_error)) + __Pyx_TraceLine(545,0,__PYX_ERR(6, 545, __pyx_L1_error)) - /* "src/pyxpdf/document.pxi":546 + /* "src/pyxpdf/document.pxi":556 * self.textpage.reset(deref(td).takeText()) * * cdef get_label(self): # <<<<<<<<<<<<<< * cdef: * unique_ptr[GString] glabel */ - __Pyx_TraceLine(546,0,__PYX_ERR(6, 546, __pyx_L1_error)) + __Pyx_TraceLine(556,0,__PYX_ERR(6, 556, __pyx_L1_error)) - /* "src/pyxpdf/document.pxi":560 + /* "src/pyxpdf/document.pxi":570 * return None * * cdef _find_text(self, text, search_box=None, start_at_top=True, stop_at_bottom=True, start_at_last=False, # <<<<<<<<<<<<<< * stop_at_last=False, case_sensitive=False, backward=False, wholeword=False, rotation=0): * cdef double x_min = 0 */ - __Pyx_TraceLine(560,0,__PYX_ERR(6, 560, __pyx_L1_error)) + __Pyx_TraceLine(570,0,__PYX_ERR(6, 570, __pyx_L1_error)) - /* "src/pyxpdf/document.pxi":657 + /* "src/pyxpdf/document.pxi":667 * * * def find_text(self, text, search_box=None, direction="top", case_sensitive=False, # <<<<<<<<<<<<<< * wholeword=False, rotation=0): * """Find the text in Page. */ - __Pyx_TraceLine(657,0,__PYX_ERR(6, 657, __pyx_L1_error)) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_4Page_7find_text, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Page_find_text, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__97)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 657, __pyx_L1_error) + __Pyx_TraceLine(667,0,__PYX_ERR(6, 667, __pyx_L1_error)) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_4Page_7find_text, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Page_find_text, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__98)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 667, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem((PyObject *)__pyx_ptype_6pyxpdf_4xpdf_Page->tp_dict, __pyx_n_s_find_text, __pyx_t_1) < 0) __PYX_ERR(6, 657, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pyxpdf_4xpdf_Page->tp_dict, __pyx_n_s_find_text, __pyx_t_1) < 0) __PYX_ERR(6, 667, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_6pyxpdf_4xpdf_Page); - /* "src/pyxpdf/document.pxi":713 + /* "src/pyxpdf/document.pxi":723 * * * def find_all_text(self, text, search_box=None, case_sensitive=False, wholeword=False, # <<<<<<<<<<<<<< * rotation=0): * """Find the `text` and get all the matches */ - __Pyx_TraceLine(713,0,__PYX_ERR(6, 713, __pyx_L1_error)) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_4Page_9find_all_text, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Page_find_all_text, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__98)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 713, __pyx_L1_error) + __Pyx_TraceLine(723,0,__PYX_ERR(6, 723, __pyx_L1_error)) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_4Page_9find_all_text, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Page_find_all_text, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem((PyObject *)__pyx_ptype_6pyxpdf_4xpdf_Page->tp_dict, __pyx_n_s_find_all_text, __pyx_t_1) < 0) __PYX_ERR(6, 713, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pyxpdf_4xpdf_Page->tp_dict, __pyx_n_s_find_all_text, __pyx_t_1) < 0) __PYX_ERR(6, 723, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_6pyxpdf_4xpdf_Page); - /* "src/pyxpdf/document.pxi":745 + /* "src/pyxpdf/document.pxi":755 * * * def text_bytes(self, page_area=None, TextControl control = None): # <<<<<<<<<<<<<< * """Parse and extract text bytes from current page. * */ - __Pyx_TraceLine(745,0,__PYX_ERR(6, 745, __pyx_L1_error)) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_4Page_12text_bytes, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Page_text_bytes, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 745, __pyx_L1_error) + __Pyx_TraceLine(755,0,__PYX_ERR(6, 755, __pyx_L1_error)) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_4Page_12text_bytes, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Page_text_bytes, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__100)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 755, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem((PyObject *)__pyx_ptype_6pyxpdf_4xpdf_Page->tp_dict, __pyx_n_s_text_bytes, __pyx_t_1) < 0) __PYX_ERR(6, 745, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pyxpdf_4xpdf_Page->tp_dict, __pyx_n_s_text_bytes, __pyx_t_1) < 0) __PYX_ERR(6, 755, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_6pyxpdf_4xpdf_Page); - /* "src/pyxpdf/document.pxi":792 + /* "src/pyxpdf/document.pxi":802 * * * def text(self, page_area=None, control=None): # <<<<<<<<<<<<<< * """Parse and extract UTF-8 decoded text from current page. * */ - __Pyx_TraceLine(792,0,__PYX_ERR(6, 792, __pyx_L1_error)) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_4Page_14text, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Page_text, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__100)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 792, __pyx_L1_error) + __Pyx_TraceLine(802,0,__PYX_ERR(6, 802, __pyx_L1_error)) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_4Page_14text, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Page_text, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 802, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem((PyObject *)__pyx_ptype_6pyxpdf_4xpdf_Page->tp_dict, __pyx_n_s_text, __pyx_t_1) < 0) __PYX_ERR(6, 792, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pyxpdf_4xpdf_Page->tp_dict, __pyx_n_s_text, __pyx_t_1) < 0) __PYX_ERR(6, 802, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_6pyxpdf_4xpdf_Page); @@ -44127,7 +44380,7 @@ if (!__Pyx_RefNanny) { * def __setstate_cython__(self, __pyx_state): */ __Pyx_TraceLine(1,0,__PYX_ERR(7, 1, __pyx_L1_error)) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_4Page_16__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Page___reduce_cython, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_4Page_16__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Page___reduce_cython, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__102)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -44139,7 +44392,7 @@ if (!__Pyx_RefNanny) { * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __Pyx_TraceLine(3,0,__PYX_ERR(7, 3, __pyx_L1_error)) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_4Page_18__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Page___setstate_cython, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__103)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 3, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_4Page_18__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Page___setstate_cython, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__104)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(7, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -44150,7 +44403,7 @@ if (!__Pyx_RefNanny) { * cdef object _dict */ __Pyx_TraceLine(1,0,__PYX_ERR(7, 1, __pyx_L1_error)) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_13page_iterator_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_page_iterator___reduce_cython, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__105)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_13page_iterator_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_page_iterator___reduce_cython, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__106)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem((PyObject *)__pyx_ptype_6pyxpdf_4xpdf_page_iterator->tp_dict, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -44163,7 +44416,7 @@ if (!__Pyx_RefNanny) { * __pyx_unpickle_page_iterator__set_state(self, __pyx_state) */ __Pyx_TraceLine(16,0,__PYX_ERR(7, 16, __pyx_L1_error)) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_13page_iterator_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_page_iterator___setstate_cython, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__106)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 16, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_13page_iterator_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_page_iterator___setstate_cython, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__107)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem((PyObject *)__pyx_ptype_6pyxpdf_4xpdf_page_iterator->tp_dict, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(7, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -44175,7 +44428,7 @@ if (!__Pyx_RefNanny) { * cdef object __pyx_result */ __Pyx_TraceLine(1,0,__PYX_ERR(7, 1, __pyx_L1_error)) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_3__pyx_unpickle_PDFError, 0, __pyx_n_s_pyx_unpickle_PDFError, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__107)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_3__pyx_unpickle_PDFError, 0, __pyx_n_s_pyx_unpickle_PDFError, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__108)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_PDFError, __pyx_t_1) < 0) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -44196,7 +44449,7 @@ if (!__Pyx_RefNanny) { * cdef object __pyx_result */ __Pyx_TraceLine(1,0,__PYX_ERR(7, 1, __pyx_L1_error)) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_5__pyx_unpickle_XPDFError, 0, __pyx_n_s_pyx_unpickle_XPDFError, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__108)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_5__pyx_unpickle_XPDFError, 0, __pyx_n_s_pyx_unpickle_XPDFError, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_XPDFError, __pyx_t_1) < 0) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -44217,7 +44470,7 @@ if (!__Pyx_RefNanny) { * cdef object __pyx_result */ __Pyx_TraceLine(1,0,__PYX_ERR(7, 1, __pyx_L1_error)) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_7__pyx_unpickle_PDFSyntaxError, 0, __pyx_n_s_pyx_unpickle_PDFSyntaxError, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_7__pyx_unpickle_PDFSyntaxError, 0, __pyx_n_s_pyx_unpickle_PDFSyntaxError, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__110)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_PDFSyntaxError, __pyx_t_1) < 0) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -44238,7 +44491,7 @@ if (!__Pyx_RefNanny) { * cdef object __pyx_result */ __Pyx_TraceLine(1,0,__PYX_ERR(7, 1, __pyx_L1_error)) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_9__pyx_unpickle_XPDFConfigError, 0, __pyx_n_s_pyx_unpickle_XPDFConfigError, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__110)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_9__pyx_unpickle_XPDFConfigError, 0, __pyx_n_s_pyx_unpickle_XPDFConfigError, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__111)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_XPDFConfigError, __pyx_t_1) < 0) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -44259,7 +44512,7 @@ if (!__Pyx_RefNanny) { * cdef object __pyx_result */ __Pyx_TraceLine(1,0,__PYX_ERR(7, 1, __pyx_L1_error)) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_11__pyx_unpickle_PDFIOError, 0, __pyx_n_s_pyx_unpickle_PDFIOError, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__111)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_11__pyx_unpickle_PDFIOError, 0, __pyx_n_s_pyx_unpickle_PDFIOError, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__112)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_PDFIOError, __pyx_t_1) < 0) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -44280,7 +44533,7 @@ if (!__Pyx_RefNanny) { * cdef object __pyx_result */ __Pyx_TraceLine(1,0,__PYX_ERR(7, 1, __pyx_L1_error)) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_13__pyx_unpickle_PDFPermissionError, 0, __pyx_n_s_pyx_unpickle_PDFPermissionErro, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__112)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_13__pyx_unpickle_PDFPermissionError, 0, __pyx_n_s_pyx_unpickle_PDFPermissionErro, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__113)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_PDFPermissionErro, __pyx_t_1) < 0) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -44301,7 +44554,7 @@ if (!__Pyx_RefNanny) { * cdef object __pyx_result */ __Pyx_TraceLine(1,0,__PYX_ERR(7, 1, __pyx_L1_error)) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_15__pyx_unpickle_XPDFInternalError, 0, __pyx_n_s_pyx_unpickle_XPDFInternalError, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__113)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_15__pyx_unpickle_XPDFInternalError, 0, __pyx_n_s_pyx_unpickle_XPDFInternalError, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__114)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_XPDFInternalError, __pyx_t_1) < 0) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -44322,7 +44575,7 @@ if (!__Pyx_RefNanny) { * cdef object __pyx_result */ __Pyx_TraceLine(1,0,__PYX_ERR(7, 1, __pyx_L1_error)) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_17__pyx_unpickle_XPDFNotInplementedError, 0, __pyx_n_s_pyx_unpickle_XPDFNotInplemente, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__114)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_17__pyx_unpickle_XPDFNotInplementedError, 0, __pyx_n_s_pyx_unpickle_XPDFNotInplemente, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__115)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_XPDFNotInplemente, __pyx_t_1) < 0) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -44343,7 +44596,7 @@ if (!__Pyx_RefNanny) { * cdef object __pyx_result */ __Pyx_TraceLine(1,0,__PYX_ERR(7, 1, __pyx_L1_error)) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_19__pyx_unpickle_PDFOutputDevice, 0, __pyx_n_s_pyx_unpickle_PDFOutputDevice, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__115)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_19__pyx_unpickle_PDFOutputDevice, 0, __pyx_n_s_pyx_unpickle_PDFOutputDevice, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__116)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_PDFOutputDevice, __pyx_t_1) < 0) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -44364,7 +44617,7 @@ if (!__Pyx_RefNanny) { * cdef object __pyx_result */ __Pyx_TraceLine(1,0,__PYX_ERR(7, 1, __pyx_L1_error)) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_21__pyx_unpickle_RawImageControl, 0, __pyx_n_s_pyx_unpickle_RawImageControl, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__116)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_21__pyx_unpickle_RawImageControl, 0, __pyx_n_s_pyx_unpickle_RawImageControl, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__117)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_RawImageControl, __pyx_t_1) < 0) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -44385,7 +44638,7 @@ if (!__Pyx_RefNanny) { * cdef object __pyx_result */ __Pyx_TraceLine(1,0,__PYX_ERR(7, 1, __pyx_L1_error)) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_23__pyx_unpickle_PDFImage, 0, __pyx_n_s_pyx_unpickle_PDFImage, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__117)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_23__pyx_unpickle_PDFImage, 0, __pyx_n_s_pyx_unpickle_PDFImage, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__118)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_PDFImage, __pyx_t_1) < 0) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -44406,7 +44659,7 @@ if (!__Pyx_RefNanny) { * cdef object __pyx_result */ __Pyx_TraceLine(1,0,__PYX_ERR(7, 1, __pyx_L1_error)) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_25__pyx_unpickle_DocumentPageIterator, 0, __pyx_n_s_pyx_unpickle_DocumentPageItera, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__118)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_25__pyx_unpickle_DocumentPageIterator, 0, __pyx_n_s_pyx_unpickle_DocumentPageItera, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__119)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_DocumentPageItera, __pyx_t_1) < 0) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -44427,7 +44680,7 @@ if (!__Pyx_RefNanny) { * cdef object __pyx_result */ __Pyx_TraceLine(1,0,__PYX_ERR(7, 1, __pyx_L1_error)) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_27__pyx_unpickle_page_iterator, 0, __pyx_n_s_pyx_unpickle_page_iterator, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__119)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pyxpdf_4xpdf_27__pyx_unpickle_page_iterator, 0, __pyx_n_s_pyx_unpickle_page_iterator, NULL, __pyx_n_s_pyxpdf_xpdf, __pyx_d, ((PyObject *)__pyx_codeobj__120)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_page_iterator, __pyx_t_1) < 0) __PYX_ERR(7, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -44591,37 +44844,37 @@ static CYTHON_SMALL_CODE void __Pyx_CleanupGlobals(void) { Py_CLEAR(__pyx_codeobj__62); Py_CLEAR(__pyx_tuple__63); Py_CLEAR(__pyx_tuple__64); - Py_CLEAR(__pyx_codeobj__66); + Py_CLEAR(__pyx_tuple__65); Py_CLEAR(__pyx_codeobj__67); Py_CLEAR(__pyx_codeobj__68); Py_CLEAR(__pyx_codeobj__69); - Py_CLEAR(__pyx_tuple__70); - Py_CLEAR(__pyx_codeobj__71); - Py_CLEAR(__pyx_tuple__72); + Py_CLEAR(__pyx_codeobj__70); + Py_CLEAR(__pyx_tuple__71); + Py_CLEAR(__pyx_codeobj__72); Py_CLEAR(__pyx_tuple__73); Py_CLEAR(__pyx_tuple__74); - Py_CLEAR(__pyx_tuple__78); + Py_CLEAR(__pyx_tuple__75); Py_CLEAR(__pyx_tuple__79); - Py_CLEAR(__pyx_codeobj__80); + Py_CLEAR(__pyx_tuple__80); Py_CLEAR(__pyx_codeobj__81); Py_CLEAR(__pyx_codeobj__82); Py_CLEAR(__pyx_codeobj__83); Py_CLEAR(__pyx_codeobj__84); - Py_CLEAR(__pyx_tuple__85); - Py_CLEAR(__pyx_codeobj__86); - Py_CLEAR(__pyx_tuple__87); - Py_CLEAR(__pyx_codeobj__88); + Py_CLEAR(__pyx_codeobj__85); + Py_CLEAR(__pyx_tuple__86); + Py_CLEAR(__pyx_codeobj__87); + Py_CLEAR(__pyx_tuple__88); Py_CLEAR(__pyx_codeobj__89); - Py_CLEAR(__pyx_tuple__90); - Py_CLEAR(__pyx_codeobj__97); + Py_CLEAR(__pyx_codeobj__90); + Py_CLEAR(__pyx_tuple__91); Py_CLEAR(__pyx_codeobj__98); Py_CLEAR(__pyx_codeobj__99); Py_CLEAR(__pyx_codeobj__100); Py_CLEAR(__pyx_codeobj__101); - Py_CLEAR(__pyx_tuple__102); - Py_CLEAR(__pyx_codeobj__103); - Py_CLEAR(__pyx_tuple__104); - Py_CLEAR(__pyx_codeobj__105); + Py_CLEAR(__pyx_codeobj__102); + Py_CLEAR(__pyx_tuple__103); + Py_CLEAR(__pyx_codeobj__104); + Py_CLEAR(__pyx_tuple__105); Py_CLEAR(__pyx_codeobj__106); Py_CLEAR(__pyx_codeobj__107); Py_CLEAR(__pyx_codeobj__108); @@ -44636,7 +44889,7 @@ static CYTHON_SMALL_CODE void __Pyx_CleanupGlobals(void) { Py_CLEAR(__pyx_codeobj__117); Py_CLEAR(__pyx_codeobj__118); Py_CLEAR(__pyx_codeobj__119); - Py_CLEAR(__pyx_tuple__120); + Py_CLEAR(__pyx_codeobj__120); Py_CLEAR(__pyx_tuple__121); Py_CLEAR(__pyx_tuple__122); Py_CLEAR(__pyx_tuple__123); @@ -44710,6 +44963,7 @@ static CYTHON_SMALL_CODE void __Pyx_CleanupGlobals(void) { Py_CLEAR(__pyx_tuple__191); Py_CLEAR(__pyx_tuple__192); Py_CLEAR(__pyx_tuple__193); + Py_CLEAR(__pyx_tuple__194); /* CodeObjectCache.cleanup */ if (__pyx_code_cache.entries) { __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; @@ -45672,7 +45926,7 @@ static CYTHON_INLINE PyObject* __Pyx_decode_c_string( stop += length; } if (unlikely(stop <= start)) - return PyUnicode_FromUnicode(NULL, 0); + return __Pyx_NewRef(__pyx_empty_unicode); length = stop - start; cstring += start; if (decode_func) { @@ -46980,9 +47234,18 @@ static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObjec return value; } -/* None */ -static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { - PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; } /* SetItemInt */ @@ -47034,20 +47297,6 @@ static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObje return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v); } -/* ImportFrom */ -static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { - PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); - if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { - PyErr_Format(PyExc_ImportError, - #if PY_MAJOR_VERSION < 3 - "cannot import name %.230s", PyString_AS_STRING(name)); - #else - "cannot import name %S", name); - #endif - } - return value; -} - /* HasAttr */ static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { PyObject *r; @@ -47700,6 +47949,7 @@ static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, } static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) { +#if PY_MAJOR_VERSION < 3 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { Py_INCREF(func); @@ -47712,6 +47962,7 @@ static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObj } if (obj == Py_None) obj = NULL; +#endif return __Pyx_PyMethod_New(func, obj, type); } static PyObject* diff --git a/src/tests/__init__.py b/tests/__init__.py similarity index 100% rename from src/tests/__init__.py rename to tests/__init__.py diff --git a/src/tests/test_segfault_image_text_image.py b/tests/test_segfault_image_text_image.py similarity index 95% rename from src/tests/test_segfault_image_text_image.py rename to tests/test_segfault_image_text_image.py index 497832c..64b2fd4 100644 --- a/src/tests/test_segfault_image_text_image.py +++ b/tests/test_segfault_image_text_image.py @@ -26,7 +26,7 @@ class Segfault_Image_Text_Image_TextCase(unittest.TestCase): def test_segfault_image_text_image(self): - pdf = (Path(__file__).parents[2].absolute()) / "samples/nonfree/mandarin.pdf" + pdf = (Path(__file__).parents[1].absolute()) / "samples/nonfree/mandarin.pdf" doc = x.Document(pdf) # can be any PDFOutput except TextOutput