Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error reading fillable pdf #249

Open
lylia0009 opened this issue Sep 23, 2024 · 0 comments
Open

error reading fillable pdf #249

lylia0009 opened this issue Sep 23, 2024 · 0 comments

Comments

@lylia0009
Copy link

I am trying to update a fillable PFD form with python, when trying to read it it throws an exception. Below are the code, sample pdf and the error thrown. Is there any one seen this before?

import pdfrw
pdf = pdfrw.PdfReader(input_pdf)
Error message

~\Anaconda3\lib\site-packages\pdfrw\pdfreader.py in init(self, fname, fdata, decompress, decrypt, password, disable_gc, verbose)
648
649 if is_stream:
--> 650 self.load_stream_objects(trailer.object_streams)
651
652 while xref_list:

~\Anaconda3\lib\site-packages\pdfrw\pdfreader.py in load_stream_objects(self, object_streams)
306 firstoffset = int(obj.First)
307 while objsource.floc < firstoffset:
--> 308 offsets.append((int(next()), firstoffset + int(next())))
309 for num, offset in offsets:
310 # Read the object, and call special code if it starts

ValueError: invalid literal for int() with base 10: "ÔÞíWÎ0vætºUÐ\x8a\x13õ#v\x9f0uÀ\x08C5n¡³ñų\x9d\x93\x91\x06Åo\x11j\x8eO8êøÏ\x96\x1fá?\x10ãoÂõõÀù,,1!6HêíG\x1eb\x18½'éïz²å½#¸,\x9e"```

Sample pdf
https://www.uobgroup.com/hk/assets/pdfs/Billof-Exchange.pdf

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

No branches or pull requests

1 participant