ONLYOFFICE Docs 7.1 for developers: API updates
Along with the release of the new features, we updated API for the editors, plugins, and Document Builder. Check the details below.
Adjusting document saving for WOPI operations
The new request headers are available for the PutFile to distinguish between three types of file saving:
- X-LOOL-WOPI-IsModifiedByUser indicates whether a user has modified the document before saving, or if they just pressed the Save button without any modification.
- X-LOOL-WOPI-IsAutosave indicates whether the PutFile is triggered by autosave or any user operation such as hitting the Save button or menu entry.
- X-LOOL-WOPI-IsExitSave indicates whether autosave will be triggered when the document gets cleaned up from memory, e.g. when all users disconnect, or not.
Updated conversion and new formats
You can now define the document layout which specifies parameters for printing forms as PDF documents or images. Learn more
Another parameter allows defining the document renderer when converting a file from PDF, XPS, and OXPS. Learn more
Besides, we added new conversion options:
- from PDF to DOCX,
- from XPS and OXPS to DOCX,
- from XLSB format (along with opening of XLSB files).
Defining user groups for info display
With the document.permissions.userInfoGroups parameter, you are able to specify the groups of users whose information is shown in the editors, including:
- user names in the list of the currently editing users in the header,
- user cursors and tooltips with their names when typing text,
- user names when locking objects in the strict co-editing mode.
"permissions": {
...
"userInfoGroups": ["Group1", ""]
... },
Here, the [“Group1”, “”] means that the information about users from the Group 1 and users who don’t belong to any group is displayed.
Spellchecker settings
Starting from version 7.1, we added the editorConfig.customization.features parameter section, which allows setting up the parameters that users can disable or customize if possible, including spellchecker.
The editorConfig.customization.spellcheck field is now deprecated and you should use the editorConfig.customization.features.spellcheck field instead to define if the spellchecker is automatically switched on or off when the document or presentation editor is loaded.
"features": {
"spellcheck": {
"mode": true,
}
Other changes
- The parameter list in the initialization config signature is now strictly regulated.
- The editorConfig.customization.chat parameter is deprecated — use the document.permissions.chat parameter instead.
- The services.CoAuthoring.token.inbox.inBody and services.CoAuthoring.token.outbox.inBody parameters for enabling token in body are deprecated.
Get the latest version of ONLYOFFICE Docs Developer Edition:
API updates for plugins
- Access to the window and document objects as well as the alert function is restricted from the plugin command code and macros. Learn more
- New methods for plugins with OLE object: GetAllOleObjects, RemoveOleObject, RemoveOleObjects, and SelectOleObject.
API updates for Document Builder
The DocBuilder API was considerably enhanced. Along with generating DOCX, XLSX, PPTX, and PDF files, you can now work with fillable forms, e.g.:
builder.CreateFile("docxf");
ONLYOFFICE Document Builder
var oDocument = Api.GetDocument();
text document contents
var oTextForm = Api.CreateTextForm();
var oParagraph = oDocument.GetElement(0);
oParagraph.AddElement(oTextForm);
oTextForm.SetText("John Smith");
builder.SaveFile("docxf", "example.docxf");
format with the 'example.docxf' name
builder.CloseFile();
ONLYOFFICE Document Builder
In addition to the new form methods, we also added more methods for working with:
- cross-references,
- reviewing,
- table background,
- spreadsheet areas and ranges,
- presentations (including layout, placeholders, themes, drawing, slides, etc.).