Edit online

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 the xml-stylesheet processing 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.
-dump-styled-content
Dumps the intermediate, annotated XML file 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
-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.
-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-ligatures CSS property instead. See Font Ligatures for more information.
-expand-xpath-in-svg-templates
When set to yes (default), each XPath expression that has a format of ${expression} inside SVG templates files (with a .template.svg file extension) will be expanded.
-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.
-image-resolution 72
-licensekey-dir
Specifies the directory where the license key file is located. The license key file should have the name licensekey.txt.
-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-hyphenation parameter.
-no-network
Denies access to all your network connections. If your XML document or CSS files reference remote resources, the transformation will fail. This parameter is ignored when the -security-policy file is specified.
-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-a
Produces output that conforms to the PDF/A archiving standards. The conversion will fail if fonts are not embedded. See: Archiving.
-pdf-security-encrypt-metadata
Encrypts the metadata. By default, it is active when other security parameters are set.
-pdf-security-encrypt-structure-element
Encrypts the structure elements. By default, inactive when other security parameters are set.
-pdf-security-restrict-accesscontent
Restricts extracting text and graphics. Used for protecting the PDF Document. The restriction is off by default.
-pdf-security-restrict-annotations
Restricts filling in existing interactive forms. Used for protecting the PDF Document. The restriction is off by default.
-pdf-security-restrict-assembledoc
Restricts assembling document (e.g. adding pages). Used for protecting the PDF Document. The restriction is off by default.
-pdf-security-restrict-copy
Restricts copying content. Used for protecting the PDF Document. The restriction is off by default.
-pdf-security-restrict-edit
Restricts copying content. Used for protecting the PDF Document. The restriction is off by default.
-pdf-security-restrict-fillinforms
Restricts filling in existing interactive forms. Used for protecting the PDF Document. The restriction is off by default.
-pdf-security-restrict-print
Restricts printing. Used for protecting the PDF Document. The restriction is off by default.
-pdf-security-restrict-printhq
Restricts high quality printing. Used for protecting the PDF Document. The restriction is off by default.
-pdf-security-user-password
The user password. The document can be opened using either this password or the owner password. When the owner password is specified, the document can be opened by using the user password but with possible other restrictions.
-pdf-security-owner-password
The owner password (if this is provided when the document is opened in the reader application, with no restrictions).
-pdf-ua
Produces output that conforms to the PDF/UA-1 accessibility standards. The conversion will fail 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.
-security-policy
Specifies the Java security policy file (in URL or file path syntax). This policy file can be used to restrict the processor access to certain resources (e.g. files, network). For more details, see: Security Policy Configuration.
-security-resources-dir1
-security-resources-dir2
-security-resources-dir3
-security-resources-dir4
-security-resources-dir5
Specifies additional directories (to the input folder) where resources (e.g. images, CSS stylesheets, etc.) are stored. These parameters are automatically expanded in the Java security policy file, with read access, when the -security-policy is specified. For more details, see: Security Policy Configuration.
-security-resources-host
Specifies the host where resources (e.g. images, CSS stylesheets, etc.) are stored. This parameter is automatically expanded in the Java security policy file, with connect access, when the -security-policy was specified. For more details, see: Security Policy Configuration.
-security-workspace
Specifies the directory where the temporary files and font cache is stored. This parameter is automatically expanded in the Java security policy file, with read and write access, when the -security-policy is specified. For more details, see: Security Policy Configuration.
-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 -css parameter 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
Notes:
  • The default is 512MB.
  • Larger memory settings (beyond 1GB) are permitted only when the Java Virtual Machine that runs Oxygen PDF Chemistry is 64 bits and there is enough physical memory accessible to the operating system.
Important: If the JAVA_ARG_LINE environment variable is set, this parameter is ignored.