pypdf icon indicating copy to clipboard operation
pypdf copied to clipboard

Not able to handle DocuSign\xae giving illegal character error

Open eabase opened this issue 7 months ago • 4 comments

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

eabase avatar Nov 30 '23 10:11 eabase

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.

stefan6419846 avatar Nov 30 '23 11:11 stefan6419846

Also please note that PdfMerger is obsolete and PdfWriter should be used instead

pubpub-zz avatar Nov 30 '23 19:11 pubpub-zz

Want to bump this. Any way to specify some kind of more generic encoding

PrathamSoni avatar Feb 13 '24 02:02 PrathamSoni

You are always invited to propose a corresponding PR to improve this.

stefan6419846 avatar Feb 13 '24 08:02 stefan6419846

@eabase can you provide a test file for evaluation

pubpub-zz avatar Apr 04 '24 21:04 pubpub-zz