When a form (smartforms) is printed, a PDF copy is generated and saved for future reference. Sometimes when you want to reprint from the PDF copy, you may want or it may be required, to add watermark such a ‘COPY’ etc., to indicate that it is not the original.

In SAP, I could not find a way to imprint watermark into the form when printing the PDF from SAP system.

Here is an alternate way flexible enough to add any watermark style in the form printed from a soft copy created earlier.

First, we are not going to use PDF format to store the copy, but OTF itself generated from the smartforms. If you want a PDF, it can be made available using SAP function modules to convert OTF to PDF anytime. So I feel it’s ok to use OTF format for storing the copy.

During form printing, we get the OTF. Without converting to PDF format, save the OTF data itself, possibly in the content server.

In another time, you will retrieve the OTF data (let’s call this form OTF). OTF data is in the format of PRINTER COMMAND (itcoo-tdprintcom) and PRINTER PARAMETERS ((itcoo-tdprintpar). There are different command codes such BM for bitmap, IN, RD etc. Knowing this, we are going to insert a background node with bitmap image of the watermark. For this, we need to create a smartforms (let’s call this BMP form/OTF) with PAGE1’s background set to the bitmap image; you may want to use dynimcal setting of BMP image. Now that the BMP form is ready, call the smartforms to get the OTF data. So, basically this OTF data will have some meta data and codes/commands for a page with background set to a BMP image. We will extract this information and insert it in the previous target OTF data. Follow these steps:

Now you have the BMP form OTF in the form TDPRINTCOM and TDPRINTPAR in an internal table.

– Delete all records except TDPRINTCOM = ‘RD’, the first TDPRINTCOM=’IN’ and the first TDPRINTCOM=’MT’.

In the end you will get like,


IN 06%%BGR1

BM 1374705146 D    BDS_LOC3  A4BADB2<<<SOMECODES>>>>

RD <<<<SOME CODES>>>>>

RD <<<<SOME CODES>>>>>

RD <<<<SOME CODES>>>>>

RD <<<<SOME CODES>>>>>

RD <<<<SOME CODES>>>>>

RD <<<<SOME CODES>>>>>

Next, in the form OTF, find the index where TDPRINTCOM = ‘OP’. If there are multiple pages, LOOP at TDPRINTCOM =’OP’. OP stands for Open Page.

Insert the above OTF lines into the form OTF, at index one more than the above index.

That’s it. Now check your print copy or the PDF you generated from this OTF. It should have a background watermak you created in the BMP form.

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply