我有图像。想要使用 python 将具有相同布局的图像数据提取到 docx 文件中并以可读的形式。我已经尝试过 在图像上应用 tessaract 并使用 pyteesaract 转换为 pdf 然后将pdf转换为word文件 但我无法维护布局和格式。
最佳答案
这个问题之前已经回答过in here 。您可以使用 pdf2image 库来解决此问题:
from pdf2image import convert_from_path
pages = convert_from_path('sample.pdf', 400) //400 is the Image quality in DPI (default 200)
pages[0].save("sample.png")
关于java - 根据坐标或tessaract提取图像数据并将内容写入docs/docx word文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59309580/