We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Send watermark to back

When I add a watermark to my pdf it is on top of everything else so some of the pdf information becomes covered. I need the watermark to be behind everything else so that all data is visible with the watermark underneath the main data.

I am using version 3.5.6.0 of the Aspose.Pdf dll.

Below is how I am adding the watermark and it is the first thing I add after creating the pdf object.

'add the watermark
WaterMarkText = New Text("Confidential")
waterMark = New FloatingBox(400, 400)
WaterMarkText.TextInfo.FontSize = 70
WaterMarkText.TextInfo.Color = New Aspose.Pdf.Color("#D3D3D3")
WaterMarkText.TextInfo.RenderingMode = RenderingMode.FillText
WaterMarkText.PositioningType = PositioningType.PageRelative
WaterMarkText.RotatingAngle = 35
waterMark.Left = 100
waterMark.Top = 200
waterMark.Paragraphs.Add(WaterMarkText)
pdf.Watermarks.Add(waterMark)

Hi,

We should support transparent watermark. We have supported transparent image watermark but transparent text is not supported yet. As a workaround you can add the watermark like the following:

'add watermark
Dim sec1 As Aspose.Pdf.Section = pdf.Sections(0)
Dim oddHeader As Aspose.Pdf.HeaderFooter = sec1.OddHeader
Dim evenHeader As Aspose.Pdf.HeaderFooter = sec1.EvenHeader

Dim WaterMarkText As Aspose.Pdf.Text = New Text(“Confidential”)
Dim waterMark As FloatingBox = New FloatingBox(400, 400)
WaterMarkText.TextInfo.FontSize = 70
WaterMarkText.TextInfo.Color = New Aspose.Pdf.Color("#D3D3D3")
WaterMarkText.TextInfo.RenderingMode = RenderingMode.FillText
WaterMarkText.PositioningType = PositioningType.PageRelative
WaterMarkText.RotatingAngle = 35
waterMark.Left = 100
waterMark.Top = 200
waterMark.Paragraphs.Add(WaterMarkText)
oddHeader.Paragraphs.Add(waterMark)
evenHeader.Paragraphs.Add(waterMark)

Hi, have you added this functionality in current version? I need to add watermark to back of all content but watermark should not be covered by images in existing pdf, is it possiable in current version of Aspose PDF for . NET?

Hi Alexey,


Thanks for contacting support.

As per my understanding, you need to add Text watermark behind the page contents of existing PDF file. We have a class named TextStamp which supports the feature to add text watermark to PDF files and it also contains a property named Background which supports the feature to put watermark in background of page contents, but I am afraid this feature is not working fine in current release versions of Aspose.Pdf for .NET. For the sake of correction, I have logged it in our issue tracking system as PDFNEWNET-34838. We will investigate this issue in details and will keep you updated on the status of a correction.

We apologize for your inconvenience.

Hi Alexey,


Thanks for your patience. We have further investigated the issue and would like to update you that our text stamps can not be invisible but printable. But probably you may use annotation for this purpose. Annotations have flag “Print” in order to make annotation printable and flag “NoView” to make annotation invisible.

Document doc = new Document(myDir+“helloworld.pdf”);<o:p></o:p>

FreeTextAnnotation annotation = new FreeTextAnnotation(doc.Pages[1], new Aspose.Pdf.Rectangle(50, 600, 250, 650), new DefaultAppearance("Helvetica", 16, System.Drawing.Color.Red));

annotation.Contents = "ABCDEFG";

annotation.Characteristics.Border = System.Drawing.Color.Red;

annotation.Flags = AnnotationFlags.Print | AnnotationFlags.NoView;

doc.Pages[1].Annotations.Add(annotation);

doc.Save(myDir+"34838-out.pdf");


Please feel free to contact us for any further assistance.


Best Regards,

The issues you have found earlier (filed as PDFNEWNET-34838) have been fixed in Aspose.Pdf for .NET 9.3.0.

Blog post for this release can be viewed over this link


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.