Home > ColdFusion > ColdFusion: Creating Print Only Watermarks

ColdFusion: Creating Print Only Watermarks

While <cfpdf> supports watermarks that are visible on screen, but invisible when printing, the reverse does not seem to be supported.  At least not as far as I can tell.  However, with a bit of DDX you can create invisible watermarks.  Using the <Watermark> element and its showOnScreen and showWhenPrinting attributes, you can create watermark’s that are only visible when printed.

Cracker - I Hate My Generation

Cracker - I Hate My Generation


<cfsavecontent variable="ddxText">
<?xml version="1.0" encoding="UTF-8"?>
<DDX xmlns="http://ns.adobe.com/DDX/1.0/"
xsi:schemaLocation="http://ns.adobe.com/DDX/1.0/ coldfusion_ddx.xsd">
<PDF result="TargetPdf">
<PDF source="SourcePdf">
<Watermark showOnScreen="false" showWhenPrinting="true" opacity="95%">
<p font-size="49pt" font-weight="bold" color="#99001A" font="Algerian">
I Hate My Generation

<cfif IsDDX( ddxText )>
<cfset input.SourcePdf  = ExpandPath("./cracker.pdf") />
<cfset output.TargetPdf = ExpandPath("./invisibleWatermark.pdf") />

<cfpdf action="processDDX"
    name="ddxResult" />

    <cfdump var="#ddxResult#" />
    Invalid DDX String
Categories: ColdFusion Tags: ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: