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

有些caj文件转换失败 #7

Open
wk-1999 opened this issue Jun 2, 2022 · 4 comments
Open

有些caj文件转换失败 #7

wk-1999 opened this issue Jun 2, 2022 · 4 comments
Labels
upstream Also appear in the upstream

Comments

@wk-1999
Copy link

wk-1999 commented Jun 2, 2022

首先感谢作者的开发努力,嘉惠学林。实际使用中有一些文档转换失败,不知道什么原因,我用蓝奏云附上两篇失败文档。
https://wwn.lanzoum.com/ibNcY05t5w8f

@sainnhe
Copy link
Owner

sainnhe commented Jun 2, 2022

这个应用只是 caj2pdf 的 wrapper,我刚才用 caj2pdf 命令行版本试了一下,转换失败,你可以自己试一下。

建议把这个 bug 汇报给上游。

@sainnhe
Copy link
Owner

sainnhe commented Jun 2, 2022

~/repo/qt/caj2pdf-qt/caj2pdf   8cbc3c57                                                                                                                                         1 0.34s sainnhe@macintosh
❯ ./venv/bin/python caj2pdf convert ~/Desktop/《周礼》中所见天神祭祀考论_刘涛.caj -o a.pdf
Traceback (most recent call last):
  File "/Users/sainnhe/repo/qt/caj2pdf-qt/caj2pdf/caj2pdf", line 52, in <module>
    caj.convert(args.output)
  File "/Users/sainnhe/repo/qt/caj2pdf-qt/caj2pdf/cajparser.py", line 115, in convert
    self._convert_hn(dest)
  File "/Users/sainnhe/repo/qt/caj2pdf-qt/caj2pdf/cajparser.py", line 350, in _convert_hn
    from jbigdec import CImage
  File "/Users/sainnhe/repo/qt/caj2pdf-qt/caj2pdf/jbigdec.py", line 29, in <module>
    libjbigdec = cdll.LoadLibrary("./libjbigdec.so")
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ctypes/__init__.py", line 452, in LoadLibrary
    return self._dlltype(name)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ctypes/__init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: dlopen(./libjbigdec.so, 6): image not found

