-
denyEditingRights - deny editing.
This method can be called when you want to make the document editing unavailable.
docEditor.denyEditingRights(message);
Parameter |
Description |
Type |
Presence |
message |
Defines the text messages for dialog. |
string |
optional |
-
destroyEditor - destroy docEditor object.
This method can be called when you want to reinit document editor with another configurations.
Used since version 4.3.
docEditor.destroyEditor();
-
downloadAs - download the edited file.
This method can be called only when the existence of the onDownloadAs events.
Document editing service asynchronously creates a document and triggers the onDownloadAs event with a link in parameter.
docEditor.downloadAs();
-
insertImage - insert an image into the file.
This method must be called after the onRequestInsertImage events.
docEditor.insertImage({
"c": "add",
"fileType": "png",
"url": "https://example.com/url-to-example-image.png"
});
Where the example.com is the name of the server where document manager and document storage service are installed.
See the How it works section to find out more on Document Server service client-server interactions.
Parameter |
Description |
Type |
Presence |
c |
Defines the type of image insertion from event.
Can be: add, change, fill, watermak, slide.
The default value is "add".
|
string |
required |
fileType |
Defines the type of image for insert into the file.
Can be: bmp, gif, jpeg, jpg, png.
|
string |
required |
token |
Defines the encrypted signature added to the parameter in the form of a token. |
string |
optional |
url |
Defines the absolute URL where the source image is stored. |
string |
required |
-
refreshHistory - show the document version history.
This method must be called after the onRequestHistory events.
docEditor.refreshHistory({
"currentVersion": 2,
"history": [
{
"created": "2010-07-06 10:13 AM",
"key": "af86C7e71Ca8",
"user": {
"id": "F89d8069ba2b",
"name": "Kate Cage"
},
"version": 1
},
{
"created": "2010-07-07 3:46 PM",
"key": "Khirz6zTPdfd7",
"user": {
"id": "78e1e841",
"name": "John Smith"
},
"version": 2
},
...
],
});
If after editing and saving the document the history with object changes and serverVersion is returned, send the object changes in the changes and serverVersion in the serverVersion parameter.
docEditor.refreshHistory({
"currentVersion": 2,
"history": [
{
"changes": changes,
"created": "2010-07-06 10:13 AM",
"key": "af86C7e71Ca8",
"serverVersion": serverVersion,
"user": {
"id": "F89d8069ba2b",
"name": "Kate Cage"
},
"version": 1
},
{
"changes": changes,
"created": "2010-07-07 3:46 PM",
"key": "Khirz6zTPdfd7",
"serverVersion": serverVersion,
"user": {
"id": "78e1e841",
"name": "John Smith"
},
"version": 2
},
...
],
});
Where the changes is the changes from the history object returned after saving the document.
Where the serverVersion is the serverVersion from the history object returned after saving the document.
Show the error message explaining why the version history can not be displayed.
docEditor.refreshHistory({
"error": "Exception",
});
Parameter |
Description |
Type |
Presence |
currentVersion |
Defines the current document version number. |
integer |
required |
error |
Defines the error message text. |
string |
optional |
history |
Defines the array with the document versions. |
array |
required |
history.changes |
Defines the changes from the history object returned after saving the document. |
object |
optional |
history.created |
Defines the document version creation date. |
string |
required |
history.key |
Defines the unique document identifier used by the service to recognize the document. |
string |
required |
history.user |
Defines the user who is the author of the document version. |
object |
optional |
history.user.id |
Defines the identifier of the user who is the author of the document version. |
string |
optional |
history.user.name |
Defines the name of the user who is the author of the document version. |
string |
optional |
history.version |
Defines the document version number. |
integer |
required |
-
setActionLink - set the link to the document which contains a bookmark.
This method must be called after the onMakeActionLink event.
The software integrator must process the ACTION_DATA received from the document editing service to set the link.
The link is created by the software integrators who use ONLYOFFICE Document Server in their document manager.
docEditor.setActionLink(link);
Parameter |
Description |
Type |
Presence |
link |
Defines the link which allows scrolling to the bookmark position in the document. |
string |
required |
-
setHistoryData - send the link to the document for viewing the version history.
This method must be called after the onRequestHistoryData events.
docEditor.setHistoryData({
"key": "Khirz6zTPdfd7",
"url": "https://example.com/url-to-example-document.docx",
"version": 2
});
Where the example.com is the name of the server where document manager and document storage service are installed.
See the How it works section to find out more on Document Server service client-server interactions.
If after editing and saving the document the changesurl link to the file with changes data is returned, download the file by this link and send the file URL in the changesUrl parameter.
The absolute URL address of the document previous version must be sent in the previous.url parameter.
docEditor.setHistoryData({
"changesUrl": "https://example.com/url-to-changes.zip",
"key": "Khirz6zTPdfd7",
"previous": {
"key": "af86C7e71Ca8",
"url": "https://example.com/url-to-the-previous-version-of-the-document.docx"
},
"url": "https://example.com/url-to-example-document.docx",
"version": 2
});
Where the example.com is the name of the server where document manager and document storage service are installed.
See the How it works section to find out more on Document Server service client-server interactions.
Send the error message explaining why the document version can not be displayed.
docEditor.setHistoryData({
"error": "Exception",
"version": 2
});
Parameter |
Description |
Type |
Presence |
changesUrl |
Defines the url address of the file with the document changes data, which can be downloaded by the changesurl link from the JSON object returned after saving the document.
The request for file is sent out directly from the browser.
|
string |
optional |
error |
Defines the error message text. |
string |
optional |
key |
Defines the document identifier used to unambiguously identify the document file. |
string |
required |
previous |
Defines the object of the previous version of the document if changesUrl address was returned after saving the document. |
object |
optional |
previous.key |
Defines the document identifier of the previous version of the document. |
string |
required |
previous.url |
Defines the url address of the previous version of the document. |
string |
required |
token |
Defines the encrypted signature added to the parameter in the form of a token. |
string |
optional |
url |
Defines the url address of the current version of the document.
Can be downloaded by the url link from the JSON object returned after saving the document.
|
string |
required |
version |
Defines the document version number. |
integer |
required |
-
setMailMergeRecipients - insert recipient data for mail merge into the file.
This method must be called after the onRequestMailMergeRecipients events.
docEditor.setMailMergeRecipients({
"fileType": "xlsx",
"url": "https://example.com/url-to-example-recipients.xlsx"
});
Where the example.com is the name of the server where document manager and document storage service are installed.
See the How it works section to find out more on Document Server service client-server interactions.
Parameter |
Description |
Type |
Presence |
fileType |
Defines the type of spreadsheet for mail merge in the file.
Can be: xlsx.
|
string |
required |
token |
Defines the encrypted signature added to the parameter in the form of a token. |
string |
optional |
url |
Defines the absolute URL where the source data is stored. |
string |
required |
-
setRevisedFile - select a document for comparing. This method must be called after the onRequestCompareFile events.
docEditor.setRevisedFile({
"fileType": "docx",
"url": "https://example.com/url-to-example-document.docx"
});
Where the example.com is the name of the server where document manager and document storage service are installed.
See the How it works section to find out more on Document Server service client-server interactions.
Parameter |
Description |
Type |
Presence |
fileType |
Defines the type of document for comparing. |
string |
required |
token |
Defines the encrypted signature added to the parameter in the form of a token. |
string |
optional |
url |
Defines the absolute URL where the source document is stored. |
string |
required |
-
setSharingSettings - update the information about the settings which allow to share the document with other users.
This method can be called after the onRequestSharingSettings events.
docEditor.setSharingSettings({
"sharingSettings": [
{
"permissions": "Full Access",
"user": "John Smith"
},
{
"isLink": true,
"permissions": "Read Only",
"user": "External link"
}
]
});
Parameter |
Description |
Type |
Presence |
sharingSettings |
Defines the settings which allow sharing the document with other users. |
array of object |
optional |
sharingSettings.permissions |
Defines the access rights for the user with the name above. |
string |
optional |
sharingSettings.user |
Defines the name of the user with whom the document will be shared. |
string |
optional |
-
setUsers - set a list of users to mention in the comments.
This method must be called after the onRequestUsers events.
docEditor.setUsers({
"users": [
{
"email": "john@example.com",
"name": "John Smith"
},
{
"email": "kate@example.com",
"name": "Kate Cage"
},
...
]
});
Where the example.com is the name of the server where document manager and document storage service are installed.
See the How it works section to find out more on Document Server service client-server interactions.
Parameter |
Description |
Type |
Presence |
users |
Defines the list of the users. |
array of strings |
optional |
users.email |
Defines the email address of the user. |
string |
required |
users.name |
Defines the full name of the user. |
string |
required |
-
showMessage - display tooltip with the message.
This method can be called only after the onAppReady events.
docEditor.showMessage(message);
Parameter |
Description |
Type |
Presence |
message |
Defines the message text. |
string |
required |