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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How open HELP.pdf from distant folder?

Status
Not open for further replies.

crtyro

Programmer
Jun 10, 2007
5
US
Building a CD with @45,000 files in @1,000 folders
NEEDED: How to make each of the 45,000 files open the same Help.PDF. Must use indirect addressing because the CD may be downloaded to user's hard drive.
A friend provided an example javascript, but I have not been able to make it open a PDF in a distant folder.
Folder Structure:
D:\k\WEBPDF.JS Javascript provided by a friend
D:\k\HELP.PDF File includes graphics so must be PDF
D:\k\o\ps\test.htm One of 45,000 HTM files with HELP link

Lines in <head> portion of test.htm:
<SCRIPT LANGUAGE="JavaScript" SRC="WEBPDF.JS"></SCRIPT>
Code:
... go to <a href="javascript:PDFOpen('..\..\INTRO.PDF','?')">Help(Intro)</a>
link displays: "go to Help (Intro)"
===============================================
D:\k\WEBPDF.JS reads as follows:
<!-- Hide the following from other browsers
function PDFOpen(PDFURL,PDFName)
{
Code:
var HTMLname = PDFURL.substring(7,6)
var PDFOption='toolbar=no,menubar=no,status=no,scrollbars=no,resizable=no,fullscreen-yes'
PDFWin=open(PDFURL,HTMLname,"'"+PDFOption+"'")
PDFWin.moveTo(0,0)
PDFWin.resizeTo(screen.width,screen.height);
}
// Stop hiding JavaScript -->
================================================
When I click the anchor, Explorer bottom line of screen shows:
javascript:pDFOpen('..\..\INTRO.PDF','?')
But the file does not open.
================================================
Inference: The javascript works ok, provides the correct address, but Explorer doesn't open the file.
1. This is the first time I've ever seen a javascript. I've played with friend's file, changed the substring params to fit my indirect addressing (his original was (0,6) because his demo filename was SAMPLE.PDF).
His original example had all three files in the same folder and it worked fine. It seems important to me that I not triple the size of my project to include a copy of the PDF and javascript in each folder. So how to open the help file from a distant folder?
==================================================
To help me, please provide suggested changes to link and javascript, and specify in which folder to place the javascript(s), and whether in <head> or <body>.

Thanks, more than I can say,
crtyro

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top