Introduction

What is HTMLtoPDF?

HTMLtoPDF is an OS/2 Presentation Manager (PM) front-end for the htmldoc program. htmldoc converts HTML source files into PDF or PostScript format for use with the Adobe Acrobat reader software or GhostScript, etc. It can also convert multiple HTML files into a single HTML "book" complete with unified table of contents and more.

HTMLtoPDF is, I hope, a user friendly tool. The interface is simple and clearly labelled. The only thing you must learn are the header and footer codes, however I go into more detail on these later in this documentation so please read forward. Also, each header or footer selection displays a brief example in the HTMLtoPDF window of the output you will receive by using that particular selection.

Because HTMLtoPDF is only a front-end for htmldoc, which is a separate program by another author, as long as you have successfully installed htmldoc and placed htmldoc.exe in your system path (see CONFIG.SYS), and as long as the command line field at the bottom of the HTMLtoPDF window displays the correct options which you have selected, anything which does not output correctly may be due to an unsupported feature in htmldoc. For example, if you happen to be using htmldoc 1.8.9 and you have selected the "/" option for page numbering in footers, you will not see this output correctly because "/" was not supported in htmldoc 1.8.9. HTMLtoPDF itself does not perform any processing of your HTML or PDF/PostScript files.

System requirements

Hardware

HTMLtoPDF has been tested on my 800MHz Athlon system with 512MB of RAM. However I suspect the actual system requirement is much, much lower. There is no intensive processing being done by this program, so it probably will run even on an old 386 computer. Any system which is able to run OS/2's WorkPlace Shell (default graphical user interface for OS/2 2.x and later) should run HTMLtoPDF without any problems.

Software

You must have already installed htmldoc for OS/2 before you can use HTMLtoPDF. Version 1.0 of HTMLtoPDF is designed to work with htmldoc version 1.8.14 or later, as some of the header and footer options were not available in the earlier htmldoc 1.8.9 release. Be sure that you download the htmldoc version which runs at an OS/2 command prompt. I recomment Alexander Mai's port of htmldoc 1.8.15 which can be downloaded from: http://homepages.tu-darmstadt.de/~st002279/os2/html/os2stuff.html#htmldoc

Also you must be running OS/2 version 2.1 or later (ie. Warp 3, Warp 4, Warp Server for eBusiness, or eComStation) with PMShell as the graphical user interface/desktop.

Installation

HTMLtoPDF is ready to run. Just unzip the archive to a directory of your choice and run DEHTMLtoPDF.exe. You can also create a desktop object for the program by using OS/2's built-in "Create Another... Program Object" desktop menu item. Just point this object to the DEHTMLtoPDF.exe file wherever you unzipped it and then you can double click the icon to launch this program.

If you decide to move HTMLtoPDF.exe from its original location, then be sure to move DEHELPER.DLL with it, or place DEHELPER.DLL into a directory that's in your system LIBPATH (eg. c:\os2\dll\).

Using HTMLtoPDF

The documentation you are currently reading was built using HTMLtoPDF.

Here is a screenshot of HTMLtoPDF version 1.0 as it should look the first time you run it.

Using HTMLtoPDF is as simple as clicking the "Open" button, selecting your input HTML file, setting options with the radio buttons and drop-down lists, then clicking the "Execute" button at the bottom. If necessary (for instance, if an htmldoc option you want to use is not shown on the HTMLtoPDF window) you can enter additional parameters in the command window just above the "Execute" button.

As of version 1.01, HTMLtoPDF may also be started by dragging and dropping a single HTML file onto the HTMLtoPDF desktop icon. This loads the program with the dropped file's name set as the source file and the destination filename set. Additional output options may then be set as normal.

Additional options such as page size and orientation can be found by clicking the "More Options" button on the main HTMLtoPDF window.

The built-in command line field of HTMLtoPDF is a direct interface to the htmldoc program. As such, it accepts all commands and parameters which are supported by your installed version of htmldoc. These include but are not limited to:

(taken from htmldoc 1.8.14 documentation)

