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.
XSL Formatter V3.4 can be executed from the Command-line Interface by:
The executable file names are as follows:
Windows | XSLCmd.exe |
---|---|
Solaris/Linux/Macintosh/HP-UX/AIX | XSLCmd |
Environment Variables have to be set in order to execute these files. For Windows version these are automatically set by the installer. For the Solaris/Linux/Macintosh/HP-UX/AIX versions they have to be set. Please refer to Environment Variables.
To run the command-line program of XSL Formatter V3.4 for Windows, enter the following command.
> cd [Install directory] > XSLCmd -d samples\sample.fo -o \tmp\sample.pdf
If XSL Formatter V3.4 for Windows is successfully installed, the following message will be displayed.
XSLCmd : XSL Formatter V3.4 R1 Copyright (c) 1999-2005 Antenna House, Inc. XSLCmd : Formatting finished normally.
Then you can view sample.pdf in the \tmp directory.
On XSL Formatter V3.4 for Solaris/Linux/Macintosh/HP-UX/AIX, 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 XSLCmd. This script sets the necessary environment variables in script, and runs XSLCmd. To run the command-line program of XSL Formatter V3.4 for Solaris/Linux/Macintosh/HP-UX/AIX 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 XSL Formatter V3.4 for Solaris/Linux/Macintosh/HP-UX/AIX is successfully installed, the following message will be displayed. Then you can get sample.pdf in /tmp directory.
XSLCmd : XSL Formatter V3.4 R1 Copyright (c) 1999-2005 Antenna House, Inc. XSLCmd : Formatting finished normally.
The same parameters in the same formats apply to both XSLCmd and run.sh.
The following parameters apply to the Command-line Interface:
Parameter | Functions |
---|---|
-d XML-Document | Specifies the URI of the target XML/FO document to be formatted.
|
-s XSL-Stylesheet | Specifies the URI of the target XSL document.
|
-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 XSL Formatter V3.4 options in XML-format. Any number of these parameters can be specified. If the content of this file is changed it overwrites the previous settings. Because only the described parameter in Option Setting File is evaluated, it is possible to change a part of setting by adding the file that describes parameters that should be changed. If the same parameter is specified in both the Option Setting File and the Command-line, and the value is different, the Command-line takes precedence. |
-p Printer-Name |
Specifies the printer name where the formatted result is outputted
.
If it is omitted, -p @PDF is automatically specified.
Please refer to "PDF Output" for the PDF output. Please refer to SVG Output for the SVG output. Please refer to "Text Output" for the text output. @TEXT and @AreaTree is not effective with XSL Formatter V3.4 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. When -multivol parameter is specified, the value does not mean the page number but the separate volume number. For example -start 3 outputs the third separate volume. |
-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. |
-base BaseURI | Specifies the default base URI. |
-param name=value | Specifies the parameter name and the value of xsl:param. 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 the font family-name A in the FO file will be substituted by B. If you are going to specify multiple substitutions, please specify the -fontalias parameter per substitution. You can also specify this option using the "Option Setting File". The substitution is not recursive, in other words substitution is done only once. |
-extlevel Error-Level |
Permits setting the error level at which XSL Formatter V3.4 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 if this parameter is specified. It is outputted to stderr by default. |
-stderr | Error information is sent to stderr if this parameter is specified. It is outputted to stderr by default. |
-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 |
---|---|
-ps Printer-Setting-File | Specify the path name of the Printer Setting file. Please refer to "How to create a Printer Setting file". |
-copies Copies | Specifies the number of copies when outputting to a printer. Default value is 1. |
-collate -nocollate |
This parameter is effective only when multiple copies to be output. When -nocollate is specified, the same page is continuously printed as multiple copies. When -collate is specified, the print from the specified starting page to the end page is repeated. |
Parameter | Functions | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
-pdfver Version | Specifies PDF version:
|
||||||||||
-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). This parameter is effective only when you specify PDF1.4 or later with PDF version (-pdfver). | ||||||||||
-userpwd Password | Specifies the user password for PDF. The password must be within 32 bytes. | ||||||||||
-masterpwd Password | Specifies the master password for PDF. The password must be within 32 bytes. | ||||||||||
-npt | Prohibits printing the PDF file. | ||||||||||
-ncg | Prohibits making changes of the PDF file. | ||||||||||
-ncc | Prohibits copying the content of the PDF file. | ||||||||||
-nca | Prohibits adding comments and form fields to the PDF file. | ||||||||||
-nff | Prohibits filling in of form fields and signing of the PDF file. This parameter is effective only when you specify PDF1.4 or later to PDF version (-pdfver). In order to make this parameter effective, the setting of the other parameters 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. This parameter is effective only when you specify 1.4 or later with PDF version (-pdfver). | ||||||||||
-nad | Prohibits inserting, deleting and rotating the PDF pages. This parameter is effective only when you specify 1.4 or later with PDF version (-pdfver). | ||||||||||
-pea | Embeds all embeddable fonts when creating PDF. | ||||||||||
-pee Fontname | Embeds the specified font in the PDF. If you want to specify plural fonts, put commas between fonts. | ||||||||||
-pef | An error is not issued when font embedding fails. | ||||||||||
-peg | An error is not issued when glyphs are missing. | ||||||||||
-ppa Value |
Specifies whether to permit printing PDF to create with one of the following values. This parameter is effective only when you specify 1.4 or later with PDF version.
|
||||||||||
-pic Value |
Selects how to compress the color images embedded in PDF following.
|
||||||||||
-picg Value |
Selects how to compress the grayscale images embedded in PDF.
|
||||||||||
-picm Value |
Selects how to compress the monochrome images embedded in PDF.
|
||||||||||
-pjq Percent | Specifies the quality of the raster graphics when stored in JPEG format 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. | ||||||||||
-pcs | Specifies not to compress text and line art in PDF. | ||||||||||
-plr -noplr |
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'. | ||||||||||
-prc Value |
Specifies how to convert the RGB color space (DeviceRGB) to DeviceGray.
|
||||||||||
-prr dpi | Specifies the value of the rasterized-resolution of the transformed raster images in the range from 70 to 500(dpi). This parameter is available only in the Windows version. | ||||||||||
-lpdf -nolpdf |
When -lpdf is specified, generates linearized PDF. When -nolpdf is specified, generates non-linearized PDF. 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 to copy images to as specified in 1 or 3 for -svgip parameter. When a relative path is used to specify the Directory, outputted is to the relative path from the specified output path by the -o parameter. 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 use original name when images are copied to the directory specified by -svgicp. When the file name overlaps, 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 | The 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 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 plural 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 embedded in SVG directly.
|
||||||||
-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 value of the rasterized-resolution of the transformed raster images in the range from 70 to 500(dpi). This parameter is available only in the Windows version. |
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. |
When specifying a path name that contains a space the path name must be enclosed in double quotation marks. When the same parameter or a contrary parameter is specified, the last specified becomes effective.
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 the Command-line Interface, if the formatting is successfully performed, it finishes the process with the return value of 0. If the formatting is not successful, it finishes the process with the return value of 1. If the formatting is not done by specifying -v, the return value is 0.
The followings parameter settings apply only to the Windows version.
To send a file to a printer use the printer name that is specified in the list of installed printers in the Printers dialog in the Windows start menu or Printers and Faxes in the Control Panel.
-p "Acrobat Distiller" -p "EPSON LP-7100"
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. XSL Formatter V3.4 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.
The printer setting file created by XSL Formatter V2.5 AXFODEV.exe can be used with XSL Formatter V3.4 without change.
See also restrictions in the Graphical User Interface.