使用Python从采购订单(PDF文件)中提取密钥及其相关值 [英] Extracting key and its related value from purchase order (PDF file) using Python

查看:144
本文介绍了使用Python从采购订单(PDF文件)中提取密钥及其相关值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Python版本:3



输入:包含采购订单的PDF文件输入示例:http://gem.compaq.com/gemstore/sites/downloads/SLED_PO_Template .pdf



注意:这是空的采购订单样本格式,实际格式可能会有所不同。实时pdf可能不是空的。



所需输出是从pdf获取密钥名称及其值。



样品输出:



采购订单编号:其pdf值(其他按键相同)



问题:如何从给定的pdf文件中提取密钥名称及其相关值数据?



我尝试过:



尝试tabula-py,pdfminer2,pdftotext,OCR,pdf2json。

但我面临的主要挑战是:将关键字与其真实值相关联。

Python Version: 3

Input: PDF file containing Purchase order Input Example: http://gem.compaq.com/gemstore/sites/downloads/SLED_PO_Template.pdf

Note: This is empty purchase order sample format, actual Format may vary. In real time pdf may not be empty.

Desired Output is to get key name and its value from pdf.

Sample Output:

PO number: its value in pdf (Same for other keys)

Question: How to extract name of keys and its relevant value data from given pdf file?

What I have tried:

Tried tabula-py, pdfminer2, pdftotext, OCR, pdf2json.
But main challenge I am facing is: Relating key with its true value.

推荐答案

将PDF转储为文本文件。



如果PDF包含标记标识PO#(如果您可以使用文本中的查找找到它),那么您可以使用该标记在其他文档中找到PO#。



了解可移植文档格式(PDF) - PrintMyFolders [ ^ ]
"Dump" the PDF to a text file.

If the PDF contains "markup" that identifies the PO# (if you can find it using a "Find" on the text), then you can use that "markup" to locate the PO# in other documents.

Understanding the Portable Document Format (PDF) - PrintMyFolders[^]


这篇关于使用Python从采购订单(PDF文件)中提取密钥及其相关值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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