--batch filename.book
--bodycolor color
--bodyfont {courier,times,helvetica}
--bodyimage filename.{gif,jpg,png}
--book
--bottom margin{in,cm,mm}
--browserwidth pixels
--charset {8859-1...8859-15}
--color
--compression[=level]
--datadir directory
--duplex
--effectduration {0.1..10.0}
--encryption
--firstpage {p1,toc,c1}
--fontsize {6.0..24.0}
--fontspacing {1.0..3.0}
--footer fff
{--format, -t} {ps1,ps2,ps3,pdf11,pdf12,pdf13,pdf14,html}
--gray
--header fff
--headfootfont {courier{-bold,-oblique,-boldoblique}, times{-roman,-bold,-italic,-bolditalic}, helvetica{-bold,-oblique,-boldoblique}}
--headfootsize {6.0..24.0}
--headingfont {courier,times,helvetica}
--help
--helpdir directory
--jpeg[=quality]
--landscape
--left margin{in,cm,mm}
--linkcolor color
--links
--linkstyle {plain,underline}
--logoimage filename.{gif,jpg,png}
--owner-password password
--no-compression
--no-duplex
--no-encryption
--no-links
--no-numbered
--no-pscommands
--no-title
--no-toc
--no-truetype
--numbered
{--outdir, -d} dirname
{--outfile, -f} filename.{ps,pdf,html}
--pageduration {1.0..60.0}
--pageeffect {none,bi,bo,d,gd,gdr,gr,hb,hsi,hso,vb,vsi,vso,wd,wl,wr,wu}
--pagelayout {single,one,twoleft,tworight}
--pagemode {document,outline,fullscreen}
--path "dir1;dir2;dir3;...;dirN"
--permissions {all,annotate,copy,modify,print,no-annotate,no-copy,no-modify,no-print,none}
--portrait
--proxy http://host:port
--pscommands
--quiet
--right margin{in,cm,mm}
--size {letter,a4,WxH{in,cm,mm},etc}
--textcolor color
--textfont {courier,times,helvetica}
--title
--titlefile filename.{htm,html,shtml}
--titleimage filename.{gif,jpg,png}
--tocfooter fff
--tocheader fff
--toclevels levels
--toctitle string
--top margin{in,cm,mm}
--truetype
--user-password password
{--verbose, -v}
--webpage

NOTE: htmldoc 1.8.x (all versions) does not support page headers on the first page of a chapter when using --book as the output format. Do not be alarmed (as I was) if you output in --book format and do not see headers on some pages.

The fff strings above should be replaced by groups of three characters from the list below. These are the settings for the page headers and footers of the PDF output file. In HTMLtoPDF they can be directly entered through the command field or through pull down menus arranged in the order they will appear on your PDF pages. For the sake of consistency, the pull down menus display the actual character which htmldoc understands (all listed below) and a short example of the output is also given if you use the pull down menus.

Each "f" in fff can be one of:

. = blank
/ = n/N arabic page numbers (1/3, 2/3, 3/3)
: = c/C arabic chapter page numbers (1/2, 2/2, 1/4, 2/4, ...)
1 = arabic numbers (1, 2, 3, ...)
a = lowercase letters
A = uppercase letters
c = current chapter heading
C = current chapter page number (arabic)
d = current date
D = current date and time
h = current heading
i = lowercase roman numerals
I = uppercase roman numerals
l = logo image
t = title text
T = current time

NOTE: htmldoc versions before 1.8.15 do not properly support the "current chapter page number" feature. Instead of showing, for instance, 1/2 and 2/2 they will show 0/2 and 1/2. htmldoc 1.8.15 corrects this problem, so I recommend using that version.

At this time there is no automatic alert that your output file has been created. This is planned for a future release. However if you have properly installed htmldoc per that program's instructions and set your environment variables correctly in your CONFIG.SYS file, then the conversion should take only a few seconds. You will normally hear your hard drive accessing its disk and then return to normal. This means the conversion is done. You should then open your output file (in Adobe Acrobat or GSView, in the case of PDF and PS output, or in a web browser in the case of HTML output) to be certain it looks the way it should.

Future Plans

The following features are planned for a future release of HTMLtoPDF.

Support

This product is provided as-is

HTMLtoPDF is provided as-is, with no guarantees or warranties of any sort. However, if you are experiencing problems with HTMLtoPDF, then please contact me as I would like to make the program useful to as many OS/2 users as possible.

Contacting the author

As of February 2002, I can be contacted at:

Don Eitner (freiheit@syntheticdimension.net)

Copyright & License

HTMLtoPDF is copyright 2001, 2002 by Don Eitner.

HTMLtoPDF is donation-ware. If you find it useful and appreciate the work the author has done, you are asked but not obligated to send the author a small donation of US $5 to help encourage continued development and more advanced features. Donations may be made via PayPal (http://www.paypal.com) to the e-mail address shown above.