pdf search command line

PDF search command line

Rate this article

Share this article

In this article we will see how to create a PDF search using the command line.

Here we will take the following PDF and see if we can make extract its content searchable. PDF link here 

PDF search command line

Here are the steps-

  1. Open a terminal in linux.
  2. Use the wget function to get download the file and save it to dc-best-practices-google.pdf.
    wget "https://static.googleusercontent.com/media/www.google.com/en//corporate/datacenter/dc-best-practices-google.pdf"
    

     

  3. Use pdftotext function to convert the file to text.
    pdftotext dc-best-practices-google.pdf 
    

     

  4. open the file dc-best-practices-google.txt with any editor
    vim dc-best-practices-google.txt

     

  5. Use the grep command to search for Green data center
    grep -F -C2 "Green Data Center" dc-best-practices-google.txt

     

  6. This will show the following output which confirms that the PDF data has been made searchable.pdf search command line
  7. To create your PDF search engine, use this link PDF search command line

 

Add Search to your Website

Are you showing the right products, to the right shoppers, at the right time? Contact us to know more.
You may also like