Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pdf解析时报“pymupdf.mupdf.FzErrorSyntax: code=8: syntax error in object (58 0 R)” #572

Closed
liy-a opened this issue Sep 9, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@liy-a
Copy link

liy-a commented Sep 9, 2024

Description of the bug | 错误描述

在以命令 magic-pdf -p 12352684.pdf -o out_re 解析pdf时报错如下:
File "/home/chenzixiang785/.conda/envs/mineru/lib/python3.10/site-packages/magic_pdf/libs/draw_bbox.py", line 143, in draw_layout_bbox
pdf_docs.save(f"{out_path}/layout.pdf")
│ └ <function Document.save at 0x7f2db359dea0>
└ Document('', <memory, doc# 6>)
File "/home/chenzixiang785/.conda/envs/mineru/lib/python3.10/site-packages/pymupdf/init.py", line 5452, in save
mupdf.pdf_save_document(pdf, filename, opts)
│ │ │ │ └ (do_incremental=0 do_pretty=0 do_ascii=0 do_compress=0 do_compress_images=0 do_compress_fonts=0 do_decompress=0 do_garbage=0 ...
│ │ │ └ 'out_re/12352684/auto/layout.pdf'
│ │ └ <pymupdf.mupdf.PdfDocument; proxy of <Swig Object of type 'mupdf::PdfDocument *' at 0x7f2d5e3c56b0> >
│ └ <function pdf_save_document at 0x7f2db34d3c70>
└ <module 'pymupdf.mupdf' from '/home/chenzixiang785/.conda/envs/mineru/lib/python3.10/site-packages/pymupdf/mupdf.py'>
File "/home/chenzixiang785/.conda/envs/mineru/lib/python3.10/site-packages/pymupdf/mupdf.py", line 50692, in pdf_save_document
return _mupdf.pdf_save_document(doc, filename, opts)
│ │ │ │ └ (do_incremental=0 do_pretty=0 do_ascii=0 do_compress=0 do_compress_images=0 do_compress_fonts=0 do_decompress=0 do_garbage=0 ...
│ │ │ └ 'out_re/12352684/auto/layout.pdf'
│ │ └ <pymupdf.mupdf.PdfDocument; proxy of <Swig Object of type 'mupdf::PdfDocument *' at 0x7f2d5e3c56b0> >
│ └
└ <module 'pymupdf._mupdf' from '/home/chenzixiang785/.conda/envs/mineru/lib/python3.10/site-packages/pymupdf/_mupdf.so'

How to reproduce the bug | 如何复现

1.上传pdf 12352684.pdf
2. 运行命令 magic-pdf -p 12352684.pdf -o out_re
12352684.pdf

Operating system | 操作系统

Linux

Python version | Python 版本

3.10

Software version | 软件版本 (magic-pdf --version)

0.7.x

Device mode | 设备模式

cuda

@liy-a liy-a added the bug Something isn't working label Sep 9, 2024
@myhloli
Copy link
Collaborator

myhloli commented Sep 9, 2024

文档本身损坏了,导致最后画框之后保存不了,可以通过浏览器重打印一遍,我这边测试可以正常执行的。
image

@liy-a
Copy link
Author

liy-a commented Sep 9, 2024

好的,谢谢您的回复~,我这边试一下。

@liy-a
Copy link
Author

liy-a commented Sep 9, 2024

这边尝试过了,问题解决了,太感谢您了~

@myhloli
Copy link
Collaborator

myhloli commented Nov 14, 2024

#957 fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants