有什么方法可以提取PDF文档的页眉,页脚和标题页? [英] Is there any way to extract header and footer and title page of a PDF document?

查看:536
本文介绍了有什么方法可以提取PDF文档的页眉,页脚和标题页?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有任何程序包可以检测和提取PDF文档中的页眉和页脚或标题页?我是使用python进行文本挖掘的新手,我想知道例如pdfminer.layout可以帮助在pdf中找到任何文本块吗?

I want to know if there is any package to detect and extrac the header and footer or title page from PDF document ? I am new in text mining using python and I want to know for example pdfminer.layout could help to find any text block in pdfs?

推荐答案

Apache Tika也进行元数据提取.您还可以提取名称,标题/多标题,日期,页数,修改日期等.

Apache Tika also does metadata extraction. You can also extract names, title/multiple-titles, date, number of pages, modified dates, and many more.

import tika
from tika import parser

filename = "your file name here"
parsedPDF = parser.from_file(file_name)
print(parsedPDF['content'])
print(parsedPDF['metadata']) # its in a dictionary format. 

这篇关于有什么方法可以提取PDF文档的页眉,页脚和标题页?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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