Table of Contents

Class PdfLoadedAnnotation

Namespace
Syncfusion.Pdf.Interactive
Assembly
Syncfusion.Pdf.Portable.dll

The class provides methods and properties to handle the loaded annotations from the existing PDF document.

public abstract class PdfLoadedAnnotation : PdfAnnotation, INotifyPropertyChanged
Inheritance
PdfLoadedAnnotation
Implements
Derived
Inherited Members

Examples

//Load an existing document.
PdfLoadedDocument document = new PdfLoadedDocument(@"..\..\Annotations.pdf");
//Get the annotation from loaded document.
PdfLoadedSoundAnnotation soundAnnotation = document.Pages[1].Annotations[5] as PdfLoadedSoundAnnotation;
//Get the page.
PdfLoadedPage page =soundAnnotation.Page;
//Save the document.
document.Save("SoundAnnotation.pdf");
document.Close(true);
'Load an existing document.
Dim document As New PdfLoadedDocument("..\..\Annotations.pdf")
'Gets the annotation from loaded document.
Dim soundAnnotation As PdfLoadedSoundAnnotation = document.Pages(1).Annotations(5) as PdfLoadedSoundAnnotation
'Gets the page.
Dim page As PdfLoadedPage=soundAnnotation.Page
'Save the document.
document.Save("SoundAnnotation.pdf")
document.Close(True)

Remarks

Please refer UG documentation link for PdfSoundAnnotation from this link

Fields

ObjectID

Represents the Form field identifier

public int ObjectID

Field Value

int
See Also

Properties

CreationDate

Gets the creation date.

public DateTime CreationDate { get; }

Property Value

DateTime

The creation date.

Examples

//Load an existing document.
PdfLoadedDocument document = new PdfLoadedDocument(@"..\..\Annotations.pdf");
//Gets the annotation from loaded document.
PdfLoadedAnnotation loadedAnnotation = document.Pages[0].Annotations[0] as PdfLoadedAnnotation;
//Gets the creation date.
DateTime creationDate = loadedAnnotation.CreationDate;
//Save the document.
document.Save("output.pdf");
document.Close(true);
'Load an existing document.
 Dim document As New PdfLoadedDocument("..\..\Annotations.pdf")
 'Gets the annotation from loaded document.
 Dim loadedAnnotation As PdfLoadedAnnotation = TryCast(document.Pages(0).Annotations(0), PdfLoadedAnnotation)
 'Gets the creation date.
 DateTime creationDate = loadedAnnotation.CreationDate;
 'Save the document.
 document.Save("output.pdf")
 document.Close(True)
See Also

Page

Gets and sets the PdfLoadedPage where the annotation is present.

public PdfLoadedPage Page { get; set; }

Property Value

PdfLoadedPage

The PdfLoadedPage of the existing PDF document

Examples

//Load an existing document.
PdfLoadedDocument document = new PdfLoadedDocument(@"..\..\Annotations.pdf");
//Get the annotation from loaded document.
PdfLoadedSoundAnnotation soundAnnotation = document.Pages[1].Annotations[5] as PdfLoadedSoundAnnotation;
//Get the page.
PdfLoadedPage page =soundAnnotation.Page;
//Save the document.
document.Save("SoundAnnotation.pdf");
document.Close(true);
'Load an existing document.
Dim document As New PdfLoadedDocument("..\..\Annotations.pdf")
'Gets the annotation from loaded document.
Dim soundAnnotation As PdfLoadedSoundAnnotation = document.Pages(1).Annotations(5) as PdfLoadedSoundAnnotation
'Gets the page.
Dim page As PdfLoadedPage=soundAnnotation.Page
'Save the document.
document.Save("SoundAnnotation.pdf")
document.Close(True)
See Also

Type

Gets the annotation type.

public PdfLoadedAnnotationType Type { get; }

Property Value

PdfLoadedAnnotationType

The annotation type.

Examples

