Table of Contents

Class PdfLoadedAttachmentAnnotation

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

The PdfLoadedAttachmentAnnotation represents the attachment annotation loaded from the existing PDF document, it provides methods and properties to modify the attachment.

public class PdfLoadedAttachmentAnnotation : PdfLoadedStyledAnnotation, INotifyPropertyChanged
Inheritance
PdfLoadedAttachmentAnnotation
Implements
Inherited Members

Examples

//Load an existing PDF document.
PdfLoadedDocument document = new PdfLoadedDocument(@"..\..\Annotations.pdf");
//Get the annotation from loaded document.
PdfLoadedAttachmentAnnotation attchmentAnnotation = document.Pages[1].Annotations[3] as PdfLoadedAttachmentAnnotation;
//Get the annotation flags
PdfAnnotationFlags flag = attchmentAnnotation.AnnotationFlags;
//Get the attachment annotation border.
PdfAnnotationBorder border = attchmentAnnotation.Border;
//Save the document.
document.Save("LoadedAttachmentAnnotation.pdf");
document.Close(true);
'Load an existing document.
 Dim document As New PdfLoadedDocument("..\..\Annotations.pdf")
 'Get the annotation from loaded document.
 Dim attchmentAnnotation As PdfLoadedAttachmentAnnotation = document.Pages(1).Annotations(3) as PdfLoadedAttachmentAnnotation
 'Get the annotation flags
 Dim flag As PdfAnnotationFlags = attchmentAnnotation.AnnotationFlags
 'Get the attachment annotation border.
 Dim border As PdfAnnotationBorder = attchmentAnnotation.Border
 'Save the document.
 document.Save("LoadedAttachmentAnnotation.pdf")
 document.Close(True)

Properties

Comments

Gets the annotation Comments history.

public PdfLoadedPopupAnnotationCollection Comments { get; }

Property Value

PdfLoadedPopupAnnotationCollection

The Comments collection of the attachment annotation.

Examples

//Load an existing document.
PdfLoadedDocument document = new PdfLoadedDocument(@"..\..\Annotations.pdf");
//Load the existing PdfAttachmentAnnotation
PdfLoadedAttachmentAnnotation  attachment = document.Pages[0].Annotations[0] as PdfLoadedAttachmentAnnotation;
//Get the Comments collection
PdfLoadedPopupAnnotationCollection CommentsCollection = attachment.Comments;
//save the document
document.Save("AttachmentAnnotation.pdf");
//Close the docuemnt
document.Close(true);
'Load an existing document.
Dim document As New PdfLoadedDocument("..\..\Annotations.pdf")
'Load the existing PdfAttachmentAnnotation
Dim attachment As PdfLoadedAttachmentAnnotation = document.Pages(0).Annotations(0)
'Get the Comments collection
Dim CommentsCollection As PdfLoadedPopupAnnotationCollection = attachment.Comments
'save the document
document.Save("AttachmentAnnotation.pdf")
'Close the document.
document.Close(True)
See Also

Data

Get the data bytes from the attached file.

public byte[] Data { get; }

Property Value

byte[]

The array of data bytes of the attached file

Examples

//Load an existing PDF document.
 PdfLoadedDocument document = new PdfLoadedDocument(@"..\..\Annotations.pdf");
 //Get the annotation from loaded document.
 PdfLoadedAttachmentAnnotation attchmentAnnotation = document.Pages[1].Annotations[3] as PdfLoadedAttachmentAnnotation;
 //Get the attached file name
 string fileName = attchmentAnnotation.FileName;
  //Get the array of data bytes of the attached file.
 byte[] data = attchmentAnnotation.Data;
 //Save and close the document.
 document.Save("LoadedAttachmentAnnotation.pdf");
 document.Close(true);
'Load an existing PDF document.
Dim document As New PdfLoadedDocument("..\..\Annotations.pdf")
'Get the annotation from loaded document.
Dim attchmentAnnotation As PdfLoadedAttachmentAnnotation = TryCast(document.Pages(1).Annotations(3), PdfLoadedAttachmentAnnotation)
'Get the attached file name
Dim fileName As String = attchmentAnnotation.FileName
'Get the array of data bytes of the attached file.
 Dim data As Byte() = attchmentAnnotation.Data
