File Formats

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

    Show / Hide Table of Contents

    Class PdfLoadedPopupAnnotationCollection

    Represents the collection of PdfLoadedPopupAnnotation.

    Inheritance
    System.Object
    PdfCollection
    PdfLoadedPopupAnnotationCollection
    Implements
    System.Collections.IEnumerable
    Inherited Members
    PdfCollection.GetEnumerator()
    PdfCollection.Count
    PdfCollection.List
    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.Parsing
    Assembly: Syncfusion.Pdf.Base.dll
    Syntax
    public class PdfLoadedPopupAnnotationCollection : PdfCollection, IEnumerable
    Examples
    //Load an existing document.
    PdfLoadedDocument document = new PdfLoadedDocument(@"..\..\Annotations.pdf");
    //Load the existing PdfFreeTextAnnotation
    PdfLoadedFreeTextAnnotation  free = document.Pages[0].Annotations[0] as PdfLoadedFreeTextAnnotation;
    //Get the review collection
    PdfLoadedPopupAnnotationCollection reviewCollection = free.ReviewHistory;
    foreach (PdfLoadedPopupAnnotation popup in reviewCollection){
    //Gets the annotation state
    PdfAnnotationState state = popup.AnnotationState;
    //Gets the annotation state model 
    PdfAnnotationStateModel model = popup.AnnotationStateModel;
    }
    //save the document
    document.Save("FreetextAnnotation.pdf");
    //Close the docuemnt
    document.Close(true);
    'Load an existing document.
    Dim document As New PdfLoadedDocument("..\..\Annotations.pdf")
    'Load the existing PdfFreeTextAnnotation
    Dim free As PdfLoadedFreeTextAnnotation = document.Pages(0).Annotations(0)
    'Get the review collection
    Dim reviewCollection As PdfLoadedPopupAnnotationCollection = free.ReviewHistory
    For Each popup As PdfLoadedPopupAnnotation In reviewCollection
    'Get the annotation state
    Dim state As PdfAnnotationState = popup.AnnotationState
    'Get the annotation state model
    Dim model As PdfAnnotationStateModel = popup.AnnotationStateModel
    Next
    'save the document
    document.Save("FreetextAnnotation.pdf")
    'Close the document.
    document.Close(True)

    Properties

    Item[Int32]

    Gets the PdfLoadedPopupAnnotation at the specified index.[Read-Only]

    Declaration
    public PdfLoadedPopupAnnotation this[int index] { get; }
    Parameters
    Type Name Description
    System.Int32 index
    Property Value
    Type Description
    PdfLoadedPopupAnnotation
    Examples
    Load an existing document
    PdfLoadedDocument document = new PdfLoadedDocument(@"../../Annotation.pdf");
    //Load the existing Page on document
    PdfLoadedPage lpage = document.Pages[0] as PdfLoadedPage;
    //load the annotation collection on this page
    PdfLoadedAnnotationCollection annotations = lpage.Annotations;
    //Load the existing PdfFreeTextAnnotation
    PdfLoadedFreeTextAnnotation freeText = annotations[0] as PdfLoadedFreeTextAnnotation;
    //Gets the review collection
    PdfLoadedPopupAnnotationCollection reviewCollection = freeText.ReviewHistory;
    PdfLoadedPopupAnnotation popupAnnot = reviewCollection[0];
    //Gets the annotation state
    PdfAnnotationState state = popupAnnot.AnnotationState;
    //Gets the annotation state model
    PdfAnnotationStateModel model = popupAnnot.AnnotationStateModel;
    //Save the document
    document.Save("Output.pdf");
    //Close the document
    document.Close(true);
    'Load an existing document
     Dim document As PdfLoadedDocument = New PdfLoadedDocument("../../Annotation.pdf")
    'Load the existing Page on document
     Dim lpage As PdfLoadedPage = document.Pages(0)
    'load the annotation collection on this page
     Dim annotations As PdfLoadedAnnotationCollection = lpage.Annotations
     'Load the existing PdfFreeTextAnnotation
     Dim freeText As PdfLoadedFreeTextAnnotation = annotations(0)
     'Gets the review collection
     Dim reviewCollection As PdfLoadedPopupAnnotationCollection = freeText.ReviewHistory
     Dim popupAnnot As PdfLoadedPopupAnnotation = reviewCollection(0)
     'Gets the annotation state
     Dim state As PdfAnnotationState = popupAnnot.AnnotationState
     'Gets the annotation state model
     Dim model As PdfAnnotationStateModel = popupAnnot.AnnotationStateModel
     'Save the document
     document.Save("Output.pdf")
     'Close the document
     document.Close(true)

    Methods

    Add(PdfPopupAnnotation)

    To add comments or reviews on the Annotation.

    Declaration
    public void Add(PdfPopupAnnotation popupAnnotation)
    Parameters
    Type Name Description
    PdfPopupAnnotation popupAnnotation
    Examples
    //Load the PDF document
    PdfLoadedDocument ldoc = new PdfLoadedDocument("MutipleReview_Edit.pdf");
    //Load the PDF document page
    PdfLoadedPage lpage = ldoc.Pages[0] as PdfLoadedPage;
    PdfLoadedAnnotationCollection annots = lpage.Annotations;
    //Load the annotation
    PdfLoadedLineAnnotation loadedLine = annots[0] as PdfLoadedLineAnnotation;
    //Get annoatation review history
    PdfLoadedPopupAnnotationCollection review = loadedLine.ReviewHistory;
    PdfLoadedPopupAnnotationCollection comments = loadedLine.Comments;
    //Add new review and comments
    PdfPopupAnnotation newReview = new PdfPopupAnnotation();
    newReview.Author = "NewpopupAuthor";
    newReview.State = PdfAnnotationState.Completed;
    newReview.StateModel = PdfAnnotationStateModel.Review;
    //Add review history
    loadedLine.ReviewHistory.Add(newReview);
    PdfPopupAnnotation newComment = new PdfPopupAnnotation();
    newComment.Author = "Comment1";
    newComment.Text = "comment1Text";
    loadedLine.Comments.Add(newComment);
    //Save the document
    ldoc.Save("Output.pdf");
    //Close the document
    ldoc.Close(true);
    Dim ldoc As PdfLoadedDocument = New PdfLoadedDocument("MutipleReview_Edit.pdf")
    Dim lpage As PdfLoadedPage = CType(ldoc.Pages(0), PdfLoadedPage)
    Dim annots As PdfLoadedAnnotationCollection = lpage.Annotations
    Dim loadedLine As PdfLoadedLineAnnotation = CType(annots(0), PdfLoadedLineAnnotation)
    Dim review As PdfLoadedPopupAnnotationCollection = loadedLine.ReviewHistory
    Dim comments As PdfLoadedPopupAnnotationCollection = loadedLine.Comments
    Dim newComment As PdfPopupAnnotation = New PdfPopupAnnotation
    newComment.Author = "Comment1"
    newComment.Text = "comment1Text"
    loadedLine.Comments.Add(newComment)
    Dim newReview As PdfPopupAnnotation = New PdfPopupAnnotation
    newReview.Author = "NewpopupAuthor"
    newReview.State = PdfAnnotationState.Completed
    newReview.StateModel = PdfAnnotationStateModel.Review
    'Add review history
    loadedLine.ReviewHistory.Add(newReview)
    'Save the document
    ldoc.Save("EditState.pdf")
    'Close the document
    ldoc.Close(true)

    Remove(PdfAnnotation)

    Removes the reviews or comments

    Declaration
    public void Remove(PdfAnnotation popupAnnotation)
    Parameters
    Type Name Description
    PdfAnnotation popupAnnotation
    Examples
    //Load the PDF document
    PdfLoadedDocument ldoc = new PdfLoadedDocument("MutipleReview_Edit.pdf");
    //Load the PDF document page
    PdfLoadedPage lpage = ldoc.Pages[0] as PdfLoadedPage;
    PdfLoadedAnnotationCollection annots = lpage.Annotations;
    //Load the annotation
    PdfLoadedLineAnnotation loadedLine = annots[0] as PdfLoadedLineAnnotation;
    //Get annoatation review history
    PdfLoadedPopupAnnotationCollection review = loadedLine.ReviewHistory;
    PdfLoadedPopupAnnotationCollection comments = loadedLine.Comments;
    PdfPopupAnnotation newComment = new PdfPopupAnnotation();
    newComment.Author = "Comment1";
    newComment.Text = "comment1Text";
    loadedLine.Comments.Add(newComment);
    //Create new review history
    PdfPopupAnnotation newReview = new PdfPopupAnnotation();
    newReview.Author = "NewpopupAuthor";
    newReview.State = PdfAnnotationState.Completed;
    newReview.StateModel = PdfAnnotationStateModel.Review;
    //Add review history
    loadedLine.ReviewHistory.Add(newReview);
    //Remove review and comments
    loadedLine.ReviewHistory.Remove(newReview);
    loadedLine.Comments.Remove(newComment);
    //Save the document
    ldoc.Save("Output.pdf");
    //Close the document
    ldoc.Close(true);
    Dim ldoc As PdfLoadedDocument = New PdfLoadedDocument("MutipleReview_Edit.pdf")
    Dim lpage As PdfLoadedPage = CType(ldoc.Pages(0), PdfLoadedPage)
    Dim annots As PdfLoadedAnnotationCollection = lpage.Annotations
    Dim loadedLine As PdfLoadedLineAnnotation = CType(annots(0), PdfLoadedLineAnnotation)
    Dim review As PdfLoadedPopupAnnotationCollection = loadedLine.ReviewHistory
    Dim comments As PdfLoadedPopupAnnotationCollection = loadedLine.Comments
    Dim newComment As PdfPopupAnnotation = New PdfPopupAnnotation
    newComment.Author = "Comment1"
    newComment.Text = "comment1Text"
    loadedLine.Comments.Add(newComment)
    Dim newReview As PdfPopupAnnotation = New PdfPopupAnnotation
    newReview.Author = "NewpopupAuthor"
    newReview.State = PdfAnnotationState.Completed
    newReview.StateModel = PdfAnnotationStateModel.Review
    'Add review history
    loadedLine.ReviewHistory.Add(newReview)
    'Remove review and comments
    loadedLine.ReviewHistory.Remove(newReview)
    loadedLine.Comments.Remove(newComment)
    'Save the document
    ldoc.Save("Output.pdf")
    'Close the document
    ldoc.Close(true)

    RemoveAt(Int32)

    Removes the annotation comments or reviews at the specified index

    Declaration
    public void RemoveAt(int index)
    Parameters
    Type Name Description
    System.Int32 index
    Examples
    //Load the PDF document
    PdfLoadedDocument ldoc = new PdfLoadedDocument("MutipleReview_Edit.pdf");
    //Load the PDF document page
    PdfLoadedPage lpage = ldoc.Pages[0] as PdfLoadedPage;
    PdfLoadedAnnotationCollection annots = lpage.Annotations;
    //Load the annotation
    PdfLoadedLineAnnotation loadedLine = annots[0] as PdfLoadedLineAnnotation;
    //Get annoatation review history
    PdfLoadedPopupAnnotationCollection review = loadedLine.ReviewHistory;
    PdfLoadedPopupAnnotationCollection comments = loadedLine.Comments;
    PdfPopupAnnotation newComment = new PdfPopupAnnotation();
    newComment.Author = "Comment1";
    newComment.Text = "comment1Text";
    loadedLine.Comments.Add(newComment);
    //Create new review history
    PdfPopupAnnotation newReview = new PdfPopupAnnotation();
    newReview.Author = "NewpopupAuthor";
    newReview.State = PdfAnnotationState.Completed;
    newReview.StateModel = PdfAnnotationStateModel.Review;
    //Add review history
    loadedLine.ReviewHistory.Add(newReview);
    //Remove review and comments
    loadedLine.ReviewHistory.RemoveAt(0);
    loadedLine.Comments.RemoveAt(0);
    //Save the document
    ldoc.Save("Output.pdf");
    //Close the document
    ldoc.Close(true);
    Dim ldoc As PdfLoadedDocument = New PdfLoadedDocument("MutipleReview_Edit.pdf")
    Dim lpage As PdfLoadedPage = CType(ldoc.Pages(0), PdfLoadedPage)
    Dim annots As PdfLoadedAnnotationCollection = lpage.Annotations
    Dim loadedLine As PdfLoadedLineAnnotation = CType(annots(0), PdfLoadedLineAnnotation)
    Dim review As PdfLoadedPopupAnnotationCollection = loadedLine.ReviewHistory
    Dim comments As PdfLoadedPopupAnnotationCollection = loadedLine.Comments
    Dim newComment As PdfPopupAnnotation = New PdfPopupAnnotation
    newComment.Author = "Comment1"
    newComment.Text = "comment1Text"
    loadedLine.Comments.Add(newComment)
    Dim newReview As PdfPopupAnnotation = New PdfPopupAnnotation
    newReview.Author = "NewpopupAuthor"
    newReview.State = PdfAnnotationState.Completed
    newReview.StateModel = PdfAnnotationStateModel.Review
    'Add review history
    loadedLine.ReviewHistory.Add(newReview)
    'Remove review and comments
    loadedLine.ReviewHistory.RemoveAt(0)
    loadedLine.Comments.RemoveAt(0)
    'Save the document
    ldoc.Save("Output.pdf")
    'Close the document
    ldoc.Close(true)

    Implements

    System.Collections.IEnumerable
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved