Edit online

How to Contribute a Custom CSS to the Transformation from a DITA-OT Plugin

This topic is intended for publishing architects/developers that need to deploy a customized DITA-OT.

Usually, the CSS styles can be passed to the transformation by referencing the CSS files using the args.css parameter. However, there are cases where you want to add some sort of "built-in" CSS that is applied in conjunction with the publishing template or CSS files referenced in the transformation.

For this, you need to use the com.oxygenxml.pdf.css.init extension point and set the value of the extension.css ANT property to the path of the custom CSS file:
  1. In your plugin.xml file, add:
    <feature extension="com.oxygenxml.pdf.css.init" file="init.xml"/>
  2. Create a file named init.xml with the following ANT content:
    <root>
      <property name="extension.css" 
                value="${dita.plugin.[com.my.plugin.id].dir}/css/my-custom.css"/>
      <!-- add here more init stuff if needed -->
    </root>
    Note: The name of the root element does not matter. The content of this element will be copied in an initialization template.
    Important: Make sure all file references begin with the ANT variable that is expanded to the base directory of your plugin.