Hello Vaibhav,
Thanks for considering Aspose.
1) I've tested the scenario and I'm able to reproduce the same problem. I have logged it in our issue tracking system as PDFNET-10518. We will investigate this issue in detail and will keep you updated on the status of a correction. We apologize for your inconvenience.
2) Regarding second requirement, please try using the IsWatermarkOnTop property of Pdf class and set its value to false.
3) I'm not sure what sort of Image place holder you are using. I would suggest you to use FloatingBox to place an image file as well. I've tried to replicate the scenario using following code snippet and have generated a sample PDF document. In this case, the BoxVerticalAlignmentType is set to Top. Please take a look. The file is also in attachment.
[C#]
Pdf
pdf1 = new Pdf();
Aspose.Pdf.Section sec1 = pdf1.Sections.Add();
Text text = new Text("DO NOT COPY");
text.TextInfo.Alignment = Aspose.Pdf.AlignmentType.Center;
text.TextInfo.FontSize = 40.0f;
text.RotatingAngle = 45.0f;
text.TextInfo.Color = new Aspose.Pdf.Color("gray");
FloatingBox watermark = new FloatingBox(500, 200);
watermark.BoxVerticalPositioning = BoxVerticalPositioningType.Margin;
watermark.BoxVerticalAlignment = BoxVerticalAlignmentType.Top;
watermark.ZIndex = -1;
watermark.BoxHorizontalPositioning = BoxHorizontalPositioningType.Margin;
watermark.Paragraphs.Add(text);
pdf1.Watermarks.Add(watermark);
//setting image watermark
Aspose.Pdf.Image image1 = new Aspose.Pdf.Image();
image1.ImageInfo.File = @"d:/pdftest/Penguin.PNG";
image1.ImageInfo.ImageFileType = ImageFileType.Png;
Aspose.Pdf.FloatingBox watermark1 = new Aspose.Pdf.FloatingBox(108, 80);
watermark1.BoxHorizontalPositioning = BoxHorizontalPositioningType.Page;
watermark1.BoxHorizontalAlignment = BoxHorizontalAlignmentType.Center;
watermark1.BoxVerticalPositioning = BoxVerticalPositioningType.Page;
watermark1.BoxVerticalAlignment = BoxVerticalAlignmentType.Top;
watermark1.Padding.Top = 60;
watermark1.Paragraphs.Add(image1);
pdf1.Watermarks.Add(watermark1);
pdf1.IsWatermarkOnTop = false;
pdf1.Sections[0].Paragraphs.Add(new Text(" Aspose.Pdf is a .NET Component built to ease the job of developers to create PDF documents ranging from simple to complex on the fly programmatically. Aspose.Pdf allows developers to insert Tables, Graphs, Images, Hyperlinks and Custom Fonts etc. in the PDF documents. Moreover, it is also possible to compress PDF documents. Aspose.Pdf provides excellent security features to develop secure PDF documents. And the most distinct feature of Aspose.Pdf is that it supports the creation of PDF documents through both an API and from XML templates "));
pdf1.Save(@"d:/pdftest/Watermark_Issue.pdf");
I would suggest you to visit the following link for information on Customizing Watermark.
Nayyer Shahbaz
Support Developer, Aspose Sialkot Team
About Us Contact UsKeep in touch! We're on
Twitter and
Facebook