//Load an existing document.
PdfLoadedDocument document = new PdfLoadedDocument(@"..\..\Annotations.pdf");
//Gets the annotation from loaded document.
PdfLoadedAnnotation loadedAnnotation = document.Pages[0].Annotations[0] as PdfLoadedAnnotation;
//Gets the annotation type.
PdfLoadedAnnotationType annotationType = loadedAnnotation.Type;
//Save the document.
document.Save("output.pdf");
document.Close(true);
'Load an existing document.
 Dim document As New PdfLoadedDocument("..\..\Annotations.pdf")
 'Gets the annotation from loaded document.
 Dim loadedAnnotation As PdfLoadedAnnotation = TryCast(document.Pages(0).Annotations(0), PdfLoadedAnnotation)
 'Gets the annotation type.
 PdfLoadedAnnotationType annotationType = loadedAnnotation.Type
 'Save the document.
 document.Save("output.pdf")
 document.Close(True)
See Also

Methods

GetValues(string)

Gets the values associated with the specified key.

public List<string> GetValues(string name)

Parameters

name string

Returns

List<string>
See Also

SetText(string)

Sets the name of the annotation

public void SetText(string text)

Parameters

text string

Examples

//Load an existing document.
PdfLoadedDocument document = new PdfLoadedDocument(@"..\..\Annotations.pdf");
//Gets the annotation from loaded document.
PdfLoadedSoundAnnotation soundAnnotation = document.Pages[1].Annotations[5] as PdfLoadedSoundAnnotation;
//Sets the annotation text.
soundAnnotation.SetText("Sound Annotation");
//Save the document.
document.Save("SoundAnnotation.pdf");
document.Close(true);
'Load an existing document.
Dim document As New PdfLoadedDocument("..\..\Annotations.pdf")
'Gets the annotation from loaded document.
Dim soundAnnotation As PdfLoadedSoundAnnotation = document.Pages(1).Annotations(5) as PdfLoadedSoundAnnotation
'Sets the annotation text.
soundAnnotation.SetText("Sound Annotation")
'Save the document.
document.Save("SoundAnnotation.pdf")
document.Close(True)
See Also

SetValues(string, string)

Set the values associated with the specified key.

public void SetValues(string key, string value)

Parameters

key string
value string

Examples

PdfLoadedDocument ldoc = new PdfLoadedDocument("WF_48044_Annotation.pdf");
PdfLoadedPage lpage = ldoc.Pages[0] as PdfLoadedPage;
PdfLoadedAnnotationCollection annots = lpage.Annotations;
PdfLoadedCircleAnnotation Icircle = annots[64] as PdfLoadedCircleAnnotation;
//Get the author
string author = Icircle.Author;
PdfLoadedPopupAnnotationCollection collection = Icircle.ReviewHistory;
PdfLoadedPopupAnnotationCollection collectionComments = Icircle.Comments;
PdfLoadedPopupAnnotation annotation = collection[1] as PdfLoadedPopupAnnotation;
//Set Unknown state and model
annotation.SetValues("State", "StateModel");
annotation.SetValues("StateModel", "CustomState");
ldoc.Save("result.pdf");
Dim ldoc As PdfLoadedDocument = New PdfLoadedDocument("WF_48044_Annotation.pdf")
Dim lpage As PdfLoadedPage = CType(ldoc.Pages(0), PdfLoadedPage)
Dim annots As PdfLoadedAnnotationCollection = lpage.Annotations
Dim Icircle As PdfLoadedCircleAnnotation = CType(annots(64), PdfLoadedCircleAnnotation)
Dim author As String = Icircle.Author
Dim collection As PdfLoadedPopupAnnotationCollection = Icircle.ReviewHistory
Dim collectionComments As PdfLoadedPopupAnnotationCollection = Icircle.Comments
Dim annotation As PdfLoadedPopupAnnotation = CType(collection(1), PdfLoadedPopupAnnotation)
'Set Unknown state and model
annotation.SetValues("State", "StateModel")
annotation.SetValues("StateModel", "CustomState")
ldoc.Save("result.pdf")
See Also

See Also