By Simon Carter, www.DataMystic.com
We've been getting more and more requests to have TextPipe's HTML Help manual available in a printable PDF format, particularly from large customers. TextPipe is a complex data extraction and conversion product, and we decided to charge a nominal fee for the manual ($US 9.99), since many users are happy to work with the HTML Help file. What follows is a description of how we used TextPipe to convert our existing HTML Help files (in FrontPage 2003 format) to a Help and Manual format.
Our existing help file had multiple folders, and shared borders on the top, left and bottom. During H&M Import, the top border was correctly identified but we needed to have it and the other shared borders removed for PDF output. After backing up our help file folders, we used TextPipe to find the perl pattern:
and replace it with nothing, removing all shared borders. At this stage we also cleaned up the help file by removing comments, scripts and an embedded feedback form which we would re-work later.
Code: Select all
After these changes and recompiling, we then imported textpipe.chm into H&M. We were surprised to find about 20 topics not linked into the Table of Contents, so we fixed these up and also reorganized the TOC structure. WAY easier than Microsoft's HTML Help Workshop! We also found 10 links pointing nowhere which we fixed up.
Next we had to re-instate the shared borders, but only for HTML Help Output (not for PDF files). Under Project > Project Properties > HTML Help > Topic Pages, we inserted our own text for the top and bottom border (H&M doesn't support left borders or the FrontPage navigation structure). At the top, we pasted our style sheet contents between <style>…</style> tags, and then pasted in the main table from _borders\top.htm. This gave us the main structure, but we still needed to edit the links so that they would work with H&M. We applied a TextPipe filter to just the HREF tags of links (not of images or style sheets), and only to relative references (ie not external links starting with http:). For these, we:
- Replaced %20 or space with an underscore (_)
- Removed leading \ or / - H&M doesn't like them
- Replaced \ with underscore (_), because H&M's flattens FrontPage's folder structure
- Standardized all file extensions to .htm (we found several file with .html)
We also used H&M's XML Export and Import to apply TextPipe Web to all help file Topics once we had them in H&M format.
This whole process was made much easier by unchecking the option "Delete temporary files" in HTML Help export dialog box. This creates a folder \~tmpchm with all the temporary files, so we could see what the links were really pointing to.
The TextPipe filters we used for the process are attached to this posting.
For more information about TextPipe Web vist http://www.DataMystic.com