Add or Replace Text Annotations in a PDF Document

Introduction

Aspose.PDF Cloud allows you to add or replace Text Annotation information in a PDF Document. Aspose.PDF Cloud provide the following API to achieve this

API Information

API Type Description Swagger Link
/pdf/{name}/pages/{pageNumber}/annotations/text POST Add document page text annotations. PostPageTextAnnotations
/pdf/{name}/pages/{pageNumber}/annotations/text PUT Replace document Text annotation PutTextAnnotation

cURL Example

Suppose, we have the following Text Annotation information which need to be added in a document page.


{

    "State": "Accepted",

    "Open": false,

    "Icon": "Check",

    "CreationDate": "02/25/2011 12:49:35.000 PM",

    "Subject": "Note",

    "Title": "Maxim",

    "RichText": "<?xml version=\"1.0\"?><body xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:xfa=\"http://www.xfa.org/schema/xfa-data/1.0/\" xfa:APIVersion=\"Acrobat:7.0.0\" xfa:spec=\"2.0.2\" ><p><span style=\"text-decoration:;font-size:10.0pt\">Contents</span></p></body>",

    "Color": {

      "A": 255,

      "R": 70,

      "G": 162,

      "B": 185

    },

    "Contents": "Contents",

    "Modified": "02/25/2011 01:09:02.000 PM",

    "Id": "GI5TAOZRGU3CYNZSGEWDCNZWFQ3TGOI",

    "Flags": [

      "Print",

      "NoZoom",

      "NoRotate"

    ],

    "Name": "4a52986c-c61f-4c2a-8118-5f88420e2abd",

    "Rect": {

      "LLX": 156.331,

      "LLY": 721.265,

      "URX": 175.332,

      "URY": 738.266

    },

    "PageIndex": 2,

    "ZIndex": 0,

    "HorizontalAlignment": "Left",

    "VerticalAlignment": "Top",

    "Links": [

      {

        "Href": "/PdfWithAnnotations.pdf/annotations/text/GI5TAOZRGU3CYNZSGEWDCNZWFQ3TGOI",

        "Rel": "self",

        "Type": null,

        "Title": null

      }

    ]

  }

SDK Source

The Aspose.PDF Cloud SDKs can be downloaded from the following page: Available SDKs

SDK Examples

PostPageTextAnnotations Examples

PutPageTextAnnotations Examples