Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ If document loading fails and you see a 404 error in the browser console, the [V

The 404 error may occur due to the following reasons:

- **The Web Service is not running or inactive** – When hosting your own Web API, the server may be stopped or not deployed correctly, causing required endpoints such as `/Import` or `/SpellCheck` to return 404.
- **The configured `serviceUrl` is invalid** – Issues like a missing trailing slash (`/`), wrong port number, incorrect API route, or typos will cause the editor to call incorrect endpoints.
- **The application is using an old or discontinued Document Editor service URL** – When using an old Document Editor service URL which no longer valid.
- **The Web Service is not running or inactive** – When hosting your own Web Service, the server may be stopped, not deployed correctly, or configured such that required endpoints (e.g., `/Import`, `/SpellCheck`) return 404.
- **The configured `serviceUrl` is invalid** – A missing trailing slash (`/`), wrong port, incorrect API route, or typos cause the editor to call invalid endpoints.
- **The application is using an old or discontinued Document Editor service URL** – When using an old Document Editor service URL that is no longer valid.

## Solutions

Expand All @@ -28,6 +28,6 @@ The 404 error may occur due to the following reasons:
container.serviceUrl = 'https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/';
```

> Note: The hosted Web API link is provided for demonstration and evaluation only. For production deployment, please host your own web service with your required server configurations. You can refer and reuse the [GitHub Web Service example](https://github.com/SyncfusionExamples/EJ2-DocumentEditor-WebServices) or [Docker image](https://hub.docker.com/r/syncfusion/word-processor-server) for hosting your own web service and use for the serviceUrl property.
N> The hosted Web Service link is provided for demonstration and evaluation only. For production deployment, please host your own Web Service with your required server configurations. You can refer and reuse the [GitHub Web Service example](https://github.com/SyncfusionExamples/EJ2-DocumentEditor-WebServices) or [Docker image](https://hub.docker.com/r/syncfusion/word-processor-server) for hosting your own Web Service and use it for the serviceUrl property.

- If you are using your own hosted Web API, ensure that the Web Service is running, active, and the configured service URL is valid.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ domainurl: ##DomainURL##

# Web services in Vue Document editor component

You can deploy web APIs for server-side dependencies of [Vue DOCX Editor](https://www.syncfusion.com/docx-editor-sdk/vue-docx-editor) (Document Editor) component in the following platforms.
You can deploy web APIs for the server-side dependencies of [Vue DOCX Editor](https://www.syncfusion.com/docx-editor-sdk/vue-docx-editor) (Document Editor) component on the following platforms.

* [ASP.NET Core](./web-services/core)
* [ASP.NET MVC](./web-services/mvc)
Expand All @@ -24,12 +24,12 @@ You can deploy web APIs for server-side dependencies of [Vue DOCX Editor](https:
|[Paste with formatting](./clipboard#paste-with-formatting)|When pasting the formatted content (HTML/RTF) received from system clipboard. For converting HTML/RTF to SFDT format.<br><br> **Note**: Whereas plain text received from system clipboard will be pasted directly in the client-side.|**Client**: Sends the input Html or Rtf string. <br>**Server**: Receives the input Html or Rtf string and sends the converted SFDT back to the client.|
|[Restrict editing](./restrict-editing)|When protecting the document, for generating hash.|**Client**: Sends the input data for hashing algorithm.<br> **Server**: Receives the input data for hashing algorithm and sends the result hash information back to the client.|
|[Spellcheck](./spell-check)(default)|When the spellchecker is enabled on client-side Document Editor, and it performs the spell check validation for words in the document.|**Client**: Sends the words (string) with their language for spelling validation.<br> **Server**: Receives the words (string) with their language for spelling validation and sends the validation result as JSON back to the client.|
|[SpellCheckByPage](./spell-check)|Document editor provides options to spellcheck page by page when loading the documents. By [enabling optimized spell check](./spell-check#enableoptimizedspellcheck) in client-side, you can perform spellcheck page by page when loading the documents.|**Client**: Sends the words (string) with their language for spelling validation.<br> **Server**: Receives the words (string) with their language for spelling validation and sends the validation result as JSON back to the client.|
|[SpellCheckByPage](./spell-check)|Document Editor provides options to spellcheck page by page when loading the documents. By [enabling optimized spell check](./spell-check#enableoptimizedspellcheck) in client-side, you can perform spellcheck page by page when loading the documents.|**Client**: Sends the words (string) with their language for spelling validation.<br> **Server**: Receives the words (string) with their language for spelling validation and sends the validation result as JSON back to the client.|
|[Save as file formats other than SFDT and DOCX](./saving-documents/server-side-export) (optional API)|You can configure this API, if you want to save the document in file format other than DOCX and SFDT.<br><br> For saving the files as WordML, DOC, RTF, HTML, ODT, Text using Word library (DocIO) and PDF using Word (DocIO) and PDF libraries.|You can transfer document from client to server either as SFDT or DOCX format.<br><br>First option (SFDT):<br>**Client**: Sends the SFDT.<br>**Server**: Receives the SFDT and saves the converted document as any file format supported by [Word library (DocIO)](https://www.syncfusion.com/word-framework/net/word-library) in server or sends the saved file to the client browser.<br><br>Second option (DOCX):<br>**Client**: Sends the DOCX file.<br>**Server**: Receives the DOCX file and saves the converted document as any file format supported by [Word library (DocIO)](https://www.syncfusion.com/word-framework/net/word-library) in server or sends the saved file to the client browser.|

>Note: If you don't require the above functionalities then you can deploy as pure client-side component without any server-side interactions.
N> If you don't require the above functionalities, you can deploy the component as a pure client-side solution without any server-side interactions.

Please refer the [example from GitHub](https://github.com/SyncfusionExamples/EJ2-DocumentEditor-WebServices) to configure the web service and set the [serviceUrl](https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/).
Please refer to the [example from GitHub](https://github.com/SyncfusionExamples/EJ2-DocumentEditor-WebServices) to configure the web service and set the [serviceUrl](https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/).

If your running web service Url is `http://localhost:62869/`, set the serviceUrl like below:

Expand All @@ -39,7 +39,7 @@ this.$refs.container.serviceUrl = "http://localhost:62869/api/documenteditor/";

## Required Web API structure

Please check below table for expected web API structure.
Please check the table below for the expected web API structure.

|Expected method name |Parameters |Return type |
|-----|----|----|
Expand All @@ -54,7 +54,7 @@ Please check below table for expected web API structure.

## Customize the expected method name

Document editor component provides an option to customize the expected method name for Import, SystemClipboard, RestrictEditing and SpellCheck using [serverActionSettings](https://ej2.syncfusion.com/vue/documentation/api/document-editor-container/documentEditorContainerModel#serveractionsettings).
Document Editor component provides an option to customize the expected method name for Import, SystemClipboard, RestrictEditing and SpellCheck using [serverActionSettings](https://ej2.syncfusion.com/vue/documentation/api/document-editor-container/documentEditorContainerModel#serveractionsettings).

The following example code illustrates how to customize the method name using serverActionSettings.

Expand Down Expand Up @@ -114,9 +114,9 @@ export default {

> The Web API hosted link `https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/` utilized in the Document 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](https://github.com/SyncfusionExamples/EJ2-DocumentEditor-WebServices) or [Docker image](https://hub.docker.com/r/syncfusion/word-processor-server) for hosting your own web service and use for the serviceUrl property.

## Add the custom headers to XMLHttpRequest
## Add custom headers to XMLHttpRequest

Document editor component provides an an option to add custom headers of XMLHttpRequest using the [`headers`](https://ej2.syncfusion.com/vue/documentation/api/document-editor-container/documentEditorContainerModel#headers).
Document Editor component provides an option to add custom headers to the XMLHttpRequest using the [`headers`](https://ej2.syncfusion.com/vue/documentation/api/document-editor-container/documentEditorContainerModel#headers).

{% tabs %}
{% highlight html tabtitle="Composition API (~/src/App.vue)" %}
Expand Down Expand Up @@ -175,9 +175,9 @@ export default {

> The Web API hosted link `https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/` utilized in the Document 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](https://github.com/SyncfusionExamples/EJ2-DocumentEditor-WebServices) or [Docker image](https://hub.docker.com/r/syncfusion/word-processor-server) for hosting your own web service and use for the serviceUrl property.

## Modify the XMLHttpRequest before request send
## Modify the XMLHttpRequest before sending the request

Document editor component provides an option to modify the XMLHttpRequest object (setting additional headers, if needed) using [`beforeXmlHttpRequestSend`](https://ej2.syncfusion.com/vue/documentation/api/document-editor-container#beforexmlhttprequestsend) event and it gets triggered before a server request.
Document Editor component provides an option to modify the XMLHttpRequest object (setting additional headers, if needed) using the [`beforeXmlHttpRequestSend`](https://ej2.syncfusion.com/vue/documentation/api/document-editor-container#beforexmlhttprequestsend) event, which gets triggered before a server request.

You can customize the required [`XMLHttpRequest`](https://ej2.syncfusion.com/vue/documentation/api/document-editor/xmlHttpRequestEventArgs) properties.

Expand All @@ -204,7 +204,7 @@ provide('DocumentEditorContainer', [Toolbar]);
onMounted(function () {
//Here, modifying the request headers
container.value.headers = [{ syncfusion: 'true' }];
// Below action, cancel all server-side interactions expect spell check
// Below action, cancel all server-side interactions except spell check
container.value.beforeXmlHttpRequestSend = (
args) => {
args.headers = container.value.headers;
Expand Down Expand Up @@ -242,7 +242,7 @@ onMounted(function () {
DocumentEditorContainer: [Toolbar]
},
mounted(){
// Below action, cancel all server-side interactions expect spell check
// Below action, cancel all server-side interactions except spell check
this.$refs.container.beforeXmlHttpRequestSend = (
args ) => {
//Here, modifying the request headers
Expand All @@ -265,4 +265,4 @@ onMounted(function () {

> The Web API hosted link `https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/` utilized in the Document 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](https://github.com/SyncfusionExamples/EJ2-DocumentEditor-WebServices) or [Docker image](https://hub.docker.com/r/syncfusion/word-processor-server) for hosting your own web service and use for the serviceUrl property.

Note: Find the customizable serverActionType values are `'Import' | 'RestrictEditing' | 'SpellCheck' | 'SystemClipboard'`.
N> The customizable serverActionType values are `'Import' | 'RestrictEditing' | 'SpellCheck' | 'SystemClipboard'`.
Loading