pypdf
pypdf copied to clipboard
Not able to handle DocuSign\xae giving illegal character error
Replace this: What happened? What were you trying to achieve?
Environment
Which environment were you using when you encountered the problem?
$ python -m platform
# Windows-10-10.0.22000-SP0
$ python -c "import pypdf;print(pypdf._debug_versions)"
# pypdf==3.17.1, crypt_provider=('cryptography', '41.0.3'), PIL=none
Code + PDF
I get this error from:
for pdf in list:
print(' Adding: {}'.format(pdf))
merger.append(pdf)
It comes from:
Illegal character in Name Object (b'/DocuSign\xae')
and not UTF-8 related.
See: https://stackoverflow.com/questions/76328047/how-can-i-remove-the-character-from-multiple-multi-page-pdfs-using-pymupdf-for
Related to #369
See #2314 as well. Please provide complete code for reproduction as well as the complete traceback. Additionally, for reproduction purposes the PDF file is required.
Also please note that PdfMerger is obsolete and PdfWriter should be used instead
Want to bump this. Any way to specify some kind of more generic encoding
You are always invited to propose a corresponding PR to improve this.
@eabase can you provide a test file for evaluation