Configure colors for the redline preprocessor

Redlining allows users to compare a DITA CMS map with an earlier version of itself. By default, the PDF output file highlights added text in blue and deleted text in red, but you can change these colors.

Note: Redlining does not work with the Apache FOP engine, so you need to install RenderX XEP or Antenna House Formatter to use this feature.
Redline colors are applied using the redline preprocessor, based on the %OutputGenDir%/data/xsl-ixia/redline.ditaval file shown below:
<?xml version="1.0" encoding="UTF-8"?>
<!-- This sets the background for deleted text to red and for added text to blue. Used by redline PDF transform -->
<val>
   <!-- the changebar attribute supports the following fields : 
      style:[none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset]
      width:Xpt
      placement:[start | end | left | right | inside | outside | alternate]
      offset:Xpt
      color: #FFFFFF - color code -->
   <revprop action="flag" val="deltaxml-add" backcolor="#3399CC" changebar="style:solid;width:1pt;offset:5pt;color:#3399CC"/>
   <revprop action="flag" val="deltaxml-delete" backcolor="#CC0000" changebar="style:solid;width:1pt;offset:5pt;color:#CC0000"/>
</val>
The redline.ditaval file is a standard Ditaval file, and the values are configured in the <revprop> element. The <revprop> element identifies a value in the rev attribute that must be highlighted by the redline preprocessor. Unlike the other conditional processing attributes, which can be used for both filtering and flagging, the rev attribute can only be used for flagging.
Note: For more information about the <revprop> element, see the DITA 1.2 documentation.

The following attributes are supported in the <revprop> element:

Table 1. <revprop> attributes for redlining
Attribute Description
action Behavior of the flag; valid values are:
  • flag: Tells the preprocessor to include and flag (highlight) the modified content in the output.
  • passthrough: Tells the preprocessor to include the modified content in the output, without highlighting it.
val Type of action to flag; valid values are:
  • deltaxml-add: Text that was added since the last revision
  • deltaxml-delete: Text was was removed from the last revision
backcolor Background color of the modified text; enter a six-digit color hex code (for example, CC0000 for red). This attribute is ignored if action is not set to flag.
changebar Characteristics of the change bar; valid values are:
  • style:[none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset]
  • width:Xpt
  • placement:[start | end | left | right | inside | outside | alternate]
  • offset:Xpt
  • color:#FFFFFF
For example, the following code displays a solid, blue change bar that is one-point wide and offset from the text by five points:
changebar="style:solid;width:1pt;offset:5pt;color:#3399CC"
This attribute is ignored if action is not set to flag.
To change the default colors for the redline preprocessor:
  • Create a client redline.ditaval file (for example, redline-acme.ditaval)
  • Change the colors and change bar attributes in the client file
  • Copy the redline preprocessor to the client preprocessor file
  • Set the redline target to point to the client redline.ditaval file
