UnlightedOtaku / doc88Download

使用python下载道客巴巴文件并自动合并为pdf
42 stars 18 forks source link

doc88.py需要修改两个地方 #5

Open SamZhou-2019 opened 9 months ago

SamZhou-2019 commented 9 months ago

感谢您提供的代码解燃眉之急!运行时出现了两个问题:

1.

Traceback (most recent call last):
  File "d:\Software\OfficeTools\doc88Download-master\doc88.py", line 150, in <module>
    pic2pdf(file_name)
  File "d:\Software\OfficeTools\doc88Download-master\doc88.py", line 141, in pic2pdf
    pdfbytes = imgdoc.convertToPDF()  # 使用图片创建单页的 PDF
               ^^^^^^^^^^^^^^^^^^^
AttributeError: 'Document' object has no attribute 'convertToPDF'. Did you mean: 'convert_to_pdf'?

doc88.py的第141行,需要修改为pdfbytes = imgdoc.convert_to_pdf() # 使用图片创建单页的 PDF

2.

Traceback (most recent call last):
  File "d:\Software\OfficeTools\doc88Download-master\doc88.py", line 150, in <module>
    pic2pdf(file_name)
  File "d:\Software\OfficeTools\doc88Download-master\doc88.py", line 143, in pic2pdf
    doc.insertPDF(imgpdf)  # 将当前页插入文档
    ^^^^^^^^^^^^^
AttributeError: 'Document' object has no attribute 'insertPDF'. Did you mean: 'insert_pdf'?

doc88.py的第143行,需要修改为doc.insert_pdf(imgpdf) # 将当前页插入文档

再次感谢!

kelunwi commented 3 months ago

感谢,还能用,美滋滋