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);
pdf.Watermarks.Add(watermark);
pdf.Close();<hr size="1" align="left" width="25%"></body></html>
Hi Turners,
MemoryStream ms = new
MemoryStream();<o:p></o:p>
Pdf pdf = new Pdf(ms);
Section sec1 = pdf.Sections.Add();
Text text = new Text("COPY ONLY");
text.TextInfo.Alignment = Aspose.Pdf.Generator.AlignmentType.Center;
text.TextInfo.Color = new Aspose.Pdf.Generator.Color(220, 220, 220);
text.TextInfo.FontSize = 40;
text.TextInfo.FontName = "HELVETICA";
float textAngle = 45.0f;
text.RotatingAngle = textAngle;
sec1.Paragraphs.Add(text);
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);
pdf.Watermarks.Add(watermark);
sec1.Paragraphs.Add(watermark);
//pdf.Save("c:/pdftest/WatermarkIssue.pdf");
pdf.Close();
Console.WriteLine(ms.Length);
ms.Close();
PS, I hope you fully understand that Pdf class present under Aspose.Pdf.Generator supports the creation of PDF file from scratch and it does not offer the capability to load an existing PDF file.
Thanks for responding. I too can see that the file has been generated however I am unable to open it with adobe reader. I am using VS2010 and sql server 2012 installed on a windows server 2008 machine.
Hi Turners,