【问题标题】:Not able to read file in Pypandoc无法在 Pypandoc 中读取文件
【发布时间】:2020-08-02 11:00:50
【问题描述】:

我正在尝试使用 Pandoc 将 pdf 转换为 html。我已经安装 pandoc binary ,添加环境变量路径,然后使用

import pypandoc
import os

os.environ.setdefault('PYPANDOC_PANDOC', 'C://Program Files//Pandoc//pandoc.exe')


file_path = r"D:/46580375_1593783098922.pdf"
output = pypandoc.convert_file("46580375_1593783098922.pdf", to='html', outputfile= 'test.html')

这给了我一个错误:

RuntimeError: Invalid input format! Got "pdf" but expected one of
these: commonmark, creole, csv, docbook, docx, dokuwiki, epub, fb2,
gfm, haddock, html, ipynb, jats, jira, json, latex, man, markdown,
markdown_github, markdown_mmd, markdown_phpextra, markdown_strict,
mediawiki, muse, native, odt, opml, org, rst, t2t, textile, tikiwiki,
twiki, vimwiki

我错过了什么?

【问题讨论】:

    标签: python-3.x pandoc document-conversion pypandoc


    【解决方案1】:

    正如错误所说,您无法通过 pandoc 将 PDF 转换为 HTML

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-10-24
      • 2021-11-30
      • 2013-04-01
      • 2014-09-21
      • 2019-07-16
      • 2020-07-07
      • 2022-01-23
      • 1970-01-01
      相关资源
      最近更新 更多