【问题标题】:Convert pdf to docx without changing font-size, bold,etc in python3.x将 pdf 转换为 docx 而不更改 python3.x 中的字体大小、粗体等
【发布时间】:2019-10-17 11:47:14
【问题描述】:

我想在 ubuntu16.x 中使用 python3.x 将 PDF 转换为 docx。我浏览了下面给出的代码:

for top, dirs, files in os.walk(pdfdir):
  for filename in files:
    if filename.endswith('.pdf'):
        i = i + 1
        abspath_pdf = os.path.normpath(os.path.join(top, filename))

        print 'Converting {0} into .doc format..'.format(abspath_pdf)
        subprocess.call('{0} --invisible --convert-to doc{1} --outdir "{2}" "{3}"'
                        .format(lowriter, outfilter, docdir, abspath_pdf), shell=True)

但它不适合我。有人可以帮忙吗?

提前致谢。

【问题讨论】:

    标签: pdf python-3.6 doc


    【解决方案1】:

    您可以使用 Aspose.Words Cloud 将 PDF 转换为 MS Word 格式 https://products.aspose.cloud/words/python 您还应该注意,PDF 格式是固定页面格式,MS Words 格式是流格式。这使得从 PDF 到 MS Word 的转换非常困难。 Aspose.Words Cloud 可以识别 PDF 中的元素,因此可以在 MS Word 中编辑输出。请参阅以下链接以了解有关 PDF 到 Word 转换的更多信息https://docs.aspose.cloud/display/wordscloud/Convert+PDF+Document+to+Word

    【讨论】:

      猜你喜欢
      • 2011-10-21
      • 2017-09-13
      • 1970-01-01
      • 2017-04-27
      • 1970-01-01
      • 2023-03-02
      • 1970-01-01
      • 2021-03-09
      • 1970-01-01
      相关资源
      最近更新 更多