Some test text!


Creating PDF free text annotations using JavaScript

Here is an example of creating a free text annotation using JavaScript, but creating other types of annotations are similar.

const freeText = new Annotations.FreeTextAnnotation();
freeText.PageNumber = 1;
freeText.X = 150;
freeText.Y = 200;
freeText.Width = 150;
freeText.Height = 50;
freeText.setPadding(new Annotations.Rect(0, 0, 0, 0));
freeText.setContents('My Text');
freeText.FillColor = new Annotations.Color(0, 255, 255);
freeText.FontSize = '16pt';


Get the answers you need: Support


Free Trial

Get unlimited trial usage of PDFTron SDK to bring accurate, reliable, and fast document processing capabilities to any application or workflow.

Select a platform to get started with your free trial.

Unlimited usage. No email address required.

Join our live demo to learn about use cases & capabilities for WebViewer

Learn more