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

opening PDFs from compiled help

Status
Not open for further replies.

kkernen

Programmer
Mar 2, 2001
9
0
0
US
How can I modify this code so I can open PDF files from the main CHM file and not just from the CHM the code is in?

Code:
<script TYPE=&quot;TEXT/JAVASCRIPT&quot; LANGUAGE=&quot;JAVASCRIPT&quot;>
	function AcrobatLink( filename )
		{
			chmPrefix = &quot;mk:@MSITStore:&quot;;
			chmPath = document.URL.substring( 0, document.URL.indexOf( &quot;::&quot; ) );
			filePosition =(chmPath.lastIndexOf(&quot;\\&quot;)>chmPath.lastIndexOf(&quot;/&quot;))
			?chmPath.lastIndexOf(&quot;\\&quot;):chmPath.lastIndexOf(&quot;/&quot;);
			pdfPath = unescape(chmPath.substring(chmPrefix.length,filePosition)+&quot;/&quot;+filename);
				document.open(&quot;text/html&quot;);
				document.write(&quot;<HTML><BODY LEFTMARGIN='0' TOPMARGIN='0' SCROLL='NO'>&quot;);
				document.write(&quot;<EMBED WIDTH='100%' HEIGHT='100%' FULLSCREEN='yes' SRC='&quot;);
				document.write( pdfPath + &quot;'>&quot; );
				document.write(&quot;</BODY></HTML>&quot;);
				document.close();
		return;
		}
</script>

I have a large help system that consists of 200+ CHMs that are merged into the main CHM. When I open the main CHM and navigate to the PDF link, click on it, the topic pane blanks out.
Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top