pdfparser icon indicating copy to clipboard operation
pdfparser copied to clipboard

How to get the page numbers that certain a given text?

Open itajackass opened this issue 2 years ago • 2 comments

I dont' know if there is already this function. Is it possible to find a text like "TEST-STRING" and return all page numbers where this string is found? Thanks

itajackass avatar Feb 07 '23 13:02 itajackass

I dont' know if there is already this function.

Not to my knowledge.

You could try the following though:

  • load PDF in the parser
  • go through each page and check for your text (and remember the ones which match)

k00ni avatar Feb 08 '23 07:02 k00ni

I solved using another old package: https://github.com/christian-vigh-phpclasses/PdfToText maybe it is possible to implement it inside yours. There is a method that return an array of all page numbers where the string is found.

itajackass avatar Feb 09 '23 09:02 itajackass