Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Searching an index

Status
Not open for further replies.

FesterSXS

Programmer
Feb 4, 2002
2,196
GB
I have a basic search page (text box and submit button) on each of 9 separate PDFs. All these PDFs are in the same folder along with the index file of all the PDFs. They will eventually be put onto a CD for distribution.

The code behind the submit button is as follows:
Code:
search.query(this.getField("SearchField").value, "Index", "TPN.pdx");
It isnt working!! If I put the full path to the Index file (TPN.pdx) then it works fine (eg: /C/Temp/TPN.pdx). Since it is going onto CD then I cannot put the full path as this will be different on different workstations.

Does anyone have any suggestions on how I could get around this problem?

Many thanks

Tony
________________________________________________________________________________
 
I got this sorted - the following code lets you specify a path to an index no matter what drive it is in - so long as it is in the same directory as the PDF(s).
Code:
if (typeof search != "undefined" && search.available) 
{
  var intLastSlash = this.path.lastIndexOf("/");
  var strPath = this.path.substring(0, intLastSlash); //remove the PDF filename from the path
  var strSearchString = this.getField("SearchField").value;

  if(strSearchString=="")
    app.execMenuItem("Find");  // if search string is empty then just show the standard Acrobat search
  else
    search.query(strSearchString, "Index", strPath + "/TPN.pdx");
}

Tony
________________________________________________________________________________
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top