Given a PDF file, I would like to search for a string in its text, and I know pdfgrep can do that.

I further would like to have the physical page number of each page where the string appears (as opposed to the page number printed on each page).

Is there some program that can do this?


Yes, pdfgrep can do that, with the -n option. All you need to do is add that before your search string.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.