RussellLuo / pdfbookmarker

Add bookmarks into PDF using PyPDF2
82 stars 19 forks source link

createStringObject should have str or unicode arg #5

Closed wangboyu-langya closed 5 years ago

wangboyu-langya commented 6 years ago

When running on python 3.6 or 2.7, with the latest PyPDF2, I got the error "createStringObject should have str or unicode arg". It seems something is wrong with line 54.

RussellLuo commented 5 years ago

@huxianglong I didn't encounter the issue you mentioned. Can you describe the possible steps to reproduce the issue?

RussellLuo commented 5 years ago

I'm going to close this issue. Feel free to reopen it if someone has the same issue and can provide more details.

tech-vin commented 3 years ago

When running on python 3.6 or 2.7, with the latest PyPDF2, I got the error "createStringObject should have str or unicode arg". It seems something is wrong with line 54.

I faced the same issue. Here is the sample code snippet ` from PyPDF2 import PdfFileReader, PdfFileWriter

f1 = PdfFileReader(open('Marksheet-1998.pdf', 'rb')) f2 = PdfFileReader(open('Marksheet-1999.pdf', 'rb')) f3 = PdfFileReader(open('Marksheet-2000.pdf', 'rb'))

file = PdfFileMerger(strict=True)

file = PdfFileWriter()

file.addAttachment( fname = f1, fdata= 'image.png' )

file.write('new2.pdf') `