Dear Team,
Watermark on each pdf page is not same. Expected watermark is only applying on first page and from second page onward it looks like taking default behavior. Please find the attached pdf files for your reference.
Code used:
Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document(inputPath);
Aspose.Pdf.WatermarkArtifact artifact = new Aspose.Pdf.WatermarkArtifact();
artifact.SetTextAndState(
“WATERMARK”,
new Aspose.Pdf.Text.TextState()
{
FontSize = 72,
ForegroundColor = Aspose.Pdf.Color.Blue,
Font = FontRepository.FindFont(“Courier”)
});
artifact.ArtifactHorizontalAlignment = Aspose.Pdf.HorizontalAlignment.Center;
artifact.ArtifactVerticalAlignment = Aspose.Pdf.VerticalAlignment.Center;
artifact.Rotation = 45;
artifact.Opacity = 0.5;
artifact.IsBackground = true;
foreach (Aspose.Pdf.Page pdfPage in pdfDocument.Pages)
{
pdfPage.Artifacts.Add(artifact);
pageCount++;
}
pdfDocument.Save(outputPDF);
Thanks,
SaurabhAspose.pdf (266.9 KB)
Aspose_AfterWatermark.pdf (273.4 KB)