Conditional Check Signature Images
By Tim Dexter on Apr 13, 2006
A check printing template is probably one of the tougher templates to build, there is so much going on with regard to formatting and security. I think we covered a lot in our Check Printing white paper ... it needs an update ... we'll get to it. In the mean time today's snippet of knowledge I want to share is around securing those check signatures ... the last thing you or management want is a check run with no security around the signatures. We recently put together a template that provides the logic to secure the signatures and if they are not present then of course we do not want to print a blank check ... thats just as bad as not securing the signatures in the first place so we can use a background image saying 'VOID' that will show if the signatures are not present.
So heres the check section of the template:
All pretty standard stuff, the section of interest is the area with the yellow rectangles, these are actually dummy images but colored to make life a little easier. Now the logic we needed to implement was:
if no signature images are accessible then show VOID
if check amount < 500 show signature 1
if check amount > 500 show signature 2 as well
if check amount > 1000 show signature 3 as well
To achieve this we can use a cool piece of XSLFO functionality that allows us to create a background image i.e. the void image; if the singnature images are present then we can lay those images over the top of the background. Using this approach we can satisfy the requirement above.
So under those fields and images we have the following:
|Contents||<xsl:attribute xdofo:ctx="block" name="background-image">server/void.gif|
<xsl:attribute xdofo:ctx="block" name="background-position-horizontal">center
<xsl:attribute xdofo:ctx="block" name="background-position-vertical">bottom
|<?if@inlines:C_CHECK_AMOUNT > 500?>||url:|
<?if@inlines:C_CHECK_AMOUNT > 10000?>
As you can see most of the fields are standard faire in the template world; either calling an image or running an 'if' statement. The only point of note is the '@inlines' command this is basically forcing the images to be aligned next to each other, without it they would stack on top of each other. The BG field is the most interesting, it is setting some attributes for the cell of the table; the first is the background image, the other two are setting the position of the image within the cell i.e. centered and at the bottom. The URLs are pointing to a server where the images are hosted, this could be a direstory or you could equally mount a floppy or memory card on your web server.
Now the images have some requirements:
1. They need to be accessible via a URI, either file:// or http:// or if you are an EBS customer you can use the OA_MEDIA reference.
2. The signature images need to have a solid background otherwise they will not cover the void image and it will show through at runtime.
3. The signature images need to be the same size as the void image. Remember the void image is going to be rendered everytime its just the signature images are going to be laid over the top of it so they need to be at least as big to ensure the void image is covered.
What happens at runtime?When the template is applied the void.gif is placed into the cell and the rest of the logic executes, if the signature images are available then they are pulled in and laid over the top of the void image thus hiding it from view. Now you'll need to do some fiddling with the image sizes to ensure they are going to lay over the top masking the void image fully but its not a huge task. So the end result is either a valid check with the appropriate images or a voided check.
You could quite easily adapt this logic to pull the image locations from the incoming XML, or as parameters to the template. You could equally build some logic to stripe void through the complete check and invoice section.
Are there alternatives?You could use the watermarking abilities to stripe the check through with 'void' after it has been created if the images are not available using some conditional check in the template.
There are vendors that will provide a hard ware solution to this whereby a SIMM module is plugged into the printer prior to the check run and the fonts and singnature images are controlled via PCL escape sequences. I have not had the time to investigate how this could be done but on the surface its going to be tough for now. XML Publisher generates PDF, it relies on other drivers to convert the PDF to PCL so you can not embed any PCL commands into the template and expect them to make it to the PCL. XML Publisher will generate PCL natively in a future release but one area of investigation is to see how youx could manipulate the resulting PCL to add the escape sequences after the PDF to PCL conversion.
You can get to the RTF template, XML data and images here.