Adding multi line watermark
Contents
[
Hide
]
A lot of users want to stamp their PDF documents with multi-line text. They usually try to use
\n
and <br>
but these types of characters are not supported by Aspose.Pdf.Facades namespace. So, to make it possible, we have added another method named AddNewLineText() in FormattedText class of Aspose.Pdf.Facades namespace.
Implementation details
Please refer to the following code chunk to add multi-line watermark in existing PDF.
// Instantiate a stamp object
Stamp logoStamp = new Stamp();
// Instantiate an object of FormattedText class
FormattedText formatText = new FormattedText("Hello World!",
System.Drawing.Color.FromArgb(180, 0, 0), FontStyle.TimesItalic, EncodingType.Winansi, false, 50);
// Add another line for Stamp
formatText.AddNewLineText("Good Luck");
// BindLogo to PDF
logoStamp.BindLogo(formatText);