首页 \ 问答 \ 如何使用Apache POI从PDF中提取原始文本?(How can I extract raw text from PDFs using Apache POI?)

如何使用Apache POI从PDF中提取原始文本?(How can I extract raw text from PDFs using Apache POI?)

我需要从几个文件中提取原始文本,其中一些是PDF,其中一些是DOC文件格式。

我必须使用Apache POI来做到这一点。 现在,我在处理word文件(提取和写入等)时发现了很多文档,但是我无法找到有关从PDF中提取的任何文档。

我认为Apache POI具备此功能是错误的吗?

如果是这样,有人可以推荐类似的Java程序,允许从多种文件格式中提取文本吗?

如果没有,任何人都可以指向我应该看到的文档和/或类/方法吗?

预先感谢您的任何帮助。


I need to extract raw text from several files, some of which are PDF and some of which are DOC file formats.

I have to use Apache POI to do this. Now, there is a lot of documentation I have found on dealing with word files (extracting and writing to etc.) but I am unable to find any documentation on extracting from a PDF.

Am I wrong in believing that Apache POI has this capability?

If so, can anyone recommend similar Java programs that allow text extraction from multiple file formats?

If not, can anyone point me to the documentation and/or the classes/methods that I should be looking at to do this?

Thank you in advance for any help.


原文:https://stackoverflow.com/questions/16910731
更新时间:2023-04-09 20:04

最满意答案

INPUTSET语句读取文件结尾时,大多数SAS数据步骤实际上停止。

我怀疑你的输入文件是空的或没有足够的数据来满足你的INPUT语句。


Most SAS data steps actually stop when the INPUT or SET statement reads past the end of the file.

I suspect that your input file is either empty or does not have enough data to satisfy your INPUT statement.

相关问答

