PdfDocumentAnnotations
OfficeIMO.Pdf
Existing-document annotation creation, update, removal, and flattening operations.
Inheritance
- object
- PdfDocumentAnnotations
Remarks
Native page coordinates use default user-space units: one unit is /UserUnit physical points (1/72 inch each), defaulting to 1. Local text/font and matrix values retain their native coordinate spaces. Explicit visual projections use their documented coordinates.
Usage
Explore 1 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 1
- Property PdfDocument.Annotations
Methods
public PdfAnnotationEditResult Add(PdfAnnotationCreateOptions options, CancellationToken cancellationToken = default) #Adds an annotation to an existing page.
Parameters
- options OfficeIMO.Pdf.PdfAnnotationCreateOptions
- cancellationToken System.Threading.CancellationToken = default
Returns
PdfAnnotationEditResultpublic PdfAnnotationEditResult AddReply(int parentObjectNumber, string contents, PdfAnnotationReplyOptions? options = null, CancellationToken cancellationToken = default) #Adds a reply to one indirect annotation.
Parameters
- parentObjectNumber int
- contents string
- options OfficeIMO.Pdf.PdfAnnotationReplyOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
PdfAnnotationEditResultpublic PdfAnnotationEditResult AddStamp(PdfStampAnnotationOptions options, CancellationToken cancellationToken = default) #Adds a text or image-backed Stamp annotation without changing page content.
Parameters
- options OfficeIMO.Pdf.PdfStampAnnotationOptions
- cancellationToken System.Threading.CancellationToken = default
Returns
PdfAnnotationEditResultpublic PdfAnnotationEditResult Arrange(IReadOnlyList<int> objectNumbers, PdfAnnotationOrderChange change) #Changes selected annotations' page painting order while preserving their relative order.
Parameters
- objectNumbers System.Collections.Generic.IReadOnlyList<int>
- change OfficeIMO.Pdf.PdfAnnotationOrderChange
Returns
PdfAnnotationEditResultpublic PdfAnnotationEditResult Arrange(IReadOnlyList<int> objectNumbers, PdfAnnotationOrderChange change, CancellationToken cancellationToken) #Performs this annotation edit with cooperative cancellation.
Parameters
- objectNumbers System.Collections.Generic.IReadOnlyList<int>
- change OfficeIMO.Pdf.PdfAnnotationOrderChange
- cancellationToken System.Threading.CancellationToken
Returns
PdfAnnotationEditResultpublic PdfAnnotationEditResult CopyMany(IReadOnlyList<int> objectNumbers, double deltaX = 10, double deltaY = 10) #Copies selected annotations and their standard groups on the same pages with a user-space offset.
Parameters
- objectNumbers System.Collections.Generic.IReadOnlyList<int>
- deltaX double = 10
- deltaY double = 10
Returns
PdfAnnotationEditResultpublic PdfAnnotationEditResult CopyMany(IReadOnlyList<int> objectNumbers, double deltaX, double deltaY, CancellationToken cancellationToken) #Performs this annotation edit with cooperative cancellation.
Parameters
- objectNumbers System.Collections.Generic.IReadOnlyList<int>
- deltaX double
- deltaY double
- cancellationToken System.Threading.CancellationToken
Returns
PdfAnnotationEditResultpublic PdfAnnotationEditResult CopyManyVisual(IReadOnlyList<int> objectNumbers, double deltaX = 10, double deltaY = 10) #Copies selected annotations on their existing pages by a top-left visual offset, mapping each page's crop, rotation, and user-unit scale in one mutation.
Parameters
- objectNumbers System.Collections.Generic.IReadOnlyList<int>
- deltaX double = 10
- deltaY double = 10
Returns
PdfAnnotationEditResultpublic PdfAnnotationEditResult CopyManyVisual(IReadOnlyList<int> objectNumbers, double deltaX, double deltaY, CancellationToken cancellationToken) #Performs this annotation edit with cooperative cancellation.
Parameters
- objectNumbers System.Collections.Generic.IReadOnlyList<int>
- deltaX double
- deltaY double
- cancellationToken System.Threading.CancellationToken
Returns
PdfAnnotationEditResultpublic PdfAnnotationEditResult Flatten(PdfAnnotationFlattenOptions? options = null, CancellationToken cancellationToken = default) #Flattens selected supported visual annotations.
Parameters
- options OfficeIMO.Pdf.PdfAnnotationFlattenOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
PdfAnnotationEditResultpublic PdfPageInteractionMap GetEditingInteractions(int pageNumber) #Builds annotation-only visual hit regions for an authorized annotation editing workflow.
Parameters
- pageNumber int
Returns
PdfPageInteractionMappublic PdfPageInteractionMap GetEditingInteractions(int pageNumber, CancellationToken cancellationToken) #Builds annotation-only interaction regions with cooperative cancellation.
Parameters
- pageNumber int
- cancellationToken System.Threading.CancellationToken
Returns
PdfPageInteractionMappublic IReadOnlyList<PdfAnnotation> GetForEditing() #Reads annotation metadata needed to select and edit annotations under the document's annotation mutation policy.
Returns
IReadOnlyList<PdfAnnotation>public IReadOnlyList<PdfAnnotation> GetForEditing(CancellationToken cancellationToken) #Reads annotation editing metadata with cooperative cancellation.
Parameters
- cancellationToken System.Threading.CancellationToken
Returns
IReadOnlyList<PdfAnnotation>public PdfAnnotationReviewCatalog GetReviewCatalog() #Reads annotation reply threads and review states.
Returns
PdfAnnotationReviewCatalogpublic PdfAnnotationReviewCatalog GetReviewCatalog(CancellationToken cancellationToken) #Reads annotation reply threads and states with cooperative cancellation.
Parameters
- cancellationToken System.Threading.CancellationToken
Returns
PdfAnnotationReviewCatalogpublic PdfAnnotationEditResult Group(IReadOnlyList<int> objectNumbers) #Groups same-page editable markup annotations using standard /IRT and /RT Group relationships.
Parameters
- objectNumbers System.Collections.Generic.IReadOnlyList<int>
Returns
PdfAnnotationEditResultpublic PdfAnnotationEditResult Group(IReadOnlyList<int> objectNumbers, CancellationToken cancellationToken) #Performs this annotation edit with cooperative cancellation.
Parameters
- objectNumbers System.Collections.Generic.IReadOnlyList<int>
- cancellationToken System.Threading.CancellationToken
Returns
PdfAnnotationEditResultpublic PdfAnnotationEditResult Move(int objectNumber, double deltaX, double deltaY) #Moves one annotation and all supported subtype geometry by a user-space offset.
Parameters
- objectNumber int
- deltaX double
- deltaY double
Returns
PdfAnnotationEditResultpublic PdfAnnotationEditResult Move(int objectNumber, double deltaX, double deltaY, CancellationToken cancellationToken) #Performs this annotation edit with cooperative cancellation.
Parameters
- objectNumber int
- deltaX double
- deltaY double
- cancellationToken System.Threading.CancellationToken
Returns
PdfAnnotationEditResultpublic PdfAnnotationEditResult MoveMany(IReadOnlyList<int> objectNumbers, double deltaX, double deltaY) #Moves selected annotations, including their standard group members, in one mutation.
Parameters
- objectNumbers System.Collections.Generic.IReadOnlyList<int>
- deltaX double
- deltaY double
Returns
PdfAnnotationEditResultpublic PdfAnnotationEditResult MoveMany(IReadOnlyList<int> objectNumbers, double deltaX, double deltaY, CancellationToken cancellationToken) #Performs this annotation edit with cooperative cancellation.
Parameters
- objectNumbers System.Collections.Generic.IReadOnlyList<int>
- deltaX double
- deltaY double
- cancellationToken System.Threading.CancellationToken
Returns
PdfAnnotationEditResultpublic PdfAnnotationEditResult MoveManyVisual(IReadOnlyList<int> objectNumbers, double deltaX, double deltaY) #Moves selected annotations by a top-left visual offset, mapping each page's crop, rotation, and user-unit scale in one mutation.
Parameters
- objectNumbers System.Collections.Generic.IReadOnlyList<int>
- deltaX double
- deltaY double
Returns
PdfAnnotationEditResultpublic PdfAnnotationEditResult MoveManyVisual(IReadOnlyList<int> objectNumbers, double deltaX, double deltaY, CancellationToken cancellationToken) #Performs this annotation edit with cooperative cancellation.
Parameters
- objectNumbers System.Collections.Generic.IReadOnlyList<int>
- deltaX double
- deltaY double
- cancellationToken System.Threading.CancellationToken
Returns
PdfAnnotationEditResultpublic PdfAnnotationEditResult Remove(PdfAnnotationRemovalOptions? options = null, CancellationToken cancellationToken = default) #Removes matching annotations.
Parameters
- options OfficeIMO.Pdf.PdfAnnotationRemovalOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
PdfAnnotationEditResultpublic PdfAnnotationEditResult RemoveMany(IReadOnlyList<int> objectNumbers, bool allowResidualDataInAppendOnly = false) #Removes selected annotations and groups, retaining replies to removed annotations as standalone comments.
Parameters
- objectNumbers System.Collections.Generic.IReadOnlyList<int>
- allowResidualDataInAppendOnly bool = false
Returns
PdfAnnotationEditResultpublic PdfAnnotationEditResult RemoveMany(IReadOnlyList<int> objectNumbers, bool allowResidualDataInAppendOnly, CancellationToken cancellationToken) #Performs this annotation edit with cooperative cancellation.
Parameters
- objectNumbers System.Collections.Generic.IReadOnlyList<int>
- allowResidualDataInAppendOnly bool
- cancellationToken System.Threading.CancellationToken
Returns
PdfAnnotationEditResultpublic PdfAnnotationEditResult Resize(int objectNumber, PdfPageRectangle rectangle) #Resizes one annotation and proportionally transforms all supported subtype geometry.
Parameters
- objectNumber int
- rectangle OfficeIMO.Pdf.PdfPageRectangle
Returns
PdfAnnotationEditResultpublic PdfAnnotationEditResult Resize(int objectNumber, PdfPageRectangle rectangle, CancellationToken cancellationToken) #Performs this annotation edit with cooperative cancellation.
Parameters
- objectNumber int
- rectangle OfficeIMO.Pdf.PdfPageRectangle
- cancellationToken System.Threading.CancellationToken
Returns
PdfAnnotationEditResultpublic PdfAnnotationEditResult SetReviewState(int objectNumber, PdfAnnotationReviewState state, PdfMutationExecutionPreference executionPreference = Automatic, bool allowResidualDataInAppendOnly = false) #Sets the standard review state on one indirect annotation.
Parameters
- objectNumber int
- state OfficeIMO.Pdf.PdfAnnotationReviewState
- executionPreference OfficeIMO.Pdf.PdfMutationExecutionPreference = Automatic
- allowResidualDataInAppendOnly bool = false
Returns
PdfAnnotationEditResultpublic PdfAnnotationEditResult SetReviewState(int objectNumber, PdfAnnotationReviewState state, PdfMutationExecutionPreference executionPreference, bool allowResidualDataInAppendOnly, CancellationToken cancellationToken) #Sets an annotation review state with cooperative cancellation.
Parameters
- objectNumber int
- state OfficeIMO.Pdf.PdfAnnotationReviewState
- executionPreference OfficeIMO.Pdf.PdfMutationExecutionPreference
- allowResidualDataInAppendOnly bool
- cancellationToken System.Threading.CancellationToken
Returns
PdfAnnotationEditResultpublic PdfAnnotationEditResult Ungroup(IReadOnlyList<int> objectNumbers) #Removes standard grouping relationships from selected groups without removing annotations or replies.
Parameters
- objectNumbers System.Collections.Generic.IReadOnlyList<int>
Returns
PdfAnnotationEditResultpublic PdfAnnotationEditResult Ungroup(IReadOnlyList<int> objectNumbers, CancellationToken cancellationToken) #Performs this annotation edit with cooperative cancellation.
Parameters
- objectNumbers System.Collections.Generic.IReadOnlyList<int>
- cancellationToken System.Threading.CancellationToken
Returns
PdfAnnotationEditResultpublic PdfAnnotationEditResult Update(int objectNumber, PdfAnnotationUpdateOptions options, CancellationToken cancellationToken = default) #Updates one indirect annotation.
Parameters
- objectNumber int
- options OfficeIMO.Pdf.PdfAnnotationUpdateOptions
- cancellationToken System.Threading.CancellationToken = default
Returns
PdfAnnotationEditResult