Xamarin.Android

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class PdfWatermarkAnnotation

    Show / Hide Table of Contents

    Class PdfWatermarkAnnotation

    Represents the watermark annotation.

    Inheritance
    System.Object
    PdfAnnotation
    PdfWatermarkAnnotation
    Implements
    System.ComponentModel.INotifyPropertyChanged
    Inherited Members
    PdfAnnotation.SetAppearance(Boolean)
    PdfAnnotation.CalculateBounds(RectangleF, PdfPage, PdfLoadedPage)
    PdfAnnotation.SetValues(String, String)
    PdfAnnotation.CalculateTemplateBounds(RectangleF, PdfPageBase, PdfTemplate)
    PdfAnnotation.CalculateTemplateBounds(RectangleF, PdfPageBase, PdfTemplate, Boolean, PdfGraphics)
    PdfAnnotation.CalculateTemplateBounds(RectangleF, PdfPageBase, PdfTemplate, Boolean)
    PdfAnnotation.CheckFlatten()
    PdfAnnotation.Color
    PdfAnnotation.InnerColor
    PdfAnnotation.Border
    PdfAnnotation.Bounds
    PdfAnnotation.Location
    PdfAnnotation.Size
    PdfAnnotation.Page
    PdfAnnotation.Text
    PdfAnnotation.Author
    PdfAnnotation.Subject
    PdfAnnotation.ModifiedDate
    PdfAnnotation.AnnotationFlags
    PdfAnnotation.Flatten
    PdfAnnotation.FlattenPopUps
    PdfAnnotation.PdfTag
    PdfAnnotation.Layer
    PdfAnnotation.Rotate
    PdfAnnotation.Name
    PdfAnnotation.PropertyChanged
    Namespace: Syncfusion.Pdf.Interactive
    Assembly: Syncfusion.Pdf.Portable.dll
    Syntax
    public class PdfWatermarkAnnotation : PdfAnnotation, IPdfWrapper, INotifyPropertyChanged
    Examples
    //Create a new PDF document.
    PdfDocument document = new PdfDocument();
    //Create a new page .
    PdfPage page = document.Pages.Add();
    //Create a new PDF watermark annotation.
    RectangleF rectangle = new RectangleF(40, 60, 80, 20);
    PdfWatermarkAnnotation watermarkAnnotation = new PdfWatermarkAnnotation(rectangle);
    watermarkAnnotation.Opacity = 0.5f;
    watermarkAnnotation.Appearance..Normal.Graphics.DrawString("Watermark", new PdfStandardFont(PdfFontFamily.TimesRoman, 12), PdfBrushes.DarkBlue, new PointF(0, 0));
    page.Annotations.Add(watermarkAnnotation);
    //Save the document to disk.
    document.Save("Output.pdf");
    //Close the document
    document.Close(true);
    'Create a new PDF document.
    Dim document As New PdfDocument()
    'Create a new page .
    Dim page As PdfPage = document.Pages.Add()
    'Create a new pdf watermark annotation.
    Dim rectangle As New RectangleF(40, 60, 80, 20)
    Dim watermarkAnnotation As New PdfWatermarkAnnotation(rectangle)
    watermarkAnnotation.Opacity = 0.5f
    watermarkAnnotation.Appearance.Normal.Graphics.DrawString("Watermark", new PdfStandardFont(PdfFontFamily.TimesRoman, 12), PdfBrushes.DarkBlue, new PointF(0, 0))
    page.Annotations.Add(watermarkAnnotation)
    'Save the document to disk.
    document.Save("Output.pdf")
    'Close the document
    document.Close(True)

    Constructors

    PdfWatermarkAnnotation(RectangleF)

    RectangleF structure that specifies the bounds of the annotation.
    Declaration
    public PdfWatermarkAnnotation(RectangleF rectangle)
    Parameters
    Type Name Description
    RectangleF rectangle
    Examples
    //Create a new PDF document.
    PdfDocument document = new PdfDocument();
    //Create a new page .
    PdfPage page = document.Pages.Add();
    //Create a new pdf watermark annotation.
    RectangleF watermarkannotationBounds = new RectangleF(40, 60, 80, 20);
    PdfWatermarkAnnotation rubberstampAnnotation = new PdfWatermarkAnnotation(watermarkannotationBounds);
    watermarkAnnotation.Opacity = 0.5f;
    //Gets the PDF appearance.
    watermarkAnnotation.Appearance.Normal.Graphics.DrawString("Watermark",new PdfStandardFont(PdfFontFamily.TimesRoman, 12), PdfBrushes.DarkBlue, new PointF(0, 0));
    page.Annotations.Add(watermarkAnnotation);
    //Save the document to disk.
    document.Save("Output.pdf");
    //Close the document
    document.Close(true);
    'Create a new PDF document.
    Dim document As New PdfDocument()
    'Create a new page .
    Dim page As PdfPage = document.Pages.Add()
    'Create a new pdf rubber stamp annotation.
    Dim watermarkannotationBounds As New RectangleF(40, 60, 80, 20)
    Dim watermarkAnnotation As New PdfRubberStampAnnotation(watermarkannotationBounds)
    watermarkAnnotation.Opacity = 0.5F
    'Gets the  PDF appearance.
    watermarkAnnotation.Appearance.Normal.Graphics.DrawString("Watermark", new PdfStandardFont(PdfFontFamily.TimesRoman, 12), PdfBrushes.DarkBlue, new PointF(0, 0))
    page.Annotations.Add(watermarkAnnotation)
    'Save the document to disk.
    document.Save("Output.pdf")
    'Close the document
    document.Close(True)

    Properties

    Appearance

    Declaration
    public PdfAppearance Appearance { get; }
    Property Value
    Type Description
    PdfAppearance

    Opacity

    Gets or sets the opacity of the watermark annotation.

    Declaration
    public override float Opacity { get; set; }
    Property Value
    Type Description
    System.Single
    Overrides
    PdfAnnotation.Opacity
    Examples
    //Create a new PDF document.
    PdfDocument document = new PdfDocument();
    //Create a new page .
    PdfPage page = document.Pages.Add();
    //Create a new pdf watermark annotation.
    RectangleF watermarkannotationBounds = new RectangleF(40, 60, 80, 20);
    PdfWatermarkAnnotation rubberstampAnnotation = new PdfWatermarkAnnotation(watermarkannotationBounds);
    watermarkAnnotation.Opacity = 0.5f;
    //Gets the PDF appearance.
    watermarkAnnotation.Appearance.Normal.Graphics.DrawString("Watermark",new PdfStandardFont(PdfFontFamily.TimesRoman, 12), PdfBrushes.DarkBlue, new PointF(0, 0));
    page.Annotations.Add(watermarkAnnotation);
    //Save the document to disk.
    document.Save("Output.pdf");
    //Close the document
    document.Close(true);
    'Create a new PDF document.
    Dim document As New PdfDocument()
    'Create a new page .
    Dim page As PdfPage = document.Pages.Add()
    'Create a new pdf rubber stamp annotation.
    Dim watermarkannotationBounds As New RectangleF(40, 60, 80, 20)
    Dim watermarkAnnotation As New PdfRubberStampAnnotation(watermarkannotationBounds)
    watermarkAnnotation.Opacity = 0.5F
    'Gets the  PDF appearance.
    watermarkAnnotation.Appearance.Normal.Graphics.DrawString("Watermark", new PdfStandardFont(PdfFontFamily.TimesRoman, 12), PdfBrushes.DarkBlue, new PointF(0, 0))
    page.Annotations.Add(watermarkAnnotation)
    'Save the document to disk.
    document.Save("Output.pdf")
    'Close the document
    document.Close(True)

    Methods

    Initialize()

    Initializes annotation object.

    Declaration
    protected override void Initialize()
    Overrides
    PdfAnnotation.Initialize()

    Save()

    Saves the watermark annotation.

    Declaration
    protected override void Save()
    Overrides
    PdfAnnotation.Save()

    Implements

    System.ComponentModel.INotifyPropertyChanged
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved