Class PdfLoadedInkAnnotation
- Namespace
- Syncfusion.Pdf.Interactive
- Assembly
- Syncfusion.Pdf.Portable.dll
Represent Loaded ink annotation, Ink annotation represents freehand scribble comprising one or more disjoint paths.
public class PdfLoadedInkAnnotation : PdfLoadedStyledAnnotation, INotifyPropertyChanged
- Inheritance
-
PdfLoadedInkAnnotation
- Implements
- Inherited Members
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
public PdfLineBorderStyle BorderStyle { get; set; }
Property Value
- 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.
public int BorderWidth { get; set; }
Property Value
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)
Remarks
The default value of border width is 1.
- See Also
Comments
Gets the annotation comments history.
public PdfLoadedPopupAnnotationCollection Comments { get; }
Property Value
- 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.
public int[] DashArray { get; set; }
Property Value
- int[]
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
Get or sets the Path of the ink annotation
public List<float> InkList { get; set; }
Property Value
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");
//Close the document.
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")
'Close the document.
document.Close(True)
- See Also
InkPointsCollection
Gets or sets mutiple points of the InkList value.
public List<List<float>> InkPointsCollection { get; set; }
Property Value
- See Also
ReviewHistory
Gets the annotation review history.
public PdfLoadedPopupAnnotationCollection ReviewHistory { get; }
Property Value
- 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.
protected override void Save()
- See Also