我有打破pyPdf PDF文件:http://tovotu.de/tests/test.pdfpyPdf:非法UTF-16代理
這是示例腳本:
from pyPdf import PdfFileWriter, PdfFileReader
outputPdf = PdfFileWriter()
inpdf = open("test.pdf","rb")
inputPdf = PdfFileReader(inpdf)
[outputPdf.addPage(x) for x in inputPdf.pages]
with open("output.pdf","wb") as outpdf:
outputPdf.write(outpdf)
錯誤輸出是在這裏:http://pastebin.com/0m38zhjQ
的錯誤是從GitHub使用PyPDF2時也是如此。 pdftk可以像處理任何其他pdf一樣處理這個pdf。請注意,寫作失敗,但閱讀似乎工作得很好!
你至少可以指出我的導致該錯誤的PDF格式的確切一部分?一種解決方法會更好:)
我嘗試下載的PDF,但該服務衝我從一個不想要的文件下。 – mkl 2013-03-28 07:44:00
好的,我將鏈接更改爲更直接的內容。 – thomas 2013-03-28 09:22:24