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

PdfReadError: Illegal character in Name Object #457

Closed
JamieJang opened this issue Sep 19, 2018 · 2 comments
Closed

PdfReadError: Illegal character in Name Object #457

JamieJang opened this issue Sep 19, 2018 · 2 comments
Labels
is-bug From a users perspective, this is a bug - a violation of the expected behavior with a compliant PDF is-cjk-issue Issue related to CJK (Chinese-Japanese-Korean) needs-pdf The issue needs a PDF file to show the problem

Comments

@JamieJang
Copy link

JamieJang commented Sep 19, 2018

I have tried merge 2 pdf.
These pdf written by Korean or Chinese, so I call them by PdfFileReader with strict=False options.

But when I try merge two pdf, <PdfReadError: Illegal character in Name Object> error is raised.

input_file = PdfFileReader(open(pdfPath,"rb"),strict=False)
size = input_file.getPage(0).mediaBox
page_cnt = input_file.getNumPages()
output_file = PdfFileWriter()
can = canvas.Canvas("coord.pdf")

...(make canvas)

can.save()
stamp = PdfFileReader(open("coord.pdf","rb"),strict=False)

input_page.mergePage(stamp.getPage(0))

...

with open(outputPath, 'wb') as outputStream:
            output_file.write(outputStream)     <---- raise error here
@mati1994
Copy link

have you solved this problem?

@MartinThoma MartinThoma added the is-bug From a users perspective, this is a bug - a violation of the expected behavior with a compliant PDF label Apr 7, 2022
@MartinThoma MartinThoma added the needs-pdf The issue needs a PDF file to show the problem label Jun 26, 2022
@MartinThoma
Copy link
Member

As this issue has neither a traceback nor an example PDF and the code is not complete (e.g. it's missing imports), I cannot reproduce the issue.

As PyPDF2 has changed a lot, I assume the issue was resolved. If you still get the issue with a recent version of PyPDF2, please let me know.

@MartinThoma MartinThoma added the is-cjk-issue Issue related to CJK (Chinese-Japanese-Korean) label Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is-bug From a users perspective, this is a bug - a violation of the expected behavior with a compliant PDF is-cjk-issue Issue related to CJK (Chinese-Japanese-Korean) needs-pdf The issue needs a PDF file to show the problem
Projects
None yet
Development

No branches or pull requests

3 participants