jamesblast wrote: > Hello, > > I use the code (c#) at the bottom of this post to insert some kind of > text-stamp/watermark onto a PDF-File. > > The question is: is it possible, and if yes how to make this text > tranparent? Meaning the content of the document should light through the > watermark.
That's easy (see chapter 12 of the book). Add the following lines before and after your beginText/endText sequence (adapt the methods to C# lingo where necessary): PdfGState gstate = new PdfGState(); gstate.setFillOpacity(0.3f); gstate.setStrokeOpacity(0.3f); cb.saveState(); cb.setGState(gstate); > cb.BeginText(); > cb.SetFontAndSize(bf, (float)fontSize); > cb.SetCharacterSpacing((float)characterSpacing); > cb.SetColorFill(iColor); > > float x = (float)horzPos; > float y = (float)vertPos; > cb.ShowTextAligned(PdfContentByte.ALIGN_LEFT, text, > dimensions.GetLeft(x), > dimensions.GetTop(y), (float)orientation); > cb.EndText(); cb.restoreState(); -- This answer is provided by 1T3XT BVBA ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Do you like iText? Buy the iText book: http://www.1t3xt.com/docs/book.php Or leave a tip: https://tipit.to/itexttipjar
