Skip to content
This repository has been archived by the owner on Apr 15, 2024. It is now read-only.

TypeError: '<' not supported between instances of 'tuple' and 'int'` #333

Open
qixiaobo opened this issue Jan 29, 2023 · 0 comments
Open

Comments

@qixiaobo
Copy link

qixiaobo commented Jan 29, 2023

Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/pdfminer/pdfinterp.py", line 841, in process_page self.render_contents(page.resources, page.contents, ctm=ctm) File "/usr/local/lib/python3.9/site-packages/pdfminer/pdfinterp.py", line 854, in render_contents self.execute(list_value(streams)) File "/usr/local/lib/python3.9/site-packages/pdfminer/pdfinterp.py", line 879, in execute func(*args) File "/usr/local/lib/python3.9/site-packages/pdfminer/pdfinterp.py", line 818, in do_Do interpreter.render_contents(resources, [xobj], ctm=mult_matrix(matrix, self.ctm)) File "/usr/local/lib/python3.9/site-packages/pdfminer/pdfinterp.py", line 854, in render_contents self.execute(list_value(streams)) File "/usr/local/lib/python3.9/site-packages/pdfminer/pdfinterp.py", line 879, in execute func(*args) File "/usr/local/lib/python3.9/site-packages/pdfminer/pdfinterp.py", line 818, in do_Do interpreter.render_contents(resources, [xobj], ctm=mult_matrix(matrix, self.ctm)) File "/usr/local/lib/python3.9/site-packages/pdfminer/pdfinterp.py", line 854, in render_contents self.execute(list_value(streams)) File "/usr/local/lib/python3.9/site-packages/pdfminer/pdfinterp.py", line 865, in execute (_, obj) = parser.nextobject() File "/usr/local/lib/python3.9/site-packages/pdfminer/psparser.py", line 577, in nextobject (pos, token) = self.nexttoken() File "/usr/local/lib/python3.9/site-packages/pdfminer/psparser.py", line 502, in nexttoken self.fillbuf() File "/usr/local/lib/python3.9/site-packages/pdfminer/pdfinterp.py", line 240, in fillbuf if self.charpos < len(self.buf): TypeError: '<' not supported between instances of 'tuple' and 'int'

image

I see this because PSBaseParser

class PSBaseParser:

    """Most basic PostScript parser that performs only tokenization.
    """
    BUFSIZ = 4096

    debug = 0

So when this reach this limit, then this error occurs.
To make a workaround I just change this to 40960
image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant