Stamp background image, ignoring whitespace

Hey everyone,

I’m using the Stamper class to stamp a background onto my pdf. The problem is that this background image light blue, and so all the whitespace in the overlaying text shows up. If I have the stamper lay it on top, it covers the actual text. Is there a simple way around this problem?

If not, I am using the element builder class to add the text elements (with whitespace) to the pdf. How would I remove the whitespace from my input elemetns and correctly position the words, as if they still had the whitespace?

Spencer Rathbun

L & D Mail Masters, Inc.

110 Security Pkwy

New Albany, IN 47150

812.981.7161 X.171

Fax: 812.981.7169

www.ldmailmasters.com

Hi Spencer,

The problem is that the text under which you are placing the backround contains white rectangles underneath the text. This is a case of bad PDF generator. A possible workaround would be to use the content editing apprach shown in ElementEdit sample to identifywhite rectangles and set their opacity to 0 (or remove them altogether). Another posibility is that text is drawn using little bitmaps (e.g. as part of a Type3 font). In this case you could change bitmaps to image masks, but things are getting more complicated…

Thanks for the reply,

I found the problem shortly after I sent this. I was setting the graphics state blend mode for Element.e_text only. Since there was a different element actually creating that box, as you indicate, that element did not blend, and left the artifact. I’m now setting the blend mode to multiply for every element, and the boxes are gone.

Spencer Rathbun