Presentation API
The Presentation API lists the methods and events a plugin can use when working with a presentation in ONLYOFFICE Docs. To work with the presentation content directly, such as slides and shapes, run Office API code in callCommand. See Presentation API.
Methods
The following table lists the available methods.
| Method | Returns | Description |
|---|---|---|
| AddComment | string | null | Adds a comment to the presentation. |
| AddOleObject | None | Adds an OLE object to the current document position. |
| AnnotateParagraph | None | Adds annotations to the specified paragraph. |
| ApplyTheme | boolean | Applies a theme to the presentation by index or name. |
| ChangeComment | boolean | Changes the specified comment. |
| CoAuthoringChatSendMessage | None | Sends a message to the co-authoring chat. |
| EditOleObject | None | Edits an OLE object in the document. |
| EndAction | None | Specifies the end action for long operations. |
| EndSlideShow | None | Ends the current slide show. |
| FocusEditor | None | Returns focus to the editor. |
| GetAllComments | comment[] | Returns all the comments from the document. |
| GetDocumentLang | string | Returns the document language. |
| GetEditorThemes | object[] | Returns the list of available editor themes. |
| GetFileToDownload | string | Returns the current file to download in the specified format. |
| GetFontList | FontInfo[] | Returns the fonts list. |
| GetImageDataFromSelection | ImageData | null | undefined | Returns the image data from the first of the selected drawings. |
| GetInstalledPlugins | PluginData[] | Returns all the installed plugins. |
| GetMacros | Macros | Returns the document macros. |
| GetRestrictions | EditorRestrictions | Returns the restrictions the editor currently applies to the document. |
| GetSelectedContent | string | Returns the selected content in the specified format. |
| GetSelectedOleObjects | OLEProperties[] | Returns an array of the selected OLE objects. |
| GetSelectedText | string | Returns the selected text from the document. |
| GetSelectionType | SelectionType | Returns the type of the current selection. |
| GetVBAMacros | string | null | Returns all VBA macros from the document. |
| GetVersion | string | Returns the editor version. |
| GoToNextSlideInSlideShow | None | Displays the slide following the current slide in the slide show. |
| GoToPreviousSlideInSlideShow | None | Displays the slide following the current slide in the slide show. |
| GoToSlide | None | Sets the active slide in the editor by its index. |
| GoToSlideInSlideShow | None | Displays the slide with the specific index. |
| InputText | None | Inserts text into the document. |
| InsertPresentationFromUrl | number | Inserts slides from an external presentation referenced by URL into the current presentation. |
| InstallPlugin | object | Installs a plugin using the specified plugin config. |
| MouseMoveWindow | None | Sends an event to the plugin when the mouse button is moved inside the plugin iframe. |
| MouseUpWindow | None | Sends an event to the plugin when the mouse button is released inside the plugin iframe. |
| OnDropEvent | None | Implements the external drag&drop emulation. |
| OnEncryption | None | Encrypts the document. |
| PasteHtml | None | Pastes text in the HTML format into the document. |
| PasteText | None | Pastes text into the document. |
| PauseSlideShow | None | Pauses the current slide show. |
| PutImageDataToSelection | None | Replaces the first selected drawing with the image specified in the parameters. |
| RemoveAnnotationRange | None | Removes a specific annotation range from the presentation. |
| RemoveComments | None | Removes the specified comments. |
| RemoveOleObject | None | Removes the OLE object from the presentation by its internal ID. |
| RemovePlugin | object | Removes a plugin with the specified GUID. |
| ReplaceTextSmart | boolean | Replaces each paragraph (or text in cell) in the select with the corresponding text from an array of strings. |
| ResumeSlideShow | None | Resumes the current slide show. |
| SelectAnnotationRange | None | Selects text in a presentation using a given annotation. |
| SetButtonDisabled | None | Enables or disables the modal plugin footer button by index. |
| SetMacros | None | Sets macros to the document. |
| SetParagraphHtml | boolean | Replaces all content of the specified paragraph with the content parsed from the given HTML string. Slide number and date fields and equations of the paragraph are kept as they are. |
| SetParagraphRangeHtml | boolean | Replaces a part of the specified paragraph with the content parsed from the given HTML string. Slide number and date fields and equations of the paragraph are kept as they are. |
| SetPluginsOptions | None | Configures plugins from an external source. |
| SetProperties | None | Sets the properties to the document. |
| ShowButton | None | Shows or hides buttons in the header. |
| ShowError | None | Shows an error/warning message. |
| ShowInputHelper | None | Shows the input helper. |
| StartAction | None | Specifies the start action for long operations. |
| StartSlideShow | None | Starts the presentation slide show. |
| UnShowInputHelper | None | Unshows the input helper. |
| UpdatePlugin | object | Updates a plugin using the specified plugin config. |
Events
The following table lists the available events.
| Event | Description |
|---|---|
| onChangeCurrentSlide | The function called when the current slide has changed. |
| onChangeRestrictions | The function called when the restrictions in the editor are changed. |
| onClick | The function called when the user clicks the element. |
| onDocumentContentReady | The function called when the document is completely loaded. |
| onEnableMouseEvent | The function called to turn the mouse or touchpad events on/off. |
| onExternalMouseUp | The function called when the mouse button is released outside the plugin iframe. |
| onFloatActionButtonClick | The function called when the floating action button has been clicked. |
| onSlideShowBegin | The function called when a slide show presentation starts. |
| onSlideShowEnd | The function called when a slide show presentation ends. |
| onSlideShowNextSlide | The function called after a slide has been changed and displayed during a slide show presentation. Fires before the slide content is actually displayed. |
| onSlideShowSlideChanged | The function called when slide changes during a slide show presentation. Provides information about both the current and previous slide. |
| onTargetPositionChanged | The function called when the target position in the editor is changed. |