有没有开源程序,输出一个纯文本文件,文本的位置可指定

2024-05-21 12:44:47 +08:00
 wencan
其实就是把文字 pdf 转为纯文本
期望文本的位置不变
1824 次点击
所在节点    Python
7 条回复
lilu0826
2024-05-21 12:48:00 +08:00
PDF 转 word?
littlewing
2024-05-21 13:00:44 +08:00
文本的位置不变 是什么意思
aeof
2024-05-21 13:02:22 +08:00
都说是纯文本了,保存布局是不可能的吧。。除非这个 PDF 是纯上下线性布局,不然理论上是不是不可能实现?
disorientatefree
2024-05-21 13:03:08 +08:00
应该是想靠换行和空格尽量保留排版?
hefish
2024-05-21 13:03:49 +08:00
别说 pdf2txt ,pdf2jpg 都给你安排的服服帖帖。。。
disorientatefree
2024-05-21 13:06:38 +08:00
pdftotext -layout

https://manpages.debian.org/experimental/poppler-utils/pdftotext.1.en.html#:~:text=Pdftotext%20converts%20Portable%20Document%20Format,pdf%20to%20file.

```
Maintain (as best as possible) the original physical layout of the text. The default is to ´undo' physical layout (columns, hyphenation, etc.) and output the text in reading order.
```
wencan
2024-05-21 14:33:58 +08:00
@disorientatefree 要的就是这个效果。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1042579

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX