Customizing PDF stamping and watermarking

Q: 1. We are using the following method to add watermark text to PDF.
_stamper.StampText(_pdfDocument, _watermarkText, new PageSet(1,
_pdfDocument.GetPageCount())); The problem is that if the text is too
long, the text will cut off by page width.

I would like to know the suggested way to cope with this issue.

2. We are using _stamper.SetFont(Font.Create(_pdfDocument,
Font.StandardType1Font.e_times_roman)) method to set font of watermark
However there are only 3 built-in fonts(times roman, courier,
Do you support other standard font types as well, i.e., Arial.?
What shall we do?

A: The stamper does not support automatic line wrapping since it does
not support the concept of a bounding box, however you could insert
new-line characters yourself. For example:

using (PDFDoc doc = new PDFDoc("my.pdf"))
{ doc.InitSecurityHandler(); using (Stamper s = new
Stamper(Stamper.SizeType.e_relative_scale, 0.5, 0.5)) {
   s.SetFontColor(new ColorPt(1, 0, 0)); // set text color to
   s.StampText(doc, "Line1\nLine2\nLine3\nLine4", new PageSet(1,
doc.Save("stamped.pdf", SDFDoc.SaveOptions.e_linearized); }

In case the stamper does not meet all your requirements, you can place
the text using ElementBuilder & ElementWriter - as shown in the
following sample:

Yet, another option is to create a PDF page (i.e. a stamp) from an
HTML string (e.g. see Html2Pdf sample) or Xaml (see Xaml2Pdf):


Then use 'pdftron.PDF.Stamper' to place the stamp on existing PDF
pages (as shown in Stamper sample -;
or use ElementBuilder & ElementWriter to create a form XObject from
PDF and place it another page (as shown in the ImpositionTest -


Regarding fonts, you referring to 14 standard PDF fonts (a.k.a. base
14 fonts). You can also use any system or non-system font. For

System.Drawing.Font sys_font = new System.Drawing.Font("Comic Sans
MS", 1);
Font my_font = Font.CreateTrueTypeFont(doc, sys_font, false, false);