首页 > 其他 > 详细

文件读取与存储

时间:2020-12-21 12:13:19      阅读:29      评论:0      收藏:0      [点我收藏+]

PDF

1.通过fitz

import fitz

#读取文件
path = ‘xx.pdf‘
file_handle = fitz.open(path)
#读取stream
pdf_stream = b‘xxxxxx‘
file_handle = fitz.open(stream=pdf_stream, filetype=‘bytes‘)

#保存为文件
output_file = ‘XX.pdf‘
file_handle.write(output_file)
#保存为stream
out_pdf_stream = file_handle.write()

 

文件读取与存储

原文:https://www.cnblogs.com/GoonerWHM/p/14167096.html

踩
(0)
赞
(0)
   
举报
评论 一句话评论(0)
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!