ONLYOFFICE Docs 9.3 for developers: PDF API, new methods for Office JavaScript API, and more

6 March 2026By Ksenija

ONLYOFFICE Docs 9.3 brings a host of updates for developers. This version significantly expands the capabilities of our API, offering more control and flexibility for integrating and extending the editors. Let’s dive into the key enhancements.

ONLYOFFICE Docs 9.3 for developers: PDF API, new methods for Office JavaScript API, and more

Introducing the new PDF API

One of the most significant additions in version 9.3 is the brand-new PDF API. This powerful toolset allows you to programmatically create and manipulate PDF documents. You can now build complex PDF files from scratch, adding various elements like text, images, tables, and shapes.

The API provides extensive control over document structure and content. You can manage pages, work with rich text formatting, and insert drawings and other objects with precision. This opens up new possibilities for automating document generation and creating customized PDF-based solutions within your applications.

Check the code sample of creating a new PDF file:

// create a PDF file with ONLYOFFICE Document Builder
builder.CreateFile("pdf")

// create a new 'oDocument' variable and get the created PDF document
const oDocument = Api.GetDocument()

// create a new paragraph for the PDF content
const oParagraph = Api.CreateParagraph()

// set the paragraph justification to center the text
oParagraph.SetJc("center")

// add a text containing a single 'Center' word to the paragraph
oParagraph.AddText("Center")

// push the paragraph to the document
oDocument.Push(oParagraph)

// save the resulting PDF document as a file in the .pdf format with the 'example.pdf' name and close it
builder.SaveFile("pdf", "example.pdf")
builder.CloseFile()

Major updates to the Office JavaScript API

The Office JavaScript API has received a substantial upgrade, with numerous new methods across different modules to enhance document automation and interaction.

Form enhancements

We’ve added a rich set of methods for working with forms. You can now programmatically manage form fields, including buttons, checkboxes, comboboxes, and text fields. This allows for dynamic form creation and interaction, making it easier to build sophisticated data entry solutions.

Expanded drawing and annotation capabilities

The API for drawings and annotations has been greatly improved. New methods allow for finer control over shapes, geometry, and visual properties like fills and strokes. This includes new methods for managing:

  • Annotations (caret, circle, highlight, ink, etc.)
  • Geometries and paths
  • Fills (gradients, colors) and strokes

Check the code sample for the ApiStroke/GetFill method (Spreadsheet API):

// Creates a shape with a colored border and retrieves its fill properties.
let worksheet = Api.GetActiveSheet();
let fill = Api.CreateSolidFill(Api.CreateRGBColor(255, 200, 100));
let stroke = Api.CreateStroke(2 * 36000, Api.CreateSolidFill(Api.CreateRGBColor(0, 0, 255)));
let shape = worksheet.AddShape("rect", 60 * 36000, 40 * 36000, fill, stroke, 3, 0, 2, 2);
let strokeObj = shape.GetLine();
if (strokeObj) {
    let strokeFill = strokeObj.GetFill();
    if (strokeFill) {
        worksheet.GetRange("A1").SetValue("Stroke fill type: " + strokeFill.GetType());
    }
}

Advanced chart and table methods

Working with charts and tables is now more flexible. New ApiChart and ApiTable methods provide greater programmatic control over their creation and modification, allowing you to build more dynamic and data-rich documents.

Other notable JavaScript API additions

  • Filter and validation: New methods for AutofilterFilter, and Validation have been introduced to better manage data in spreadsheets.
  • Footnotes and endnotes: Programmatically add and manage footnotes and endnotes in your documents.
  • Hyperlinks and transitions: Gain more control over hyperlinks and presentation slide transitions.

Check the full list of new methods

Plugins and macros API improvements

The API for plugins and macros also sees important updates in version 9.3. These enhancements are designed to give developers more options to extend the functionality of the ONLYOFFICE editors. You can now create even more powerful and integrated plugins, automate complex workflows with macros, and deliver custom features tailored to specific user needs.

For example, the IsFormSigned method checks whether the specified form has been digitally signed:

window.Asc.plugin.executeMethod ("IsFormSigned", [], function(isSigned) {    
console.log ("Form is signed: " + isSigned);
});

The newly introduced API for macros in the PDF Editor enables you to add, delete, and edit pages, forms, annotations, autoshapes, tables, images, and charts. For instance, here’s the SetMacros method within the window.Asc.plugin.executeMethod for the PDF API:

window.Asc.plugin.executeMethod ("SetMacros", [JSON.stringify (Content)], function () {    
window.Asc.plugin.executeCommand ("close", "");
});

Check the full changelog for the Plugins and Macros API

Create your free ONLYOFFICE account

View, edit and collaborate on docs, sheets, slides, forms, and PDF files online.