These steps are described below.
  1. Open the %OutputGenDir%/data/xsl-ixia/redline.ditaval and save it under a new name, for example, redline-acme.ditaval.
  2. Locate the val attribute for the behavior to configure.

    For example, to change how added text is highlighted, look for the val="deltaxml-add" attribute:

    <revprop action="flag" val="deltaxml-add" backcolor="#3399CC" changebar="style:solid;width:1pt;offset:5pt;color:#3399CC"/>
  3. Change the properties as desired.

    For example, to change the background and change bar colors to green and make the change bar a dotted line, configure the following:

    <revprop action="flag" val="deltaxml-add" backcolor="#76EE00" changebar="style:dotted;width:1pt;offset:5pt;color:#76EE00"/>
  4. Save and close the client Ditaval file (for example, redline-acme.ditaval).
  5. Open the %OutputGenDir%/conf/client/preprocessors.xml file.
  6. Open the %OutputGenDir%/conf/preprocessors.xml file.
  7. Copy the contents of the redline preprocessor from the %OutputGenDir%/conf/preprocessors.xml file to the %OutputGenDir%/conf/client/preprocessors.xml file.
    This ensures that your changes will not be lost when you update the Output Generator. For example, copy the following preprocessor definition to the %OutputGenDir%/conf/client/preprocessors.xml:
    <preprocessor name="dita2redlinepdf" class="com.ixiasoft.outputgenerator.preprocessor.AntProcessor">
       <parameters>
          <system>
             <parameter name="outputfile" value=".pdf"/>
             <parameter name="buildfile" value="/conductor-ixia.xml"/>
             <parameter name="target" value="dita2redlinepdfwrapper"/>
             <parameter name="clean" value="clean"/>
             <parameter name="keep.log.files" value="true"/>
          </system>
       </parameters>
    </preprocessor>
  8. Set the buildfile to your client conductor file.
    For example:
    <preprocessor name="dita2redlinepdf" class="com.ixiasoft.outputgenerator.preprocessor.AntProcessor">
       <parameters>
          <system>
             <parameter name="outputfile" value=".pdf"/>
             <parameter name="buildfile" value="/conductor-acme.xml"/>
             <parameter name="target" value="dita2redlinepdfwrapper"/>
             <parameter name="clean" value="clean"/>
             <parameter name="keep.log.files" value="true"/>
          </system>
       </parameters>
    </preprocessor>
  9. Save and close %OutputGenDir%/conf/client/preprocessors.xml.
  10. Open your client conductor file (for example, %OutputGenDir%/data/conductor-acme.xml).
  11. Open the %OutputGenDir%/data/conductor-ixia.xml file.
  12. Copy the contents of the redline targets from the %OutputGenDir%/data/conductor-ixia.xml file to the %OutputGenDir%/conf/data/conductor-acme.xml file.
    This ensures that your changes will not be lost when you update the Output Generator. For example, copy the following target definitions to the %OutputGenDir%/data/conductor-acme.xml file:
    <target name="dita2redlinepdfwrapper">
       <switch value="${ot.version}">
          <case value="1.5.4">
             <antcall target="dita2redlinepdfwrapper154"/>
          </case>
          <case value="1.6.3">
             <antcall target="dita2redlinepdfwrapper162"/>
          </case>
          <default>
             <fail>This version of OT ${ot.version} is not configure for Redlined PDF</fail>
          </default>
       </switch>
    </target>
    
    <target name="dita2redlinepdfwrapper162" depends="load_properties, 
                                             extract_HiRes_images, copy_images_to_outputdir">
       <antcall target="init">
          <param name="dita.temp.dir" value="${temp}${file.separator}${path}${file.separator}temp"/>
          <param name="args.input" value="${temp}${file.separator}${path}${file.separator}${collection}${file.separator}${id}"/>
          <param name="output.dir" value="${outputdir}"/>
          <param name="transtype" value="map-review-pdf"/>
          <param name="pdf.formatter" value="${default.pdf.formatter}"/>
          <param name="args.fo.include.rellinks" value="none"/>
          <param name="args.draft" value="no"/>
          <param name="args.filter" value="xsl-ixia${file.separator}redline.ditaval"/>
          <param name="clean.temp" value="yes"/>
       </antcall>
    
       <antcall target="clean_ot_output">
          <param name="preserve" value="*.pdf"/>
       </antcall>
    </target>
  13. Set the args.filter to your client redline Ditaval file.
    For example:
    <target name="dita2redlinepdfwrapper162" depends="load_properties, 
                                             extract_HiRes_images, copy_images_to_outputdir">
       <antcall target="init">
          <param name="dita.temp.dir" value="${temp}${file.separator}${path}${file.separator}temp"/>
          <param name="args.input" value="${temp}${file.separator}${path}${file.separator}${collection}${file.separator}${id}"/>
          <param name="output.dir" value="${outputdir}"/>
          <param name="transtype" value="map-review-pdf"/>
          <param name="pdf.formatter" value="${default.pdf.formatter}"/>
          <param name="args.fo.include.rellinks" value="none"/>
          <param name="args.draft" value="no"/>
          <param name="args.filter" 
                 value="xsl-ixia${file.separator}redline-acme.ditaval"/>
          <param name="clean.temp" value="yes"/>
       </antcall>
    
       <antcall target="clean_ot_output">
          <param name="preserve" value="*.pdf"/>
       </antcall>
    </target>
  14. Save and close the conductor file.
  15. Restart the Output Generator service.