Hi ,
For given attached PDF the watermark code is not working.
No error displayed but watermark is missing.
using (Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document(fileStream))
{
WatermarkArtifact artifact = new WatermarkArtifact()
{
ArtifactVerticalAlignment = VerticalAlignment.Top,
ArtifactHorizontalAlignment = HorizontalAlignment.Left,
Opacity = 0.5,
IsBackground = true,
TopMargin = 7,
LeftMargin = 7
};
artifact.SetLinesAndState(
new string[] {
"ABC COPY",
$" {docNumber}",
$" {DateTime.Parse(OnDate).ToString("ddMMMyyyy")}"
},
new TextState()
{
FontSize = 12,
ForegroundColor = Color.Red,
Font = FontRepository.FindFont("Courier")
});
pdfDocument.Pages[1].Artifacts.Add(artifact);
pdfDocument.Save(pdfFilePath);
Could you please let us know why given PDF is not showing the watermark?
Is there any compatibility issue?
Note:- This given PDF was generated from .pptx file using aspose.
Thanks & Regards,
Poonam
TEST-1.pdf (5.7 KB)