根据坐标或tessaract提取图像数据,然后将内容写入docs/docx word文件中 [英] Extract image data based on coordinates or tessaract and writing the content in docs/docx word file

查看:119
本文介绍了根据坐标或tessaract提取图像数据,然后将内容写入docs/docx word文件中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有image.want想要将具有相同布局的图像数据提取到docx文件中,并使用python.i以可读的形式进行了尝试 在图像上应用tessaract并使用pyteesaract转换为pdf 然后将pdf转换为word文件 但是我无法保持布局和格式.

I have image.want to extract image data with same layout into docx file and in readable form using python.i have tried Applied tessaract on image and converting to pdf using pyteesaract Then converting pdf to word file But i am not able to maintain the layout and format.

推荐答案

This question has been answered before in here. You can use the pdf2image library for this issue:

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")

这篇关于根据坐标或tessaract提取图像数据,然后将内容写入docs/docx word文件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