Add a watermark to PDFs, based on map status

You can configure IXIA CCMS Output Generator so that an output type includes a watermark based on the build map's status. The watermark is automatically included for maps that are not in a final, publishable status.

Note: This procedure configures CCMS Output Generator so that a watermark is included for all maps that do not have an Authoring:done status. Your configuration might uses a different name for its final map status.

For more information about creating watermark images, refer to Watermark graphic creation.

To add a watermark to PDFs, based on map status:

  1. You must first create and add the watermark image to the CCMS Output Generator.
    Note: The watermark image can have any name, and can be in any image format, other than SVG.
  2. Copy the watermark image to %OutputGenDir%/data/resources/client.
  3. Add the get_status target to the depends list of the appropriate PDF targets in your conductor file.
  4. Add the relevant lines to the appropriate PDF targets in your conductor file.
    Important: Be sure to use the name of your configuration's final map status, such as Authoring:done.
    Suppose the Acme company wants you to watermark PDFs that have any status other than the Authoring:done status or its equivalent in your deployment.
    <if>
    	<not>
    		<equals arg1="${outgen.job.source.status}" arg2="Authoring:done"/>
    	</not>
    	<then>
    		<move file="${outgen.job.output.dir}/${outgen.job.source.name.noext}.pdf" todir="${outgen.job.dir}"/>
    		<watermark execute="true" 
    				   inputfile="${outgen.job.dir}/${outgen.job.source.name.noext}.pdf"
    				   tempfile="${outgen.job.output.dir}/${outgen.job.source.name.noext}.pdf"
    				   imagefile="${outgen.resources.dir.client}/draft_watermark.png"/>
    	</then>
    </if>

    In context:

    <target name="Acme_PDF" depends="default_dependencies, flatten, resolve_container_keyref, extract_HiRes_images">
    	<echostart>Acme_PDF</echostart>
    
    	<!-- These are the required target calls to do -->
    	<ot_build_add_ditaval_ifpresent/>
    	<ot_build_clean_ot_temp/>
    
    		...
    
    	<!-- Set the property job.keep.temp to preserve the completed temp folder of the task -->
    	<!--<property name="job.keep.temp" value="yes"/>-->
    
    	<if>
    		<not>
    			<equals arg1="${outgen.job.source.status}" arg2="Authoring:done"/>
    		</not>
    		<then>
    			<move file="${outgen.job.output.dir}/${outgen.job.source.name.noext}.pdf" todir="${outgen.job.dir}"/>
    			<watermark execute="true" 
    				   inputfile="${outgen.job.dir}/${outgen.job.source.name.noext}.pdf"
    				   tempfile="${outgen.job.output.dir}/${outgen.job.source.name.noext}.pdf"
    				   imagefile="${outgen.resources.dir.client}/draft_watermark.png"/>
    		</then>
    	</if>
    
    	<echoend>Acme_PDF</echoend>
    </target>
  5. In your conductor-client.xml file, add the get_status target.
    <target name="get_status">
    	<echostart>get_status</echostart>
    
    	<xmltask source="${outgen.job.source.dir}/${outgen.job.source.name.noext}.customproperties">
    		<copy path="//status/text()" property="outgen.job.source.status"/>
    	</xmltask>
    	<echolog>STATUS = ${outgen.job.source.status}</echolog>
    
    	<echoend>get_status</echoend>
    </target>
  6. Save your changes to the conductor file.

You do not need to restart CCMS Output Generator. The watermark is present in all PDFs created when the build map is not in the final status you identified above.