Quickly Search Strings inside PDF files

13 ビュー (過去 30 日間)
Michael B
Michael B 2016 年 4 月 11 日
コメント済み: Walter Roberson 2023 年 1 月 4 日
I have ~25,000 PDF files that I want to classify based on the presence of keywords in their text. I know there's a PDF Toolbox that provides MATLAB with an interface for reading PDF text, but the fact that it comes from Sourceforge makes it difficult to obtain (this is for work) and the reliance on java seems to me like it would make the process very slow -especially for searching so many files. Is there a simpler, faster way to parse these documents if all I want to do is basically strfind on the text to check for keywords?
  7 件のコメント
Michael B
Michael B 2016 年 4 月 18 日
編集済み: Michael B 2016 年 4 月 18 日
@jgg: That's a good explanation. If you'd made this an official answer I'd accept it. Sounds like I'll have to figure out a clever way to get PDFBox on my work machine without breaking the rules...
@Walter Roberson: Thank you sir, that is tremendously helpful. You are truly a font of knowledge and support. I can only hope that one day I might possess a fraction of your wit.
Walter Roberson
Walter Roberson 2023 年 1 月 4 日
For batch extracting I see the commercial product https://www.qoppa.com/files/pdfstudio/guide/batch-extract-text-from-pdf.htm (which I have never used.)
I also see instructions at https://kenbenoit.net/how-to-batch-convert-pdf-files-to-text/ for a free convertor. As those instructions basically involve preparing a file of names and then running a shell script, then building the file name list inside MATLAB would not be difficult. Running the converter would be simple in MacOS or Linux; in Windows it would take more work.

サインインしてコメントする。

採用された回答

Jan
Jan 2016 年 4 月 11 日
PDFs are designed to guarantee an equal output on different machines. You want to create a catalogue of the contained strings. These two jobs do not match.
What about converting the PDFs by one of the many pdf2text tools and work on the text files? E.g. http://www.foolabs.com/xpdf, http://www.codeproject.com/Articles/14170/Extract-Text-from-PDF-in-C-NET
  1 件のコメント
Michael B
Michael B 2016 年 4 月 18 日
Since I have to parse 25,000 files, using an external converter really isn't a viable option unless it has batch capability. Alright, I guess there really isn't anything simpler than the PDFBox tool for a MATLAB interface. Thanks.

サインインしてコメントする。

その他の回答 (1 件)

Sarah Palfreyman
Sarah Palfreyman 2018 年 4 月 30 日
Have you tried Text Analytics Toolbox ?
  1 件のコメント
Benjamin Ehrlich
Benjamin Ehrlich 2023 年 1 月 4 日
Is there ANY way to effectively speed up textanalytics.internal.pdfparser.extractText?
A single page can take up to 20 seconds... I just want to extract a small section of text.
-Ben

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by