Class PdfLoadedAttachmentAnnotation
The PdfLoadedAttachmentAnnotation represents the attachment annotation loaded from the existing PDF document, it provides methods and properties to modify the attachment.
Inheritance
System.Object
PdfLoadedAttachmentAnnotation
Inherited Members
Namespace: Syncfusion.Pdf.Interactive
Assembly: Syncfusion.Pdf.UWP.dll
Syntax
public class PdfLoadedAttachmentAnnotation : PdfLoadedStyledAnnotation, IPdfWrapper, INotifyPropertyChanged
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.
Declaration
public PdfLoadedPopupAnnotationCollection Comments { get; }
Property Value
Type | Description |
---|---|
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.
Declaration
public byte[] Data { get; }
Property Value
Type | Description |
---|---|
System.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)
FileName
Declaration
public string FileName { get; }
Property Value
Type |
---|
System.String |
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;
//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)
Icon
Gets or sets the icon of the attachment annotation.
Declaration
public PdfAttachmentIcon Icon { get; set; }
Property Value
Type | Description |
---|---|
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)
ReviewHistory
Gets the annotation review history.
Declaration
public PdfLoadedPopupAnnotationCollection ReviewHistory { get; }
Property Value
Type | Description |
---|---|
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()
Declaration
protected override void Save()
Overrides
Implements
System.ComponentModel.INotifyPropertyChanged