~/repo/qt/caj2pdf-qt/caj2pdf   8cbc3c57                                                                                                                                         1 0.37s sainnhe@macintosh
❯ ./venv/bin/python caj2pdf convert ~/Desktop/明堂制度研究——明堂制度的源流_张一兵.caj -o a.pdf
error: cannot find startxref
warning: trying to repair broken xref
warning: repairing PDF document
warning: invalid indirect reference in dict
error: invalid key in dict
warning: invalid indirect reference in dict
error: invalid key in dict
warning: invalid indirect reference in dict
error: invalid key in dict
warning: invalid indirect reference in dict
error: invalid key in dict
warning: invalid indirect reference in dict
error: invalid key in dict
error: invalid key in dict
warning: ignoring object with invalid object number (0 0 R)
error: invalid key in dict
warning: ignoring object with invalid object number (0 0 R)
error: invalid key in dict
warning: ignoring object with invalid object number (0 0 R)
warning: invalid indirect reference in dict
error: invalid key in dict
warning: invalid indirect reference in dict
error: invalid key in dict
error: invalid key in dict
warning: ignoring object with invalid object number (0 0 R)
warning: invalid indirect reference in dict
error: invalid key in dict
error: invalid key in dict
warning: ignoring object with invalid object number (0 0 R)
error: invalid key in dict
warning: ignoring object with invalid object number (0 0 R)
error: invalid key in dict
warning: ignoring object with invalid object number (0 0 R)
error: invalid key in dict
warning: ignoring object with invalid object number (0 0 R)
error: invalid key in dict
warning: ignoring object with invalid object number (0 0 R)
warning: invalid indirect reference in dict
error: invalid key in dict
warning: invalid indirect reference in dict
error: invalid key in dict
error: invalid key in dict
warning: ignoring object with invalid object number (0 0 R)
warning: invalid indirect reference in dict
error: invalid key in dict
warning: invalid indirect reference in dict
error: invalid key in dict
error: invalid key in dict
warning: ignoring object with invalid object number (0 0 R)
error: invalid key in dict
error: invalid key in dict
warning: ignoring object with invalid object number (0 0 R)
warning: invalid indirect reference in dict
error: invalid key in dict
warning: invalid indirect reference in dict
error: invalid key in dict
error: invalid key in dict
warning: ignoring object with invalid object number (0 0 R)
error: invalid key in dict
error: invalid key in dict
warning: ignoring object with invalid object number (0 0 R)
warning: invalid indirect reference in dict
error: invalid key in dict
error: invalid key in dict
warning: ignoring object with invalid object number (0 0 R)
warning: invalid indirect reference in dict
error: invalid key in dict
warning: invalid indirect reference in dict
error: invalid key in dict
error: invalid key in dict
warning: ignoring object with invalid object number (0 0 R)
error: invalid key in dict
warning: ignoring object with invalid object number (0 0 R)
error: invalid key in dict
warning: ignoring object with invalid object number (0 0 R)
warning: invalid indirect reference in dict
error: invalid key in dict
warning: invalid indirect reference in dict
error: invalid key in dict
error: invalid key in dict
warning: ignoring object with invalid object number (0 0 R)
error: invalid key in dict
warning: ignoring broken object (853 0 R)
warning: expected 'endobj' or 'stream' keyword (842 0 R)
warning: invalid indirect reference in dict
error: invalid key in dict
warning: ignoring broken object (835 0 R)
warning: expected 'endobj' or 'stream' keyword (803 0 R)
warning: invalid indirect reference in dict
error: invalid key in dict
warning: ignoring broken object (800 0 R)
warning: invalid indirect reference in dict
error: invalid key in dict
warning: ignoring broken object (795 0 R)
warning: invalid indirect reference in dict
error: invalid key in dict
warning: ignoring broken object (689 0 R)
warning: invalid indirect reference in dict
error: invalid key in dict
warning: ignoring broken object (613 0 R)
error: invalid key in dict
warning: ignoring broken object (605 0 R)
error: invalid key in dict
warning: ignoring broken object (589 0 R)
error: invalid key in dict
warning: ignoring broken object (577 0 R)
warning: invalid indirect reference in dict
error: invalid key in dict
warning: ignoring broken object (505 0 R)
warning: invalid indirect reference in dict
error: invalid key in dict
warning: ignoring broken object (366 0 R)
error: invalid key in dict
warning: ignoring broken object (307 0 R)
error: invalid key in dict
warning: ignoring broken object (256 0 R)
error: invalid key in dict
warning: ignoring broken object (244 0 R)
warning: invalid indirect reference in dict
error: invalid key in dict
warning: ignoring broken object (5 0 R)
warning: PDF stream Length incorrect
warning: invalid indirect reference in dict
error: invalid key in dict

Command mutool returned non-zero exit status 1

@wk-1999
Copy link
Author

wk-1999 commented Jun 2, 2022

这个应用只是 caj2pdf 的 wrapper,我刚才用 caj2pdf 命令行版本试了一下,转换失败,你可以自己试一下。

建议把这个 bug 汇报给上游。

好的我去反馈一下,谢谢您

@HinTak
Copy link

HinTak commented Jun 30, 2022

According to "OSError: dlopen(./libjbigdec.so, 6): image not found", you are on Mac OS; you are missing two libraries. For windows, we provide binaries under "lib/bin" , libjbig2codec*.dll and libjbigdec*.dll . The source code is in lib/*.cc, and the build instructions are at the top of the files. There are two alternative ways of building libjbig2codec.so , via decode_jbig2data_x.cc depending on jbig2dec is easier for non-linux (unless you use homebrew to get poppler, etc).

"明堂制度研究——明堂制度的源流_张一兵.caj" looks corrupted. Please re-download wherever you get it from, and check.

@sainnhe sainnhe added the upstream Also appear in the upstream label Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream Also appear in the upstream
Projects
None yet
Development

No branches or pull requests

3 participants