更多
  • 什么是SAS认证[2023-02-23]

    SAS是Statistical Analysis System的简称,是一款功能强大的统计分析软件。SAS认证相当于一种证书考试,可以向当地SAS代理机构咨询
  • 什么是 nl sas[2023-05-10]

    SAS,NL-SAS,SATA硬盘的区别 NL-SAS的是采用SAS的磁盘接口和SATA的盘体的综合体。换句话,Near Line (NL) SAS是带有SAS接口的“企业级SATA驱动器”。 SAS是串行scsi,SATA是串行ATA。 SAS 向下兼容SATA SCSI硬盘一般在10Krpm 或15krpm,而ATA硬盘在7.2Krpm 左右。 最初的SAS标准提供了300MB/s(SAS1.0),并计划推出的下一代SAS规范中,速度已经提高到了600MB/s(SAS2.0),SAS被期望最终能够达到1 ...
  • 34 %let progname=SAS Program Name.sas; 35 data _null_; 36 LL=input(getoption('linesize'),f8.); 37 put @; 38 _file_ = repeat('=',ll-1); 39 put; 40 progname=translate("&progname",'ff'x,' ...
  • 执行导入的工作可能是一个读取文件的简短SAS程序。如果您正在使用它来管理一般流程(对于我想象的服务器),您确实会在EG中管理它。 您可以使用导入向导,编写PROC IMPORT语句,如: proc import file="whatever.csv" out=dsetname dbms=csv replace; run; 如果它是CSV,或者如果它不是分隔文件(或者,即使它是),则写入数据步骤: data dsetname; infile "whatever.txt"; input @1 varname ...
  • 当INPUT或SET语句读取文件结尾时,大多数SAS数据步骤实际上停止。 我怀疑你的输入文件是空的或没有足够的数据来满足你的INPUT语句。 Most SAS data steps actually stop when the INPUT or SET statement reads past the end of the file. I suspect that your input file is either empty or does not have enough data to satisfy ...
  • 您需要查看数据源和报告输出,并确定在SQL和SSRS中从头开始手动重新创建报告所需的内容。 没有可用的转换工具。 You will need to look at the data sources and the report outputs and figure out what is required to manually recreate the reports from scratch in SQL and SSRS. There is no conversion tool available.
  • 您可以使用全局宏变量_CLIENTAPP来测试您是否在EG中。 当你使用例如: data _null_; %put &_CLIENTAPP; run; 在EG 5.1中,它返回“SAS Enterprise Guide”。 _CLIENTVERSION为我的环境返回EG版本,eG:'5.100.0.15040' 不确定这些全局变量是否存在于Base中(目前无法对此进行测试),但如果它不起作用,您可以假设类似于变量不存在的基础,eG: if " &_CLIENTAPP" = 'SAS Enterp ...
  • 基本上,这是SAS数据步骤和SQL处理各自的连接/合并的方式不同的结果。 SQL为每个可能的键组合创建一个单独的记录。 这是笛卡尔积(在关键层面)。 然而,SAS数据步骤的流程合并方式却截然不同。 MERGE只不过是SET一个特例。 它仍然迭代地处理行,一次一个 - 它永远不会返回,并且一次从PDV中的任何数据集永远不会有多行。 因此,它无法在正常过程中创建笛卡尔积 - 这需要随机访问,SAS datastep不能正常执行。 它能做什么: For each unique BY value Take th ...
  • 基于这个SAS文档 (google“sas proc logistic binomial”),它看起来应该这样做: proc genmod data=beetle; model dead/total=dose / link=logit dist=binomial; 基于此 ,看起来您的上述数据实际上与上面链接中提到的标准Bliss(1935)数据集相同。 Based on this SAS document (google "sas proc logistic binomial") it looks li ...
  • 问题是你实际上并没有调用宏。 您只在定义 %macro时使用%macro宏。 要调用它,只需在宏名称前面加上%符号,如下所示: %mailing() The issue is that you are not actually calling the macro. You only use %macro when defining a macro. To call it, simply precede the macro name with a % symbol, as follows: %mailing ...

相关文章

更多

最新问答

更多
  • 如何检索Ember.js模型的所有属性(How to retrieve all properties of an Ember.js model)
  • maven中snapshot快照库和release发布库的区别和作用
  • arraylist中的搜索元素(Search element in arraylist)
  • 从mysli_fetch_array中获取选定的值并输出(Get selected value from mysli_fetch_array and output)
  • Windows Phone上的可用共享扩展(Available Share Extensions on Windows Phone)
  • 如何在命令提示符下将日期设置为文件名(How to set file name as date in command prompt)
  • 如何在Laravel 5.2中使用paginate与关系?(How to use paginate with relationships in Laravel 5.2?)
  • 从iframe访问父页面的id元素(accessing id element of parent page from iframe)
  • linux的常用命令干什么用的
  • Feign Client + Eureka POST请求正文(Feign Client + Eureka POST request body)
  • 怎么删除禁用RHEL/CentOS 7上不需要的服务
  • 为什么Gradle运行测试两次?(Why does Gradle run tests twice?)
  • 由于有四个新控制器,Auth刀片是否有任何变化?(Are there any changes in Auth blades due to four new controllers?)
  • 如何交换返回集中的行?(How to swap rows in a return set?)
  • 在android中的活动之间切换?(Switching between activities in android?)
  • Perforce:如何从Depot到Workspace丢失文件?(Perforce: how to get missing file from Depot to Workspace?)
  • Webform页面避免运行服务器(Webform page avoiding runat server)
  • 在ios 7中的UITableView部分周围绘制边界线(draw borderline around UITableView section in ios 7)
  • 内存布局破解(memory layout hack)
  • 使用Boost.Spirit Qi和Lex时的空白队长(Whitespace skipper when using Boost.Spirit Qi and Lex)
  • 我们可以有一个调度程序,你可以异步添加东西,但会同步按顺序执行吗?(Can we have a dispatcher that you can add things todo asynchronously but will be executed in that order synchronously?)
  • “FROM a,b”和“FROM a FULL OUTER JOIN b”之间有什么区别?(What is the difference between “FROM a, b” and “FROM a FULL OUTER JOIN b”?)
  • Java中的不可变类(Immutable class in Java)
  • bat批处理文件结果导出到txt
  • WordPress发布查询(WordPress post query)
  • 如何在关系数据库中存储与IPv6兼容的地址(How to store IPv6-compatible address in a relational database)
  • 是否可以检查对象值的条件并返回密钥?(Is it possible to check the condition of a value of an object and JUST return the key?)
  • 德州新起点计算机培训学校主要课程有什么?
  • GEP分段错误LLVM C ++ API(GEP segmentation fault LLVM C++ API)
  • “latin1_german1_ci”整理来自哪里?(Where is “latin1_german1_ci” collation coming from?)