Command Line Interface
You can process an XML or HTML document from a command-line interface like this:
chemistry -in my_file.xml -out my_file.pdf
chemistry -in my_file.html -out my_file.pdf
You can specify one or more CSS files to be used. If the document is an HTML document, it may
include references to other stylesheets or styles can be embedded using the
<style> element. The command-line CSS files take precedence over
files referenced from the document:
chemistry -in my_file.html -out my_file.pdf -css style1.css style2.css
Required Parameters
- -in
- The input XML or HTML file in URI or File syntax.
-in http://my.example.com/my_file.html
-in C:\my.folder\my_file.xml
- -out
- The output PDF file in File syntax.
-out C:\publishing\my_file.pdf
Optional Parameters
- -catalog-prefer
- Catalog preference mode. Possible values are: 'system' or 'public'. Default is 'public'.
- -catalogs
- The path to one or more XML catalogs, in URI or File syntax. You can separate the paths by using the ";" (semi-colon) character. You can use a catalog to solve DTD or Schema references to local files. If the list of catalog files is big, you may run into command-line size limitations. In this case, consider passing it as the XML_CATALOG_FILES environment variable.
- -css
- A list of CSS files, in URI or File syntax, separated by spaces.
-css http://my.example.com/css/pages.css http://my.example.com/css/fonts-and-colors.css
If you want to process an HTML document, this parameter is optional. If you specify a CSS, it is considered to be more important than the ones referenced from the document (for example, using the<link>element or thexml-stylesheetprocessing instruction). - -disable-xinclude
- A security setting that disables XML inclusions (XInclude). This is recommended when using Chemistry in a Web context. In addition, you should use a Java Security Manager to control the exact permissions granted to the processor.
- -disable-xxe
- A security setting that disables XML external entities. This is recommended when using Chemistry in a Web context. In addition, you should use a Java Security Manager to control the exact permissions granted to the processor.
- -dump-fo
- Dumps the FO file (before converting it to PDF) in the same location as the output file. This can be used for debugging purposes.
- -drop-block-margins-at-page-boundary
- Specifies that the top and bottom margins associated with a block element should be
discarded when the block is at the top or bottom of the page. Allowed values:
- yes (default)
- no
- -dump-styled-content
- Dumps the intermediate, annotated XML file in the same location as the output file. This can be used for debugging purposes.
- -enable-latin-ligatures
- Used to enable ligatures between some of the characters from the Latin glyph range.
The character sequences that might be combined are highly dependent on the font, but
they are usually: "fi", "fl", "tt". Note: This parameter is deprecated. Use the
font-variant-ligaturesCSS property instead. See Font Ligatures for more information. - -enable-latin-glyph-substitutions
- When set to yes (default), glyph substitution is enabled (if the particular
font supports it). This applies to Latin-based scripts only (the substitutions are
always enabled in other types of scripts). If you encounter problems rendering or
copying accented glyphs (i.e. umlauts or other diacritics),
it might be helpful to set this parameter to no to disable the font glyph
substitutions. Another example of a case when you might need to disable the
substitutions is a situation where an accented character cannot be mapped to a
compound glyph, resulting in the glyph not being rendered in the PDF output.Warnings:
- Disabling substitutions also disables Latin ligatures.
- Disabling substitutions is not recommended unless absolutely necessary. It is better practice to use another font if you can find one that does not have the rendering issues.
- -fonts-dir
- The directory with additional fonts. The TTF files should be placed directly in it (no subdirectory).
- -help
- Prints the usage information.
- -http-proxy-host
- The HTTP proxy host.
- -http-proxy-port
- The HTTP proxy
port.
-http-proxy-host my.proxy.server -http-proxy-port 3128
- -hyph-dir
- The directory that contains additional hyphenation dictionaries. The XML files should be placed directly in it (not a subdirectory) and they should be named using the language code (e.g. en.xml). For more information about adding or altering dictionaries, see: Hyphenation.
- -image-resolution
- The resolution (in DPI) of the raster images (an integer), for images that do not provide this meta information. For changing the resolution using CSS, see: Image Resolution.
- -licensekey-dir
- Specifies the directory where the license key file is located. The license key file should have the name licensekey.txt.
- -log4j-file
- Full path to a log4j configuration file.
Example:
name = PropertiesConfig # R is the standard output appender.R.type = Console appender.R.name = R appender.R.layout.type = PatternLayout appender.R.layout.pattern = %r %p [ %t ] %c - %m%n logger.stages.name = com.oxygenxml.chemistry.stages logger.stages.level = info logger.FontFileFinder.name = org.apache.fop.fonts.autodetect.FontFileFinder logger.FontFileFinder.level = info logger.FopConfParser.name = org.apache.fop.apps.FopConfParser logger.FopConfParser.level = error rootLogger.level = info rootLogger.appenderRef.stdout.ref = R
- -no-aggressive-hyphenation
- Oxygen PDF Chemistry normally uses an aggressive technique to create hyphenation
points at underscores, dots, and case changes. To disable this functionality, use this
-no-aggressive-hyphenationparameter. - -no-network
- Denies access to all your network connections. If your XML document or CSS files reference remote resources, the transformation will fail.
- -no-rtl-mirroring
- Disables switching of left and right margins, padding, and borders for right-to-left content. To make stylesheet development easier, the left margin automatically becomes the right margin when the paragraph has an RTL orientation.
- -pdf-ua
- Produces output that conforms to PDF/UA-1 accessibility standards. Conversion will break if fonts are not embedded. See: Accessibility (508 Compliance).
- -pdf-version
- Use this parameter to specify the version of the produced PDF. It has no impact on the set of PDF features used by the engine, but may be used to signal a compatibility level to the PDF readers. The default is 1.5.
- -show-changes-and-comments-as-pdf-sticky-notes
- When set to yes (default), the review elements are shown as PDF annotations. When set to no, the review elements are left in the document object model and can be styled using CSS rules.
- -show-changed-text-in-pdf-sticky-notes-content
- When set to yes (default), the inserted and deleted text is shown in the PDF annotations. When set to no, only the inserted and deleted labels are shown in the PDF annotations.
- -show-image-map-area-numbers
- When set to yes, a counter for each area from the image map will be displayed over the image, near the defined shape. The default is no.
- -show-image-map-area-shapes
- When set to yes, each of the image map area shapes will be displayed with a translucent fill over the image. You can use this to debug your image maps. The default is no. For customizing the aspect of the shapes, see Image Maps (HTML).
- -show-pdf
- Opens the created PDF file in the default application (Windows only).
- -use-css-for-embedded-svg
- When set to yes (default), the CSS files specified by the
-cssparameter are also applied on embedded SVG elements. Allowed values are yes and no. - -v
- Shows the version of the processor.
- -Xmx<NNN>m
- Used to specify the maximum amount of memory that is available to the Oxygen PDF Chemistry process. For example, to allow the process to use 1GB of
memory:
-Xmx1024m