'Save and close the document.
document.Save("LoadedAttachmentAnnotation.pdf")
document.Close(True)
See Also

FileName

public string FileName { get; }

Property Value

string

Examples

The name of the file to be attached.

//Load an existing PDF document.
 PdfLoadedDocument document = new PdfLoadedDocument(@"..\..\Annotations.pdf");
 //Get the annotation from loaded document.
 PdfLoadedAttachmentAnnotation attchmentAnnotation = document.Pages[1].Annotations[3] as PdfLoadedAttachmentAnnotation;
 //Get the attached file name
 string fileName = attchmentAnnotation.FileName;
 //Save and close the document.
 document.Save("LoadedAttachmentAnnotation.pdf");
 document.Close(true);
'Load an existing PDF document.
Dim document As New PdfLoadedDocument("..\..\Annotations.pdf")
'Get the annotation from loaded document.
Dim attchmentAnnotation As PdfLoadedAttachmentAnnotation = TryCast(document.Pages(1).Annotations(3), PdfLoadedAttachmentAnnotation)
'Get the attached file name
Dim fileName As String = attchmentAnnotation.FileName
'Save and close the document.
document.Save("LoadedAttachmentAnnotation.pdf")
document.Close(True)
See Also

Icon

Gets or sets the icon of the attachment annotation.

public PdfAttachmentIcon Icon { get; set; }

Property Value

PdfAttachmentIcon

The PdfAttachmentIcon used to set the icon to the attachment annotation

Examples

//Load an existing PDF document.
PdfLoadedDocument document = new PdfLoadedDocument(@"..\..\Annotations.pdf");
//Get the annotation from loaded document.
PdfLoadedAttachmentAnnotation attchmentAnnotation = document.Pages[1].Annotations[3] as PdfLoadedAttachmentAnnotation;
attchmentAnnotation.Icon=PdfAttachmentIcon.PushPin;
//Save the document.
document.Save("LoadedAttachmentAnnotation.pdf");
document.Close(true);
'Load an existing document.
 Dim document As New PdfLoadedDocument("..\..\Annotations.pdf")
 'Get the annotation from loaded document.
 Dim attchmentAnnotation As PdfLoadedAttachmentAnnotation = document.Pages(1).Annotations(3) as PdfLoadedAttachmentAnnotation
 attchmentAnnotation.Icon=PdfAttachmentIcon.PushPin
 'Save the document.
 document.Save("LoadedAttachmentAnnotation.pdf")
 document.Close(True)
See Also

ReviewHistory

Gets the annotation review history.

public PdfLoadedPopupAnnotationCollection ReviewHistory { get; }

Property Value

PdfLoadedPopupAnnotationCollection

The review collection of the attachment annotation.

Examples

//Load an existing document.
PdfLoadedDocument document = new PdfLoadedDocument(@"..\..\Annotations.pdf");
//Load the existing PdfAttachmentAnnotation
PdfLoadedAttachmentAnnotation  attachment = document.Pages[0].Annotations[0] as PdfLoadedAttachmentAnnotation;
//Get the review collection
PdfLoadedPopupAnnotationCollection reviewCollection = attachment.ReviewHistory;
//save the document
document.Save("AttachmentAnnotation.pdf");
//Close the docuemnt
document.Close(true);
'Load an existing document.
Dim document As New PdfLoadedDocument("..\..\Annotations.pdf")
'Load the existing PdfAttachmentAnnotation
Dim attachment As PdfLoadedAttachmentAnnotation = document.Pages(0).Annotations(0)
'Get the review collection
Dim reviewCollection As PdfLoadedPopupAnnotationCollection = attachment.ReviewHistory
'save the document
document.Save("AttachmentAnnotation.pdf")
'Close the document.
document.Close(True)
See Also

Methods

Save()

Saves an annotation.

protected override void Save()
See Also

See Also