menu

ASP.NET Web Forms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class PdfLoadedAttachmentAnnotation

    Show / Hide Table of Contents

    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
    PdfAnnotation
    PdfLoadedAnnotation
    PdfLoadedStyledAnnotation
    PdfLoadedAttachmentAnnotation
    Implements
    System.ComponentModel.INotifyPropertyChanged
    Inherited Members
    PdfLoadedStyledAnnotation.CheckFlatten()
    PdfLoadedStyledAnnotation.FlattenAnnotationTemplate(PdfTemplate, Boolean)
    PdfLoadedStyledAnnotation.Color
    PdfLoadedStyledAnnotation.Opacity
    PdfLoadedStyledAnnotation.InnerColor
    PdfLoadedStyledAnnotation.Text
    PdfLoadedStyledAnnotation.Author
    PdfLoadedStyledAnnotation.Subject
    PdfLoadedStyledAnnotation.ModifiedDate
    PdfLoadedStyledAnnotation.Name
    PdfLoadedStyledAnnotation.Bounds
    PdfLoadedStyledAnnotation.Border
    PdfLoadedStyledAnnotation.Location
    PdfLoadedStyledAnnotation.Size
    PdfLoadedStyledAnnotation.AnnotationFlags
    PdfLoadedAnnotation.ObjectID
    PdfLoadedAnnotation.SetText(String)
    PdfLoadedAnnotation.GetValues(String)
    PdfLoadedAnnotation.SetValues(String, String)
    PdfLoadedAnnotation.CreationDate
    PdfLoadedAnnotation.Type
    PdfLoadedAnnotation.Page
    PdfAnnotation.SetAppearance(Boolean)
    PdfAnnotation.Initialize()
    PdfAnnotation.CalculateBounds(RectangleF, PdfPage, PdfLoadedPage)
    PdfAnnotation.CalculateTemplateBounds(RectangleF, PdfPageBase, PdfTemplate)
    PdfAnnotation.CalculateTemplateBounds(RectangleF, PdfPageBase, PdfTemplate, Boolean, PdfGraphics)
    PdfAnnotation.CalculateTemplateBounds(RectangleF, PdfPageBase, PdfTemplate, Boolean)
    PdfAnnotation.Flatten
    PdfAnnotation.FlattenPopUps
    PdfAnnotation.PdfTag
    PdfAnnotation.Layer
    PdfAnnotation.Rotate
    PdfAnnotation.PropertyChanged
    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 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
    PdfLoadedDocument
    PdfLoadedPage

    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 Description
    System.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)

    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
    PdfLoadedDocument
    PdfLoadedPage

    Methods

    Save()

    Declaration
    protected override void Save()
    Overrides
    PdfAnnotation.Save()

    Implements

    System.ComponentModel.INotifyPropertyChanged

    See Also

    PdfLoadedDocumentLinkAnnotation
    PdfLoadedFileLinkAnnotation
    PdfLoadedLineAnnotation
    PdfLoadedPopupAnnotation
    PdfLoadedRubberStampAnnotation
    PdfLoadedSoundAnnotation
    PdfLoadedTextMarkupAnnotation
    PdfLoadedTextWebLinkAnnotation
    PdfLoadedUriAnnotation
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved