Basic usage

On this page

Annotate your documents with just a few lines of code. The topics below cover the core annotation operations using a local sample.pdf (the same patterns apply to Word, Excel, PowerPoint, image, and other supported files). Every example is runnable — copy the script, download the linked sample file, and run it.

In this section

  • Add Annotations — add area, ellipse, point, arrow, distance, polyline, text-markup, text-field, watermark, link, and image annotations.
  • Manage Annotations — list every annotation in a document, remove one by its id, or remove them all.
  • Comments and Replies — attach a threaded discussion of replies and users to an annotation.
  • Import and Export Annotations — export a document’s annotations to XML and import annotations from XML into another document.

For loading documents and saving with annotation-type or page filters, continue to Advanced Usage.

On this page