View in Vue DOCX Editor
28 Aug 20265 minutes to read
Web layout
Vue DOCX Editor (Document Editor) Container component allows you to change the view to a web layout or print layout using the layoutType property with the supported LayoutType.
<ejs-documenteditor :layoutType='Continuous' id='container'></ejs-documenteditor>
The default value of
layoutTypein the Document Editor Container component isPages.
Online demo
Explore how to view Word documents in web layout using the Vue DOCX Editor in this live demo.
Ruler
The ruler helps you set specific margins, tab stops, and indentations within a document to ensure consistent formatting in the DOCX Editor.
The following example illustrates how to enable the ruler in the DOCX Editor.
<template>
<div id="app">
<button id='container_ruler_button' v-on:click="onClick">Show/Hide Ruler</button>
<ejs-documenteditor id="container" height="370px" style="width: 100%" ref="container" :serviceUrl='serviceUrl'
:isReadOnly='false' :enablePrint='true' :enableSfdtExport='true' :enableSelection='true' :enableContextMenu='true'
:enableSearch='true' :enableOptionsPane='true' :enableWordExport='true' :enableTextExport='true'
:enableEditor='true' :enableImageResizer='true' :enableEditorHistory='true' :enableHyperlinkDialog='true'
:enableTableDialog='true' :enableBookmarkDialog='true' :enableTableOfContentsDialog='true'
:enablePageSetupDialog='true' :enableStyleDialog='true' :enableListDialog='true' :enableParagraphDialog='true'
:enableFontDialog='true' :enableTablePropertiesDialog='true' :enableBordersAndShadingDialog='true'
:enableTableOptionsDialog='true' :documentEditorSettings='documentEditorSettings'></ejs-documenteditor>
</div>
</template>
<script>
import { DocumentEditorComponent, Print, SfdtExport, WordExport, TextExport, Selection, Search, Editor, ImageResizer, EditorHistory, ContextMenu, OptionsPane, HyperlinkDialog, TableDialog, BookmarkDialog, TableOfContentsDialog, PageSetupDialog, StyleDialog, ListDialog, ParagraphDialog, BulletsAndNumberingDialog, FontDialog, TablePropertiesDialog, BordersAndShadingDialog, TableOptionsDialog, CellOptionsDialog, StylesDialog } from '@syncfusion/ej2-vue-documenteditor';
export default {
name: "App",
components: {
"ejs-documenteditor": DocumentEditorComponent
},
data() {
return {
serviceUrl: 'https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/',
height: '370px',
isReadOnly: false,
documentEditorSettings: { showRuler: true }
}
},
provide: {
//Inject require modules.
DocumentEditor: [Print, SfdtExport, WordExport, TextExport, Selection, Search, Editor, ImageResizer, EditorHistory, ContextMenu, OptionsPane, HyperlinkDialog, TableDialog, BookmarkDialog, TableOfContentsDialog, PageSetupDialog, StyleDialog, ListDialog, ParagraphDialog, BulletsAndNumberingDialog, FontDialog, TablePropertiesDialog, BordersAndShadingDialog, TableOptionsDialog, CellOptionsDialog, StylesDialog]
},
methods: {
onClick: function () {
this.$refs.container.ej2Instances.documentEditorSettings.showRuler = !this.$refs.container.ej2Instances.documentEditorSettings.showRuler
}
},
mounted: function () {
this.$refs.container.ej2Instances.documentEditorSettings.showRuler = true;
}
}
</script>
<style>
@import '../node_modules/@syncfusion/ej2-base/styles/material.css';
@import '../node_modules/@syncfusion/ej2-buttons/styles/material.css';
@import '../node_modules/@syncfusion/ej2-inputs/styles/material.css';
@import '../node_modules/@syncfusion/ej2-popups/styles/material.css';
@import '../node_modules/@syncfusion/ej2-lists/styles/material.css';
@import '../node_modules/@syncfusion/ej2-navigations/styles/material.css';
@import '../node_modules/@syncfusion/ej2-splitbuttons/styles/material.css';
@import '../node_modules/@syncfusion/ej2-dropdowns/styles/material.css';
@import "../node_modules/@syncfusion/ej2-vue-documenteditor/styles/material.css";
</style>The Web API hosted link
https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/utilized in the DOCX Editor’s serviceUrl property is intended solely for demonstration and evaluation purposes. For production deployment, please host your own web service with your required server configurations. You can refer and reuse the GitHub Web Service example or Docker image for hosting your own web service and use for the serviceUrl property.
Online demo
Explore how to use the ruler in the Vue DOCX Editor for working with Word documents in this live demo.
Heading navigation pane
The heading navigation pane allows users to quickly navigate documents by heading, making it easier to move through the document.
The following example demonstrates how to enable the heading navigation pane in a DOCX Editor.
<template>
<div id="app">
<ejs-documenteditorcontainer ref='documenteditor' :serviceUrl='serviceUrl' :documentEditorSettings='settings' height="590px" id='container' :enableToolbar='true'></ejs-documenteditorcontainer>
</div>
</template>
<script>
import Vue from 'vue';
import { DocumentEditorContainerPlugin, DocumentEditorContainerComponent,Toolbar} from '@syncfusion/ej2-vue-documenteditor';
Vue.use(DocumentEditorContainerPlugin);
export default {
data() {
return { serviceUrl:'https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/',
settings:{ showNavigationPane : true} };
},
provide: {
//Inject require modules.
DocumentEditorContainer: [Toolbar]
}
}
</script>
The Web API hosted link
https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/utilized in the DOCX Editor’s serviceUrl property is intended solely for demonstration and evaluation purposes. For production deployment, please host your own web service with your required server configurations. You can refer and reuse the GitHub Web Service example or Docker image for hosting your own web service and use for the serviceUrl property.
Online demo
Explore how to navigate through headings in Word documents using the Vue DOCX Editor in this live demo.