How to search words in PDF by command line?

   VeryPDF PDF Text Replacer Command Line has been updated based on the functions of latest version of GUI. Now it is either can be used as PDF text replace tool or PDF text searching tool.  When you use it to search pdf text, you do not need to open PDF file and do searching page by page. You just simply input the command line, then all the searched details will be shown in the MS Dos Windows with detail location. In the following part, I will show you how to use this function.

Step 1. Download PDF Text Replacer 

  • For easily uploading and downloading, we have compressed this command line application into zip file. As once downloading finishes, it is zip file. You need to extract it to some folder then you can check the elements in it.
  • Please read readme.txt file carefully as all the parameters and examples are included in that package. pdftr is the executable file, please call it in the MS Dos Windows.

Step 2. Search PDF Text

Usage:pdftr.exe [options] <Input-file> <Output-file>

  • When you need to search PDF text in the whole PDF file, please refer to following command line.
    pdftr.exe -searchtext "string" C:\in.pdf
    -searchtext <string>          : search text in PDF pages and show result to console
  • When you need to search PDF text in some specified page range, please refer to the following template.
    pdftr.exe -pagerange 1 -searchtext "string" C:\in.pdf
    -pagerange <string>           : set page range for search keywords, e.g., 1,3-5,7

Here I take a random PDF file for example. Say I search “PDF Editor” in verypdf.pdf file document.
Command line I used:D:\Lingwen\pdftextreplacer_cmd>pdftr.exe -searchtext "PDF Editor" verypdf.pdf
search text in PDF 

  • Telling from the above snapshot, we can get that all the information about fonts “PDF Editor” have been listed in the MS Dos Widows.  From the information we can tell us that the page will be listed in the first place, then the coordinate of searched text showed following it. And for easy finding when you open the PDF, the text around the searched text have been displayed too.

This function is extremely good when you need to check whether the replacement is successful or not. And it also can be used to check whether there is some fonts that you really do not want to show up in the PDF file.  When you need to search some information in some thousands of page PDF file, by this function, you can find the information you need at once. And the accuracy rate can reach 99%.

And there are more functions of this software, I can not list all of them here. If you need to know more, please check them in the readme.txt file. During the using, if you have any question, please contact us as soon as possible.

VN:F [1.9.20_1166]
Rating: 10.0/10 (2 votes cast)
VN:F [1.9.20_1166]
Rating: +2 (from 2 votes)
How to search words in PDF by command line?, 10.0 out of 10 based on 2 ratings

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

Verify Code   If you cannot see the CheckCode image,please refresh the page again!