Class PdfAnnotationBorder
Represents the appearance of an annotation's border.
Inheritance
Namespace: Syncfusion.Pdf.Interactive
Assembly: Syncfusion.Pdf.Portable.dll
Syntax
public class PdfAnnotationBorder : Object, IPdfWrapper
Remarks
This PdfAnnotationBorder class is used to create the annotation border to PdfPopupAnnotation. Please refer the UG docuemntation link https://help.syncfusion.com/file-formats/pdf/working-with-annotations#pop-up-annotation for more details.
Examples
//Create a new PDF Document.
PdfDocument document = new PdfDocument();
//Create a new page.
PdfPage page = document.Pages.Add();
//Create a new rectangle
RectangleF popupAnnotationRectangle = new RectangleF(10, 40, 30, 30);
//Create a new popup annotation.
PdfPopupAnnotation popupAnnotation = new PdfPopupAnnotation(popupAnnotationRectangle, "Test popup annotation");
//Set the annotation border to popup annotation.
popupAnnotation.Border = new PdfAnnotationBorder(4, 0, 0);
//Add this annotation to a new page.
page.Annotations.Add(popupAnnotation);
//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 rectangle
Dim popupAnnotationRectangle As New RectangleF(10, 40, 30, 30)
'Create a new popup annotation.
Dim popupAnnotation As New PdfPopupAnnotation(popupAnnotationRectangle, "Test popup annotation")
'Set the annotation border to popup annotation.
popupAnnotation.Border = New PdfAnnotationBorder(4, 0, 0)
'Add this annotation to a new page.
page.Annotations.Add(popupAnnotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
Constructors
PdfAnnotationBorder()
Initializes a new instance of the PdfAnnotationBorder class.
Declaration
public PdfAnnotationBorder()
Examples
//Create a new PDF Document.
PdfDocument document = new PdfDocument();
//Create a new page.
PdfPage page = document.Pages.Add();
//Create a new rectangle
RectangleF popupAnnotationRectangle = new RectangleF(10, 40, 30, 30);
//Create a new popup annotation.
PdfPopupAnnotation popupAnnotation = new PdfPopupAnnotation(popupAnnotationRectangle, "Test popup annotation");
//Set the annotation border.
popupAnnotation.Border = new PdfAnnotationBorder();
//Add this annotation to a new page.
page.Annotations.Add(popupAnnotation);
//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 rectangle
Dim popupAnnotationRectangle As New RectangleF(10, 40, 30, 30)
'Create a new popup annotation.
Dim popupAnnotation As New PdfPopupAnnotation(popupAnnotationRectangle, "Test popup annotation")
'Set the annotation border.
popupAnnotation.Border = New PdfAnnotationBorder()
'Add this annotation to a new page.
page.Annotations.Add(popupAnnotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
See Also
PdfAnnotationBorder(Single)
Initializes a new instance of the PdfAnnotationBorder class with specified border width.
Declaration
public PdfAnnotationBorder(float borderWidth)
Parameters
Type | Name | Description |
---|---|---|
System.Single | borderWidth | A float value specifying the width of the annotation's border. |
Examples
//Create a new PDF Document.
PdfDocument document = new PdfDocument();
//Create a new page.
PdfPage page = document.Pages.Add();
//Create a new rectangle
RectangleF popupAnnotationRectangle = new RectangleF(10, 40, 30, 30);
//Create a new popup annotation.
PdfPopupAnnotation popupAnnotation = new PdfPopupAnnotation(popupAnnotationRectangle, "Test popup annotation");
//Set the annotation border.
popupAnnotation.Border = new PdfAnnotationBorder(4);
//Add this annotation to a new page.
page.Annotations.Add(popupAnnotation);
//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 rectangle
Dim popupAnnotationRectangle As New RectangleF(10, 40, 30, 30)
'Create a new popup annotation.
Dim popupAnnotation As New PdfPopupAnnotation(popupAnnotationRectangle, "Test popup annotation")
'Set the annotation border.
popupAnnotation.Border = New PdfAnnotationBorder(4)
'Add this annotation to a new page.
page.Annotations.Add(popupAnnotation)
'Save the document to disk.
document.Save("AnnotationBorder.pdf")
'close the document
document.Close(True)
See Also
PdfAnnotationBorder(Single, Single, Single)
Initializes a new instance of the PdfAnnotationBorder class with specified border width, horizontal and vertical radius.
Declaration
public PdfAnnotationBorder(float borderWidth, float horizontalRadius, float verticalRadius)
Parameters
Type | Name | Description |
---|---|---|
System.Single | borderWidth | A float value specifying the width of the annotation's border. |
System.Single | horizontalRadius | A float value specifying the horizontal corner radius value. |
System.Single | verticalRadius | A float value specifying the vertical corner radius value. |
Examples
//Create a new PDF Document.
PdfDocument document = new PdfDocument();
//Create a new page.
PdfPage page = document.Pages.Add();
//Create a new rectangle
RectangleF popupAnnotationRectangle = new RectangleF(10, 40, 30, 30);
//Create a new popup annotation.
PdfPopupAnnotation popupAnnotation = new PdfPopupAnnotation(popupAnnotationRectangle, "Test popup annotation");
//Set the annotation border.
popupAnnotation.Border = new PdfAnnotationBorder(4, 0, 0);
//Add this annotation to a new page.
page.Annotations.Add(popupAnnotation);
//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 rectangle
Dim popupAnnotationRectangle As New RectangleF(10, 40, 30, 30)
'Create a new popup annotation.
Dim popupAnnotation As New PdfPopupAnnotation(popupAnnotationRectangle, "Test popup annotation")
'Set the annotation border.
popupAnnotation.Border = New PdfAnnotationBorder(4, 0, 0)
'Add this annotation to a new page.
page.Annotations.Add(popupAnnotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
See Also
Properties
HorizontalRadius
Gets or sets a horizontal corner radius.
Declaration
public float HorizontalRadius { get; set; }
Property Value
Type | Description |
---|---|
System.Single | The horizontal radius of the annotation. |
Examples
//Create a new PDF Document.
PdfDocument document = new PdfDocument();
//Create a new page.
PdfPage page = document.Pages.Add();
//Create a new rectangle
RectangleF popupAnnotationRectangle = new RectangleF(10, 40, 30, 30);
//Create a new popup annotation.
PdfPopupAnnotation popupAnnotation = new PdfPopupAnnotation(popupAnnotationRectangle, "Test popup annotation");
//Set the horizontal radius to popup annotation border.
popupAnnotation.Border.HorizontalRadius = 0;
//Add this annotation to a new page.
page.Annotations.Add(popupAnnotation);
//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 rectangle
Dim popupAnnotationRectangle As New RectangleF(10, 40, 30, 30)
'Create a new popup annotation.
Dim popupAnnotation As New PdfPopupAnnotation(popupAnnotationRectangle, "Test popup annotation")
'Set the horizontal radius to popup annotation border.
popupAnnotation.Border.HorizontalRadius = 0
'Add this annotation to a new page.
page.Annotations.Add(popupAnnotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
See Also
VerticalRadius
Gets or sets a vertical corner radius.
Declaration
public float VerticalRadius { get; set; }
Property Value
Type | Description |
---|---|
System.Single | The vertical radius of the annotation. |
Examples
//Create a new PDF Document.
PdfDocument document = new PdfDocument();
//Create a new page.
PdfPage page = document.Pages.Add();
//Create a new rectangle
RectangleF popupAnnotationRectangle = new RectangleF(10, 40, 30, 30);
//Create a new popup annotation.
PdfPopupAnnotation popupAnnotation = new PdfPopupAnnotation(popupAnnotationRectangle, "Test popup annotation");
//Set the vertical radius to popup annotation border.
popupAnnotation.Border.VerticalRadius = 0;
//Add popup annotation to a new page.
page.Annotations.Add(popupAnnotation);
//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 rectangle
Dim popupAnnotationRectangle As New RectangleF(10, 40, 30, 30)
'Create a new popup annotation.
Dim popupAnnotation As New PdfPopupAnnotation(popupAnnotationRectangle, "Test popup annotation")
'Set the vertical radius to popup annotation border.
popupAnnotation.Border.VerticalRadius = 0
'Add popup annotation to a new page.
page.Annotations.Add(popupAnnotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
See Also
Width
Gets or sets the width of annotation's border.
Declaration
public float Width { get; set; }
Property Value
Type | Description |
---|---|
System.Single | A float value specifying the width of the annotation's border. |
Examples
//Create a new PDF Document.
PdfDocument document = new PdfDocument();
//Create a new page.
PdfPage page = document.Pages.Add();
//Create a new rectangle
RectangleF popupAnnotationBounds = new RectangleF(10, 40, 30, 30);
//Create a new popup annotation.
PdfPopupAnnotation popupAnnotation = new PdfPopupAnnotation(popupAnnotationBounds, "Test popup annotation");
//Set the width to popup annotation border.
popupAnnotation.Border.Width = 4;
//Add popup annotation annotation to a new page.
page.Annotations.Add(popupAnnotation);
//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 rectangle
Dim popupAnnotationBounds As New RectangleF(10, 40, 30, 30)
'Create a new popup annotation.
Dim popupAnnotation As New PdfPopupAnnotation(popupAnnotationBounds, "Test popup annotation")
'Set the width to popup annotation border.
popupAnnotation.Border.Width = 4
'Add popup annotation to a new page.
page.Annotations.Add(popupAnnotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)