The Command line
Command-line parameter were widely used in the DOS days, when programs were called by typing their file name, which may be followed by additional parameters. In the present time parameters are commonly used in .bat files and by computer programmers, but many Window users also use them.
Bersoft HTML Print is designed to work with and be called by other software or at least, by a batch file, passing the filename (HTML page, GIF, JPEG, BMP, PNG, WMF or EMF image) to be printed as a parameter in the command line.
Examples:
htmlprint.exe myfile.html
htmlprint.exe
myimage.pgn
htmlprint.exe mygraph.emf
HTMLPrint runs as a visible application only when it is started without passing any argument in the command-line.
Although HTMLPrint looks for a configuration file named HTMLPRINT.INI, situated in its same directory, it is possible to use other configuration file, passing the filename as the second command-line argument.
Example:
htmlprint.exe myfile.html
conf1.ini
Passing
alternative configuration files in the command line is useful to configure
HTMLPrint in different ways.
If
any filename passed in the command line have spaces, it always should
be enclosed in double quotes. Example:
htmlprint.exe "images
of the beach.html" "c:\Program
files\conf\configuration.ini"
If relative paths are used, they should be relative to the location of HTMLPrint.
Specifying the page range to be printed (only applies when using the Embedded Printer Engine mode. See Printing Modes)
By adding a third parameter to the command line it is possible to specify the range of pages to be printed. Notice that the following example separates the starting and ending page with a hyphen, also, since the second parameter (the .ini filename) is not used, it is replaced by a hyphen. If the second parameter is not used, always replace it by a hyphen.
htmlprint.exe
myfile.html - 5-9
Additional Command Line Switches
The following switches always should be added at the end of the command line.
|
/P |
Set the printer to be used. |
|
/H |
Set the footer. |
|
/F |
Set the header. |
|
/CP |
HTMLPrint will count and return the number of pages in the HTML document, instead printing it. |
Example:
htmlprint.exe doc1.htm /P="HP LaserJet 4000" /H="<!--C#-->" /F="<!--D#-->"
If any of these three Command Line Switches is specified, they will take precedence over the configuration file settings.