Answered by Rob Cavicchio, MSVP. Thanks, Rob.
I saw the thread on HATT.
In the event folks may find this thread later and want to know what Rob actually suggested instead of knowing he fixed it, here is a copy/paste from Rob's reply on HATT. (Rob is a Microsoft Help MVP)
=====> Begin Copy/Paste <=====
Not as elementary as it seems. The CHM is a self-contained file system, much
like a ZIP file. When you use a relative path from a file inside the CHM, it
goes to another file inside the CHM, not to the actual file system. To do
his brother wants to do this, so there's a Microsoft KB article on it:
To ensure that the PDF opens in a separate PDF reader rather than in the
browser, you'd want to write the URL to a Shortcut object rather than to a
link, something like the following:
function setPDFPath(fn, text)
var X, Y, sl, a, ra, link;
ra = /:/;
a = location.href.search(ra);
if (a == 2)
X = 14;
X = 7;
sl = "\\";
Y = location.href.lastIndexOf(sl) + 1;
link = 'file:///' + location.href.substring(X, Y);
// ACCOUNT FOR PATHS THAT GO UP IN THE TREE;
while( fn.indexOf('../') == 0 )
fn = fn.substring( 3, fn.length );
link = link.substring( 0,
link.lastIndexOf(sl, link.lastIndexOf(sl) - 1) + 1 );
link += fn;
).insertAdjacentHTML( 'afterBegin', '<object
type="application/x-oleobject"><param name="Command" value="ShortCut"><param
name="Button" value="Text:' + text + '"><param name="Item1" value=",' + link
+ ',"></object>' );
<body onload="setPDFPath('../docs/glyphref.pdf', 'Click to open the PDF');">
For WebHelp, you might be stuck. I'm not sure there's a consistent and
reliable way to ensure that a PDF opens in a separate window if a user has a
PDF plug-in installed. You can try to force it to be treated as an
executable file by playing around with MIME types via the <a> element "type"
attribute, but I think those are often ignored.
=====> End Copy/Paste <=====
Didn't think many people cared, with only 7 views yesterday! Rob also notes that you need to remove extra line breaks in the posted code at the line beginning document.getElementById.
This works with the PDF, but RoboHelp removes the line <p><span id="pdflink"></span></p>. I got around it by saving it as a snippet. Now if I could only get it to launch an swf. ...