【问题标题】:how to convert pdf to xml file如何将pdf转换为xml文件
【发布时间】:2013-08-11 01:43:59
【问题描述】:

我在网上下载了一本pdf格式的书,想在我的ios项目中使用这本书。所需格式为 xml。格式如下:

<q>question here</q>
<a>answer here</a>
<q>question2</q>
<a>answer2</a>

pdf格式如下:

               the question is centered
    the answer has several paragraphs that start with 4 white space. 

    This is another paragraph
               This is the second question and so on

    This is the answer to the second question

               The third question and there may be a blank line above
    This is the 4th question and no blank line above

我尝试使用 word/pages 将 pdf 转换为 txt 并逐行阅读文本,但我无法识别问题和答案。另一个问题是当我进行转换时,pdf 的自动换行被转换为换行符。

注意:流程是

pdf -> use word/pages -> txt -> python program -> xml -> python program -> sqlite database

关键部分是如何将 pdf 转换为正确的 xml 文件。

【问题讨论】:

    标签: ios xml database pdf format


    【解决方案1】:

    恕我直言,您可以从 github.com 或其他地方找到一个可用、开源且友好的 pdf 查看器。然后您可以解析转换后的文本并生成 xml。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-07-11
      • 2016-07-10
      • 2019-02-10
      相关资源
      最近更新 更多