Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
\n
和 <br>
,但这些类型的字符不被 Aspose.Pdf.Facades 命名空间支持。因此,为了使其成为可能,我们在 Aspose.Pdf.Facades 命名空间的 FormattedText 类中添加了另一个名为 AddNewLineText() 的方法。
请参考以下代码块以在现有 PDF 中添加多行水印。
// For complete examples and data files, visit https://github.com/aspose-pdf/Aspose.PDF-for-.NET
private static void AddTextStampToPdf()
{
// Instantiate a stamp object
var logoStamp = new Aspose.Pdf.Facades.Stamp();
// Instantiate an object of FormattedText class
var formatText = new Aspose.Pdf.Facades.FormattedText("Hello World!",
System.Drawing.Color.FromArgb(180, 0, 0),
Aspose.Pdf.Facades.FontStyle.TimesItalic,
Aspose.Pdf.Facades.EncodingType.Winansi, false, 50);
// Add another line for Stamp
formatText.AddNewLineText("Good Luck");
// BindLogo to PDF
logoStamp.BindLogo(formatText);
}
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.