如何让电报机器人读取用户发送的 pdf 文件并从中提取数据?

How do make a telegram bot to read a pdf file sent by user and extract data from it?

我一直在查看论坛(stack overflow,git,Telegram API)来检查如何从用户发送的 pdf 文件中提取内容?我使用 python 的 python-telegram-bot 库创建了 Telegram 机器人,为了尝试解决我的问题,我检查了链接,例如:https://pypi.org/project/python-telegram-bot/ and https://python-telegram-bot.readthedocs.io/en/stable/index.html 寻找函数但找不到那里有什么。

我确实找到了从 bot 向用户发送 pdf 文件以及从用户向 bot 发送文件的方法,但是 BOT 无法提取用户发送的 pdf 内容。请高手指点,不胜感激

python-telegram-bot 是一个为 Telegram Bot API. As such, it provides all the methods from the API as well as auxiliary functionality to build chat bots in general, including downloading files sent by users 提供包装器的库。然而,在下载后从收到的 PDF 文件中提取内容远远超出了本库的范围。

当然还有其他库提供此类功能,并且可以与 python-telgram-bot 结合使用。参见例如camelot.


免责声明:我目前是 python-telegram-bot.

的维护者