为什么在将pdf文件读入Python时,pdf流对象会过早终止?为什么我可以在记事本等中打开一个pdf文件,并使整个文件显示良好,但不能在Python中显示?我知道pypdf、pdfminer等,这纯粹是为了帮助我了解幕后的情况。在
fp = open(r'E:Books\glu.pdf')
foo = fp.read()
print(foo)
%PDF-1.2
%âãÏÓ
%header, xref, etc omitted for clarity.
34 0 obj
<<
/Type /Catalog
/Pages 31 0 R
>>
endobj
69 0 obj
<< /S 274 /Filter /FlateDecode /Length 70 0 R >>
stream
Hノb```f``éb`c`àd`àc@
%Stream is much longer, but always terminates prematurely.
以二进制模式打开pdf文件:
相关问题 更多 >
编程相关推荐