Froala, Inc
Froala Documentation
- Installation Guides
- Browser Support
- Languages Support
- Shortcuts
- Activation
- Examples
- Customize the Editor
- Use-cases
- Plugins
- APIs
- Development Frameworks
- Server Integrations
- Server SDKs
- Migration Guides
- Changelog
- Tutorials
- Froala Docs
- /
- Plugins
- /
- Export to Word Plugin
Export to Word Plugin
Plugins are fully functional during your trial once you've added your trial key to the setup.
The Export to Word plugin enables users to export the editor’s content directly into a Microsoft Word (.docx) file. This feature is especially useful for scenarios where content needs to be shared, printed, or archived in a widely accepted document format.
Plugin options:
| wordExportFileName String |
Specifies the name of the file to be exported. The plugin automatically handles the file extension, so only the base name needs to be provided.
Default: 'NameOfTheFile' |
Plugin events:
| word.beforeExport (editorHtml) | This event is triggered just before the export process begins. The editor’s HTML content is passed to the callback, allowing you to modify or inspect it before export.
● editorHtml - The HTML content of the editor prior to export. |
| word.afterExport (editorHtml) | This event is triggered after the export process is completed. The exported HTML content of the editor is available through the callback.
● editorHtml - The HTML content of the editor at the time of export. |
Dependence
For the plugin to work properly, you need to include the file-saver and html-docx libraries in your project.
- If you're working in a browser environment, you can include them via CDN.
- For Node.js or bundler environments, you can install them via npm
<script src="https://cdn.jsdelivr.net/npm/file-saver-es@2.0.5/dist/FileSaver.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/html-docx-js@0.3.1/dist/html-docx.min.js"></script>
Add Plugin to your code:
Plugin name: exportToWord
Plugin JS Script: ../js/plugins/export_to_word.min.js
Or from CDN https://cdn.jsdelivr.net/npm/froala-editor@latest/js/plugins/export_to_word.min.js
Plugin CSS link: _
