Class PdfLoadedInkAnnotation
Represent Loaded ink annotation, Ink annotation represents freehand scribble comprising one or more disjoint paths.
Inheritance
System.Object
PdfLoadedInkAnnotation
Implements
System.ComponentModel.INotifyPropertyChanged
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Syncfusion.Pdf.Interactive
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public class PdfLoadedInkAnnotation : PdfLoadedStyledAnnotation, IPdfWrapper, INotifyPropertyChanged
Examples
//Load a PDF document.
PdfLoadedDocument document = new PdfLoadedDocument("InkAnnot.pdf");
//Load a page
PdfLoadedPage page = document.Pages[0] as PdfLoadedPage;
//Load a ink annotation
PdfLoadedInkAnnotation inkAnnotation = page.Annotations[2] as PdfLoadedInkAnnotation;
List(float) linePoints = new List(float) { 40, 300, 60, 100, 40, 50, 40, 300 };
//Set the line points
inkAnnotation.InkList = linePoints;
inkAnnotation.Color = new PdfColor(Color.Red);
//Save the document to disk.
document.Save("InkAnnot.pdf");
document.Close(true);
'Load a PDF document.
Dim document As New PdfLoadedDocument("InkAnnot.pdf")
'Load a page
Dim page As PdfLoadedPage = TryCast(document.Pages(0), PdfLoadedPage)
'Load a ink annotation
Dim inkAnnotation As PdfLoadedInkAnnotation = TryCast(page.Annotations(2), PdfLoadedInkAnnotation)
Dim linePoints As New List(Of Single)() From {40, 300, 60, 100, 40, 50, 40,300}
'Set the line points
inkAnnotation.InkList = linePoints
inkAnnotation.Color = New PdfColor(Color.Red)
'Save the document to disk.
document.Save("InkAnnot.pdf")
document.Close(True)
Properties
BorderStyle
get or sets the border style of the ink annotation, default value is PdfLineBorderStyle.Solid
Declaration
public PdfLineBorderStyle BorderStyle { get; set; }
Property Value
Type | Description |
---|---|
PdfLineBorderStyle | The PdfLineBorderStyle, provides various type of borders |
Examples
//Load a PDF document.
PdfLoadedDocument document = new PdfLoadedDocument("InkAnnot.pdf");
//Load a page
PdfLoadedPage page = document.Pages[0] as PdfLoadedPage;
//Load a ink annotation
PdfLoadedInkAnnotation inkAnnotation = page.Annotations[2] as PdfLoadedInkAnnotation;
List(float) linePoints = new List(float) { 40, 300, 60, 100, 40, 50, 40, 300 };
//Set the line points
inkAnnotation.InkList = linePoints;
//Set the color of the annotation.
inkAnnotation.Color = new PdfColor(Color.Red);
//Set the Border width of the annotation.
inkAnnotation.BorderWidth = 3;
//Set the border style
inkAnnotation.BorderStyle = PdfLineBorderStyle.Dashed;
//Set the value for dash border of the annotation
inkAnnotation.DashArray = new int[] { 2, 2 };
//Save the document to disk.
document.Save("InkAnnot.pdf");
document.Close(true);
'Load a PDF document.
Dim document As New PdfLoadedDocument("InkAnnot.pdf")
'Load a page
Dim page As PdfLoadedPage = TryCast(document.Pages(0), PdfLoadedPage)
'Load a ink annotation
Dim inkAnnotation As PdfLoadedInkAnnotation = TryCast(page.Annotations(2), PdfLoadedInkAnnotation)
Dim linePoints As New List(Of Single)() From {40, 300, 60, 100, 40, 50, 40,300}
'Set the line points
inkAnnotation.InkList = linePoints
'Set the color of the annotation.
inkAnnotation.Color = New PdfColor(Color.Red)
'Set the Border width of the annotation.
inkAnnotation.BorderWidth = 3
'Set the border style
inkAnnotation.BorderStyle = PdfLineBorderStyle.Dashed
'Set the value for dash border of the annotation
inkAnnotation.DashArray = New Integer() {2, 2}
'Save the document to disk.
document.Save("InkAnnot.pdf")
document.Close(True)
See Also
BorderWidth
Get or sets the border width of the ink annotation.
Declaration
public int BorderWidth { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Remarks
The default value of border width is 1.
Examples
//Load a PDF document.
PdfLoadedDocument document = new PdfLoadedDocument("InkAnnot.pdf");
//Load a page
PdfLoadedPage page = document.Pages[0] as PdfLoadedPage;
//Load a ink annotation
PdfLoadedInkAnnotation inkAnnotation = page.Annotations[2] as PdfLoadedInkAnnotation;
List(float) linePoints = new List(float) { 40, 300, 60, 100, 40, 50, 40, 300 };
//Set the line points
inkAnnotation.InkList = linePoints;
//Set the color of the annotation.
inkAnnotation.Color = new PdfColor(Color.Red);
//Set the Border width of the annotation.
inkAnnotation.BorderWidth = 3;
//Set the border style
inkAnnotation.BorderStyle = PdfLineBorderStyle.Dashed;
//Set the value for dash border of the annotation
inkAnnotation.DashArray = new int[] { 2, 2 };
//Save the document to disk.
document.Save("InkAnnot.pdf");
document.Close(true);
'Load a PDF document.
Dim document As New PdfLoadedDocument("InkAnnot.pdf")
'Load a page
Dim page As PdfLoadedPage = TryCast(document.Pages(0), PdfLoadedPage)
'Load a ink annotation
Dim inkAnnotation As PdfLoadedInkAnnotation = TryCast(page.Annotations(2), PdfLoadedInkAnnotation)
Dim linePoints As New List(Of Single)() From {40, 300, 60, 100, 40, 50, 40,300}
'Set the line points
inkAnnotation.InkList = linePoints
'Set the color of the annotation.
inkAnnotation.Color = New PdfColor(Color.Red)
'Set the Border width of the annotation.
inkAnnotation.BorderWidth = 3
'Set the border style
inkAnnotation.BorderStyle = PdfLineBorderStyle.Dashed
'Set the value for dash border of the annotation
inkAnnotation.DashArray = New Integer() {2, 2}
'Save the document to disk.
document.Save("InkAnnot.pdf")
document.Close(True)
See Also
Comments
Gets the annotation comments history.
Declaration
public PdfLoadedPopupAnnotationCollection Comments { get; }
Property Value
Type | Description |
---|---|
PdfLoadedPopupAnnotationCollection | The Comments collection of the ink annotation. |
Examples
//Load an existing document.
PdfLoadedDocument document = new PdfLoadedDocument(@"..\..\Annotations.pdf");
//Load the existing PdfinkAnnotation
PdfLoadedInkAnnotation ink = document.Pages[0].Annotations[0] as PdfLoadedInkAnnotation;
//Get the comments collection
PdfLoadedPopupAnnotationCollection commentsCollection = ink.Comments;
//save the document
document.Save("InkAnnotation.pdf");
//Close the docuemnt
document.Close(true);
'Load an existing document.
Dim document As New PdfLoadedDocument("..\..\Annotations.pdf")
'Load the existing PdfInkAnnotation
Dim ink As PdfLoadedInkAnnotation = document.Pages(0).Annotations(0)
'Get the comments collection
Dim commentsCollection As PdfLoadedPopupAnnotationCollection = ink.Comments
'save the document
document.Save("InkAnnotation.pdf")
'Close the document.
document.Close(True)
See Also
DashArray
Gets or sets the value for dashed border of ink annotation.
Declaration
public int[] DashArray { get; set; }
Property Value
Type | Description |
---|---|
System.Int32[] |
Examples
//Load a PDF document.
PdfLoadedDocument document = new PdfLoadedDocument("InkAnnot.pdf");
//Load a page
PdfLoadedPage page = document.Pages[0] as PdfLoadedPage;
//Load a ink annotation
PdfLoadedInkAnnotation inkAnnotation = page.Annotations[2] as PdfLoadedInkAnnotation;
List(float) linePoints = new List(float) { 40, 300, 60, 100, 40, 50, 40, 300 };
//Set the line points
inkAnnotation.InkList = linePoints;
//Set the color of the annotation.
inkAnnotation.Color = new PdfColor(Color.Red);
//Set the Border width of the annotation.
inkAnnotation.BorderWidth = 3;
//Set the border style
inkAnnotation.BorderStyle = PdfLineBorderStyle.Dashed;
//Set the value for dash border of the annotation
inkAnnotation.DashArray = new int[] { 2, 2 };
//Save the document to disk.
document.Save("InkAnnot.pdf");
document.Close(true);
'Load a PDF document.
Dim document As New PdfLoadedDocument("InkAnnot.pdf")
'Load a page
Dim page As PdfLoadedPage = TryCast(document.Pages(0), PdfLoadedPage)
'Load a ink annotation
Dim inkAnnotation As PdfLoadedInkAnnotation = TryCast(page.Annotations(2), PdfLoadedInkAnnotation)
Dim linePoints As New List(Of Single)() From {40, 300, 60, 100, 40, 50, 40,300}
'Set the line points
inkAnnotation.InkList = linePoints
'Set the color of the annotation.
inkAnnotation.Color = New PdfColor(Color.Red)
'Set the Border width of the annotation.
inkAnnotation.BorderWidth = 3
'Set the border style
inkAnnotation.BorderStyle = PdfLineBorderStyle.Dashed
'Set the value for dash border of the annotation
inkAnnotation.DashArray = New Integer() {2, 2}
'Save the document to disk.
document.Save("InkAnnot.pdf")
document.Close(True)
See Also
InkList
Declaration
public List<float> InkList { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<System.Single> |
InkPointsCollection
Gets or sets mutiple points of the InkList value.
Declaration
public List<List<float>> InkPointsCollection { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<System.Collections.Generic.List<System.Single>> |
ReviewHistory
Gets the annotation review history.
Declaration
public PdfLoadedPopupAnnotationCollection ReviewHistory { get; }
Property Value
Type | Description |
---|---|
PdfLoadedPopupAnnotationCollection | The review collection of the ink annotation. |
Examples
//Load an existing document.
PdfLoadedDocument document = new PdfLoadedDocument(@"..\..\Annotations.pdf");
//Load the existing PdfinkAnnotation
PdfLoadedInkAnnotation ink = document.Pages[0].Annotations[0] as PdfLoadedInkAnnotation;
//Get the review collection
PdfLoadedPopupAnnotationCollection reviewCollection = ink.ReviewHistory;
//save the document
document.Save("InkAnnotation.pdf");
//Close the docuemnt
document.Close(true);
'Load an existing document.
Dim document As New PdfLoadedDocument("..\..\Annotations.pdf")
'Load the existing PdfInkAnnotation
Dim ink As PdfLoadedInkAnnotation = document.Pages(0).Annotations(0)
'Get the review collection
Dim reviewCollection As PdfLoadedPopupAnnotationCollection = ink.ReviewHistory
'save the document
document.Save("InkAnnotation.pdf")
'Close the document.
document.Close(True)
See Also
Methods
Save()
Saves an annotation.
Declaration
protected override void Save()
Overrides
Implements
System.ComponentModel.INotifyPropertyChanged