1 Star 0 Fork 0

xqy2006/pdf-with-its-own-md5

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
extract_headers.py 479 Bytes
一键复制 编辑 原始数据 按行查看 历史
zilinzhu 提交于 2021-10-21 11:29 . Init commit. support 4 digits
with open("tex/main.pdf", "rb") as f:
data = bytearray(f.read())
header = data.split(b"\xff\xd8")[0]
print(header)
with open("headers/header", "wb") as f:
f.write(header)
mid_headers = []
for i in range(1, 32):
mid_headers.append(b"\nendstream" + data.split(b"\nendstream")[i].split(b"stream\n")[0] + b"stream\n")
print("")
print(mid_headers[-1])
for i in range(0, 31):
with open(f"headers/mid_header_{i}", "wb") as f:
f.write(mid_headers[i])
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/kilszfdjs/pdf-with-its-own-md5.git
git@gitee.com:kilszfdjs/pdf-with-its-own-md5.git
kilszfdjs
pdf-with-its-own-md5
pdf-with-its-own-md5
main

搜索帮助