1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

PHP Script to search PDF files

Discussion in 'Web Design & Development' started by 37Seconds, Mar 20, 2007.

Thread Status:
Not open for further replies.
Advertisement
  1. 37Seconds

    37Seconds Thread Starter

    Joined:
    Jan 14, 2007
    Messages:
    17
    Is there a PHP Script that can search through PDF files in a directory on the webserver using a keyword entered by a user of a website?
     
  2. jaymanson

    jaymanson

    Joined:
    Mar 18, 2007
    Messages:
    199
    This may or may not be of some use to you:

    You will no doubt be aware that you can add a Google search to your site. Click here to set it up! If you make sure your website is the only one under 'sites' and add filetype: pdf as a search refinement, that will do exactly what you are looking for.

    Depending on what you need, this may not look professional enough for you, but it works all the same :)

    Jay
     
  3. 37Seconds

    37Seconds Thread Starter

    Joined:
    Jan 14, 2007
    Messages:
    17
    Thanks for the idea Jay, but unforetunately it won't work for us. The site we plan on creating will be an intranet site behind a firewall for department to use, so the Google idea won't work.

    The site will be used to search through department procedures that are in PDF format. I figured there would already be a php script that is able to do this that we could implement by creating a website on a server. Unforetunately, I have yet to be able to find one.

    Any other ideas?
     
  4. brendandonhu

    brendandonhu

    Joined:
    Jul 8, 2002
    Messages:
    14,681
    You can convert the PDF document to plain text - take a look at the comments on http://php.net/pdf (there's a function called pdf2string()). You can also run the file through a library like pdftohtml or pdftotext.
     
  5. jaymanson

    jaymanson

    Joined:
    Mar 18, 2007
    Messages:
    199
    Here's a possibility then :)

    Zoom Search Engine

    It's free up to 50 page searching, and then not too much after that. Can't quickly see any free scripts that will search PDFs, but you might find one at Hotscripts. I'm more web designer than developer, so this is where I get a lot of my scripts from and then customise them to my needs :)
     
  6. MMJ

    MMJ Guest

    Joined:
    Oct 15, 2006
    Messages:
    3,625
    Will it search filenames only or inside the actual file?

    You can put the filenames in a db than have the search find them. :)
     
  7. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/553338