Rotate Text Watermark

Posted by: Kenneth_Alws on 7 March 2019, 8:30 am EST

  • Posted 7 March 2019, 8:30 am EST

    How can I rotate my text watermark; I'd like to make the watermark at a 45* angle? I'm using VB.NET and the code below works fine for adding a horizontal, text watermark.

    I create the text format:
    Dim tf As New GrapeCity.Documents.Text.TextFormat
    tf.Font = StandardFonts.HelveticaBold
    tf.FontSize = 55
    tf.ForeColor = Color.FromArgb(100, 255, 182, 193)

    I then add the watermark:

    For Each page In doc.Pages
    Dim watermark As New WatermarkAnnotation
    watermark.Text = "Do Not Disclose"
    watermark.TextFormat = tf
    watermark.Name = "DiscloseWM"
    watermark.Rect = New RectangleF(100.5F, 110.5F, 500, 250)
    page.Annotations.Add(watermark)
    Next

  • Replied 7 March 2019, 10:01 pm EST

    Hello,

    In GcPdf, Text can be transformed using the Transform property of GcPdfGraphics instance, as explained under "Rotate Text" topic at the below mentioned documentation link:
    http://help.grapecity.com/gcdocs/gcpdf/onlinehelp/webframe.html#Text.html

    There is no direct property related to specifying angles for the watermark text.
    Apologies for the inconvenience.

    Regards,
    Esha
  • Marked as Answer

    Replied 11 March 2019, 4:00 am EST

    Hi Kenneth,

    WatermarkAnnotation is a very specific PDF feature, primarily designed for printing (see PDF 1.7 spec p.644). If you want to add a watermark to your document that would show at all times, with full control over how it is rendered - you are better off using a WidgetAnnotation, a StampAnnotation or just a rotated text printed on all pages. An example showing a rotated image (but you can easily replace it with a text) for something very similar to what you're trying to achieve is here:
    http://demos.componentone.com/gcdocs/gcpdf/Samples/List#StampImage/pdfCS

    Hope this helps. Please let me know if you need more details.

    Regards,
    Dmitry.
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels