The Command-line Interface is provided as an executable file. You can call it from either a Windows batch file or a Solaris / Linux / Macintosh / HP-UX / AIX shell script.
AH Formatter V5.0 can be executed from the Command-line Interface by:
The executable file names are as follows:
Windows | AHFCmd.exe |
---|---|
Solaris / Linux / Macintosh / HP-UX / AIX | AHFCmd |
Environment Variables have to be set in order to execute these files. In the Windows version these are automatically set by the installer. In the non-Windows versions they have to be set. Please refer to Environment Variables.
To run the command-line program of AH Formatter V5.0 for Windows, enter the following command.
> cd [Install directory] > AHFCmd -d samples\sample.fo -o \tmp\sample.pdf
If AH Formatter V5.0 for Windows is successfully installed, the following message will be displayed.
AHFCmd : AH Formatter V5.0 for Windows (5,0,XXXX,XXXX) Copyright (c) 1999-2009 Antenna House, Inc. AHFCmd : Formatting finished normally.
Then you can view sample.pdf in the \tmp directory.
In AH Formatter V5.0 for non-Windows, the installation program will place the shell script file named run.sh in the [Install directory]. This is a sample shell script for running the command-line program AHFCmd. This script sets the necessary environment variables in the shell, and runs AHFCmd. To run the command-line program of AH Formatter V5.0 for non-Windows using this script, enter the following command from your terminal window.
$ cd [Install directory] $ ./run.sh -d samples/sample.fo -o /tmp/sample.pdf
If AH Formatter V5.0 for non-Windows is successfully installed, the following message will be displayed. Then you can get sample.pdf in /tmp directory.
AHFCmd : AH Formatter V5.0 for Xxxxxx (5,0,XXXX,XXXX) Copyright (c) 1999-2009 Antenna House, Inc. AHFCmd : Formatting finished normally.
The same parameters in the same formats apply to both AHFCmd and run.sh.
The following parameters apply to the Command-line Interface: Parameters with * in the following table indicate a negative meaning if no is placed in the beginning of the command. For example, -nomultivol cansels to output PDF in separate volume. no-LT
When specifying a path name that contains a space, the path name must be enclosed in double quotation marks. If two conflicting parameters are specified, the last parameter on the line takes precedence.
Parameter | Functions |
---|---|
-d Document | Specifies the URI of the target XML/FO/HTML document to be formatted.
|
-s Stylesheet |
Specifies the URI of the target XSL/CSS document.
If the specified XML document is FO, or the XML file contains the processing instruction <?xml-stylesheet ...?> and the stylesheet is specified, or the specified document is HTML, there is no need to specify a stylesheet.
An XSLT processor is necessary to use XSL stylesheets. In the Windows version, MSXML4 or MSXML3 is used as the standard XSLT processor. If you want to use another XSLT processors or in non-Windows version, you need to set which XSLT processor you are going to use. Setting the XSLT processor is performed by "Environment Variables" or "Option Setting File". If the specified document is CSS, it will be the last user stylesheet. It is applied posterior to the stylesheet added by -css and the option setting file specified by -i. |
-f Formatter-Type |
Specifies the formatter type from the following:
|
-css User-Stylesheet | Specifies the CSS user stylesheet you want to add. -css can be specified any number of times. It is applied by specified order prior to the stylesheet specified by -s. V5.0 |
-htmlcs Decalt-HTML-Charset | Specifies the default encoding of HTML. This setting is applied to HTML whose encoding is unknown. If this parameter is omitted, UTF-8 is considered as default. V5.0 |
-o Output-File |
Specifies the path name of the resulting output file.
|
-i Option-Setting-File | Specifies the path name of "Option Setting File" which defines AH Formatter V5.0 options in XML-format. Any number of these parameters can be specified. If any content of this file is changed it automatically overwrites the previous settings. Because only a described parameter in the Option Setting File is evaluated, it is possible to change a part of setting by adding a file that describes those parameters that should be changed. If conflicting values for a parameter are specified in the Option Setting File and the Command-line, then the Command-line value takes precedence. |
-ix | Imports AHFSettings.xml (AHFSettings(x64).xml for Windows x64 version) in the application data directory indicated as the environment variable APPDATA as the option setting file. This parameter is equivalent to
-i "[APPDATA]\AntennaHouse\AHFormatter\5.0\AHFSettings.xml"
or
-i "[APPDATA]\AntennaHouse\AHFormatter\5.0\AHFSettings(x64).xml"
Effective only for Windows version.
|
-p Printer-Name |
Specifies the printer name where the formatted result is outputted
If this parameter is omitted, -p @PDF is automatically specified.
Please refer to "PDF Output" for PDF output info. Please refer to "SVG Output" for SVG output info. Please refer to "PostScript Output" for PostScript output info. Please refer to "INX Output" for INX output info. Please refer to "XPS Output" for XPS output info. Please refer to "TEXT Output" for text output info. @TEXT and @AreaTree are not effective with AH Formatter V5.0 Lite. |
-start Start-Page -end End-Page |
Specifies the start page and the end page of output document. If the start page is omitted or the specified value is 0 or less, the start page is considered the first page. If the end page is omitted or the specified value exceeds the actual page number, the end page is considered the last page. If the setting is inconsistent, (for example, -start 5 -end 3) an error occurs.
|
-multivol * | Specifies to output PDF in separate volume. The error occurs when FO doesn't include the axf:output-volume-info extension property. When this parameter is specified, -start/-end can be specified as the unit of separate volume. |
-2pass * | When formatting a huge document with a large amount of unresolved <fo:page-number-citation>, a large amount of memories are consumed because the cancellation of the page information is impossible. Therefore, the limit is caused in the number of pages to format. This parameter solves that problem by making the formatting two passes. Although its processing time may be increased, only the page number information which should be solved will consume the memory and the memory consumption will be extremely decreased. Please refer to "Formatting Large Document". no-LT |
-base BaseURI | Specifies the default base URI. |
-param name=value | Specifies the parameter name and the value of xsl:param used with the XSLT transformation. If the value contains a white space, please specify "name=value". -param can be specified multiply. |
-fontalias name=substname | Specifies font substitutions. If the option -fontalias A=B is specified, all of font family-name A in the FO file will be substituted with font B. If you are going to specify multiple substitutions, you must specify the -fontalias parameter for every substitution. You can also specify this option using the "Option Setting File". The substitution is not recursive, or is done only once. |
-x Error-Level |
Permits setting the error level at which AH Formatter V5.0 will stop formatting and
abort the job.
|
-silent | Suppresses the output of error information. Normally error information is sent to stdout or stderr. |
-stdout | Error information is sent to stdout only if this parameter is specified. It is outputted to stderr by default. |
-stderr | Error information is also sent to stderr if this parameter is specified. It is outputted to stderr by default. |
-pgbar * | Outputs the progress of the page generation to the console. |
-v | Shows the version, copyright and license information. Cannot be used with any other parameter. |
-h or -? | Displays a list of all the Command-line parameters. |
Parameter | Functions | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
-pdfver Version | Specifies the PDF version from the following:
| ||||||||||
-tpdf * | Generates Tagged PDF. Ignored if PDF cannot be tagged depending on the PDF versions.no-LT | ||||||||||
-lpdf * | Generates linearized PDF optimized for the display on the Web. no-LT | ||||||||||
-dsig * | Specifies to apply a Digital Signature.
When there is no signature field, a disital signature is not applied.no-LT
| ||||||||||
-encrypt Key-Length | Specifies the key length when encrypting the PDF file during outputting. The key length can be specified as either 40 or 128 (bit). Ignored when you specify PDF 1.3. | ||||||||||
-userpwd Password | Specifies the user password required to open the PDF. The password must be less than 32 bytes. | ||||||||||
-ownerpwd Password | Specifies the owner password for PDF. The password must be within 32 bytes. | ||||||||||
-npt * |
Prohibits printing the PDF file.
It is necessary to specify -ownerpwd so that this parameter is effective. | ||||||||||
-ncg * |
Prohibits making changes of the PDF file.
It is necessary to specify -ownerpwd so that this parameter is effective. | ||||||||||
-ncc * |
Prohibits copying the content of the PDF file.
It is necessary to specify -ownerpwd so that this parameter is effective. | ||||||||||
-nca * |
Prohibits adding comments and form fields to the PDF file.
It is necessary to specify -ownerpwd so that this parameter is effective. | ||||||||||
-nff * | Prohibits filling in of form fields and signing of the PDF file. Ignored when you specify PDF 1.3. In order to make this parameter effective, other parameter settings may be required. See also the 'PDF Reference' from Adobe Systems Incorporated for more details. | ||||||||||
-nab * | Prohibits text access for screen reader devices of the PDF file. Ignored when you specify PDF 1.3. | ||||||||||
-nad * | Prohibits inserting, deleting and rotating the PDF pages. Ignored when you specify PDF 1.3. | ||||||||||
-peb Value |
Specifies whether to embed the embeddable fonts in PDF or not with one of the following values.
| ||||||||||
-pee Fontname | Embeds the specified font in the PDF. If you want to specify multiple fonts, put commas between the fonts. | ||||||||||
-pef * | An error is not issued when font embedding fails. | ||||||||||
-peg * | An error is not issued when glyphs are missing. | ||||||||||
-pex * | An error is not issued when PDF/X or PDF/Ais generating. no-LT | ||||||||||
-ppa Value |
Specifies whether to permit printing of the created PDF with one of the following values. This parameter is effective only when you specify PDF version 1.4 or later.
| ||||||||||
-picc Value |
Selects how to compress the color images embedded in PDF.
| ||||||||||
-picg Value |
Selects how to compress the grayscale images embedded in PDF.
| ||||||||||
-picm Value |
Selects how to compress the monochrome images embedded in PDF.
| ||||||||||
-pidc Value |
Selects how to downsample the raster color images embedded in a PDF with the following values.
| ||||||||||
-pidct dpi | |||||||||||
-pidca dpi | |||||||||||
-pidg Value |
Selects how to downsample the raster grayscale images embedded in PDF using the following values.
| ||||||||||
-pidgt dpi | |||||||||||
-pidga dpi | |||||||||||
-pidm Value |
Selects how to downsample the raster monochrome images embedded in PDF using the following values.
| ||||||||||
-pidmt dpi | |||||||||||
-pidma dpi | |||||||||||
-pjq Percent | Specifies the quality of the raster graphics when specified JPEG format by -picc or -picg using the range of 1-100(%). A higher % increases the image quality. However the file size also becomes larger. The initial value is 80. | ||||||||||
-pcs * | Specifies not to compress text and line art in the PDF. | ||||||||||
-plr * | Specifies whether the external link specified by the relative address is transformed into 'Open the file' or into 'World Wide Web link' in the PDF link properties. When -plr is specified, it is transformed to 'World Wide Web link'. When -noplr is specified, it is transformed to 'Open the file'. If the document is designed to be viewed on a browser then it is suggested to use the world wide web –plr as the default setting. | ||||||||||
-prc Value |
Specifies how to convert the RGB color space (DeviceRGB) to DeviceGray.
| ||||||||||
-prr dpi | Specifies the resolution value of the transformed raster images from 70 to 500(dpi). This parameter is available only in the Windows version and should be set with consideration of on whether better image quality or file size is more important. | ||||||||||
-pdfscale scale | Specifies the scaling ratio of the PDF to output. A value without a unit or % value can be specified as a scale (1.0 = 100%). When -pdfwidth is specified after - pdfscale, -pdfscale will take priority. The same applies to -pdfheight. | ||||||||||
-pdfheight length | Scales the output height of PDF. Height values can be specified as a unit or a % value. | ||||||||||
-pdfwidth length | Scales the output width of PDF. Width values can be specified as a unit or a % value. | ||||||||||
-pds * | Applies the digital signature the signature field in PDF. Refer to Digital Signature for more details. no-LT | ||||||||||
-pdss name | Specifies the name of the signature information to be used when applying a digital signature. Refer to Digital Signature for more details. no-LT | ||||||||||
-pdsc name | Specifies the name of the certificate information to be used when applying a digital signature. Refer to Digital Signature for more details. no-LT |
Parameter | Functions | ||||||||
---|---|---|---|---|---|---|---|---|---|
-svgver Profile |
Specifies the SVG profile:
| ||||||||
-svgip Method |
Specifies how to treat images within the SVG file.
| ||||||||
-svgicp Directory | Specifies the destination for images when '1' or 3 is selected for the -svgip parameter (Outputs the image as an external file). When a relative path is used to specify the Directory, the path will be relative to the output path specified with -o. When -o is the standard output, an error will occur if the relative path is specified. Then it is necessary to specify an absolute path. | ||||||||
-svgiren * | Specifies whether to rename all file names to the prefix specified by -svgiprfx, or to use the original name when images are copied to the directory specified by -svgicp. When the file name is duplicated, a sequential number is added. When -svgiren is specified, all files are renamed. | ||||||||
-svgiprfx Prefix | When images are copied to the directory specified by -svgicp, specifies the prefix of the file name. The file name will be prefixed followed by sequence number. When it is not specified, they are only sequential numbers. | ||||||||
-svggzip * | Outputs SVG compressed in gzip. | ||||||||
-svgsingle * | A document composed of multiple pages is outputted as a single SVG file. | ||||||||
-svgfmt Format | When the original document has multiple pages and -svgsingle parameter is not specified, each page will be output as an SVG files that has a consecutive number at the end of the file name. This parameter specifies the format of those consecutive numbers. For example, when "document.svg" is specified as the name for the output file, by specifying "-01" for -svgfmt parameter the output files will be document-01.svg, document-02.svg and so on. If this parameter is omitted, "1" is considered as specified. | ||||||||
-svgspn * | When -svgsingle is not specified and the output SVG has only one-page, the sequential number specified by -svgfmt is not added. | ||||||||
-svgea * | Embeds all fonts that can be embedded in the SVG. | ||||||||
-svgee Font-Name | Embeds the specified font in SVG. If you want to specify multiple fonts, put commas between fonts. | ||||||||
-svgef * | An error is not issued when font embedding fails. | ||||||||
-svgic Value |
Selects how to convert the raster images which may not be directly embedded in the SVG.
| ||||||||
-svgjq Percent | Specifies the quality of the raster graphics, when it is specified as JPEG for -svgic, using the range of 1-100(%). The quality becomes higher in proportion to the increase in the number; however the file size also becomes larger. The initial value is 80. | ||||||||
-svgrr dpi | Specifies the rasterized-resolution value of the transformed raster images from 70 to 500(DPI). This parameter is available only in the Windows version. |
Parameter | Functions | ||||||
---|---|---|---|---|---|---|---|
-inxomode Value |
Specify the INX output mode in INX Output option
|
Parameter | Functions |
---|---|
-tenc Encoding | Specifies the encoding for TEXT Output. If this parameter is omitted, UTF-8 is adopted. See also TEXT Output Setting for more detail. |
-teol EOL-mark | Specifies the end-of-line code for TEXT Output. If this parameter is omitted, CRLF is adopted. See also TEXT Output Setting for more detail. |
Text Output cannot be performed with AH Formatter V5.0 Lite.
Values can be added using one of the following units.
Representation | Meanings |
---|---|
cm | centimeter |
mm | millimeter. 1 mm = 1/10 cm |
in | inch. 1 in = 2.54 cm |
pt | point. 1 pt = 1/72 in |
pc | pica. 1 pc = 12 pt |
jpt | 1 jpt = 0.3514 mm V5.0 |
q | 1 q = 0.25 mm V5.0 |
The following sample illustrates formatting sample.xml using XSL stylesheet sample.xsl and outputting the formatted result to sample.pdf.
In order to use the stylesheet in the non-Windows environment, it's necessary to specify external XSLT prosessor in the Option Setting File using -i parameter.
The following sample illustrates how to load the Option Setting File options.xml, format sample.fo and send the formatted result to a printer.
When executing formatting with a Command-line Interface, if the formatting is successful, it finishes the process with the return value of 0. If the formatting is not successful, the program finishes the process with a return value of 1. If the formatting is not performed because –v is not specified, the return value is 0.
The followings parameter settings apply only to the Windows version.
To send a file to a printer use a printer name from the Printers dialog in the Windows start menu or from Printers and Faxes in the Control Panel.
-p "Acrobat Distiller" -p "EPSON LP-2500"
The followings are effective only in the Windows version.
In the Windows environment, applications use the DEVMODE structure to exchange information about the printer settings. Also Windows printer drivers initialize themselves according to the information of the DEVMODE structure.
AH Formatter V5.0 provides XSLDev.exe as a utility to save the DEVMODE structure to a file.
When this program is launched, the "Print Setup" dialog will be displayed. You can choose printers from "Name" combo box or you can set various printer properties by clicking the "Properties" button. After you set up printer properties, click "save" button, the "Save As" dialog will be displayed. Specify a file name to save the print setup to. This will then modify DEVMODE structure as a "data file that records printer setup." You can specify this file name for the PrinterSetting property of the .NET/COM Interface or -ps Parameter of the command line interface or other interfaces. To quit this application, click "close" button.
When a printer setting file is specified, a document is printed unless -p option is specified. The following shows how it operates.
Prints a document by applying DEVMODE specified in the setting-file to the printer-name.
Outputs a document to PDF disregarding the -ps option.
Prints a document using the DEVMODE specified in the setting-file. If the printer-name is not specified in DEVMODE, the default printer is used.
When -collate or -copies is specified, the content of DEVMODE is overwritten.
See also restrictions in the Graphical User Interface.