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

转换失败:PdfReadWarning: Object 316 0 not defined. [pdf.py:1629] #73

Open
shiyingyu opened this issue Nov 20, 2021 · 2 comments
Open

Comments

@shiyingyu
Copy link

感谢作者,我使用该工具转换了几个文件,it just worked like a charm.
现在有一例不正常的,请帮忙看看是否能解决,以造福更多的人。

  1. 你正在使用哪个版本的 CAJ2PDF?
    2021-11-19的master分支
  2. 你的使用场景是什么?比如convert还是其他。
    convert
  3. 你看到的不正常的现象是什么?(请描述具体现象,比如PDF打不开等)
    转换失败,提示PyPDF2.utils.PdfReadError: Could not find object.
  4. 你期待看到的正确表现是怎样的?
    转换成功不报错。
  5. 请附上你的配置(Python版本、Python包版本以及mutools版本)。
    操作系统Mac OS X 10.15.7
    Python 3.7.3
    PyPDF 1.26.0
    mutool version 1.17.0
  6. 请附上出错时软件输出的错误信息。

错误信息:

    // 软件输出的错误信息
% ~/caj2pdf/caj2pdf convert 基于物联网的温室大棚远程环境监测系统_朱超.caj
PdfReadWarning: Object 316 0 not defined. [pdf.py:1629]
Traceback (most recent call last):
  File "/Users/shiyingyu/caj2pdf/caj2pdf", line 52, in <module>
    caj.convert(args.output)
  File "/Users/shiyingyu/caj2pdf/cajparser.py", line 111, in convert
    self._convert_caj(dest)
  File "/Users/shiyingyu/caj2pdf/cajparser.py", line 293, in _convert_caj
    add_outlines(self.get_toc(), "pdf_toc.pdf", dest)
  File "/Users/shiyingyu/caj2pdf/utils.py", line 227, in add_outlines
    pdf_out.write(outputFile)
  File "/Library/Python/3.7/site-packages/PyPDF2/pdf.py", line 482, in write
    self._sweepIndirectReferences(externalReferenceMap, self._root)
  File "/Library/Python/3.7/site-packages/PyPDF2/pdf.py", line 571, in _sweepIndirectReferences
    self._sweepIndirectReferences(externMap, realdata)
  File "/Library/Python/3.7/site-packages/PyPDF2/pdf.py", line 547, in _sweepIndirectReferences
    value = self._sweepIndirectReferences(externMap, value)
  File "/Library/Python/3.7/site-packages/PyPDF2/pdf.py", line 571, in _sweepIndirectReferences
    self._sweepIndirectReferences(externMap, realdata)
  File "/Library/Python/3.7/site-packages/PyPDF2/pdf.py", line 547, in _sweepIndirectReferences
    value = self._sweepIndirectReferences(externMap, value)
  File "/Library/Python/3.7/site-packages/PyPDF2/pdf.py", line 556, in _sweepIndirectReferences
    value = self._sweepIndirectReferences(externMap, data[i])
  File "/Library/Python/3.7/site-packages/PyPDF2/pdf.py", line 571, in _sweepIndirectReferences
    self._sweepIndirectReferences(externMap, realdata)
  File "/Library/Python/3.7/site-packages/PyPDF2/pdf.py", line 547, in _sweepIndirectReferences
    value = self._sweepIndirectReferences(externMap, value)
  File "/Library/Python/3.7/site-packages/PyPDF2/pdf.py", line 556, in _sweepIndirectReferences
    value = self._sweepIndirectReferences(externMap, data[i])
  File "/Library/Python/3.7/site-packages/PyPDF2/pdf.py", line 586, in _sweepIndirectReferences
    newobj = self._sweepIndirectReferences(externMap, newobj)
  File "/Library/Python/3.7/site-packages/PyPDF2/pdf.py", line 547, in _sweepIndirectReferences
    value = self._sweepIndirectReferences(externMap, value)
  File "/Library/Python/3.7/site-packages/PyPDF2/pdf.py", line 586, in _sweepIndirectReferences
    newobj = self._sweepIndirectReferences(externMap, newobj)
  File "/Library/Python/3.7/site-packages/PyPDF2/pdf.py", line 556, in _sweepIndirectReferences
    value = self._sweepIndirectReferences(externMap, data[i])
  File "/Library/Python/3.7/site-packages/PyPDF2/pdf.py", line 577, in _sweepIndirectReferences
    newobj = data.pdf.getObject(data)
  File "/Library/Python/3.7/site-packages/PyPDF2/pdf.py", line 1631, in getObject
    raise utils.PdfReadError("Could not find object.")
PyPDF2.utils.PdfReadError: Could not find object.

Thanks again!!!
基于物联网的温室大棚远程环境监测系统_朱超.caj.zip

HinTak added a commit that referenced this issue Nov 21, 2021
Since it is better to have a pdf with incomplete outline than failing.
Adress problems with #73
@HinTak
Copy link
Contributor

HinTak commented Nov 21, 2021 via email

@shiyingyu
Copy link
Author

Many many thanks! I had successfully converted my last caj to pdf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants