Add a watermark to PDFs based on map status

You can configure IXIASOFT 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 the status Authoring:done. Your configuration might uses a different name for its final map status.

For more information about creating watermark images, refer to Creating watermark images.

  1. Copy the watermark image to %OutputGenDir%/data/resources/client.

    The watermark image can have any name (the examples below uses draft_watermark.png), and it can be any image format except SVG.

  2. Add the "get_status" target to the "depends" list of the appropriate PDF targets in your conductor file.
  3. Add the following lines to the appropriate PDF targets in your conductor file:
    <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>
    Important: Be sure to use the name of your configuration's final map status if your configuration uses a name other than "Authoring:done".

    Here are those lines in context:

    <target name="BigCorp_PDF" depends="default_dependencies, flatten, resolve_container_keyref, extract_HiRes_images">
    	<echostart>BigCorp_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>BigCorp_PDF</echoend>
    </target>
  4. In your conductor-client.xml file, add the following 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>
  5. Save your changes to the conductor file.

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