如何访问和操作Hadoop中的pdf文件数据? [英] how to access and manipulate pdf file's datas in Hadoop?

查看:357
本文介绍了如何访问和操作Hadoop中的pdf文件数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用hadoop阅读PDF文件,它有可能如何?
我只知道hadoop只能处理txt文件,所以无论如何都要将PDF文件解析为txt文件。

I want to read the PDF file using hadoop, how it is possible? I only know that hadoop can process only txt files, so is there anyway to parse the PDF files to txt.

给我一​​些建议。

推荐答案

创建一个 SequenceFile 到包含PDF文件。 SequenceFile是一种二进制文件格式。您可以使SequenceFile中的每条记录成为PDF。为此,您可以创建一个从可写入,其中将包含您需要的PDF和任何元数据。然后,您可以使用任何Java PDF库,例如 PDFBox 来操作PDF。

An easy way would be to create a SequenceFile to contain the PDF files. SequenceFile is a binary file format. You could make each record in the SequenceFile a PDF. To do this you would create a class derived from Writable which would contain the PDF and any metadata that you needed. Then you could use any java PDF library such as PDFBox to manipulate the PDFs.

这篇关于如何访问和操作Hadoop中的pdf文件数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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