Programmatically replace text in PDF

拈花ヽ惹草 提交于 2019-12-21 05:14:24

问题


I have PDF files with text that should be replaced. More specificly, the text should be translated and replaced with the translated version. It's important that the rest of the PDF structure stays intact. Note that the text is available in the PDFs and techniques like OCr are not needed. Also, it would be nice if font and other text attributes are kept.

Which libraries would you recommend for extracting the text to an easy to edit format (such as CSV) and put the new text back in again?


回答1:


Assuming you are replacing text with a different language, you will have to choose a different font in most cases, and the font choice is non-trivial. I've used the Foxit libraries to change text or create PDFs with success.



来源:https://stackoverflow.com/questions/6590144/programmatically-replace-text-in-pdf

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!