diff --git a/Document-Processing/Word/Word-Processor/javascript-es5/troubleshooting/document-loading-issue-with-404-error.md b/Document-Processing/Word/Word-Processor/javascript-es5/troubleshooting/document-loading-issue-with-404-error.md index 001fc8a2c0..c3dbca000a 100644 --- a/Document-Processing/Word/Word-Processor/javascript-es5/troubleshooting/document-loading-issue-with-404-error.md +++ b/Document-Processing/Word/Word-Processor/javascript-es5/troubleshooting/document-loading-issue-with-404-error.md @@ -14,11 +14,11 @@ If document loading fails and you see a 404 error in the browser console, the [J ## Reasons -The 404 error may occur due to the following reasons: +The 404 error may occur due to the following: -- **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 Web Service is not running or inactive** – When hosting your own Web API, the server may be stopped or not deployed correctly, causing the 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 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 @@ -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 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 to 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. -- If you are using your own hosted Web API, ensure that the Web Service is running, active, and the configured service URL is valid. \ No newline at end of file +- If you are using your own hosted Web API, ensure that the Web Service is running and the configured service URL is valid. \ No newline at end of file diff --git a/Document-Processing/Word/Word-Processor/javascript-es5/unsupported-features.md b/Document-Processing/Word/Word-Processor/javascript-es5/unsupported-features.md index 5f1151c9ec..f1a63c3935 100644 --- a/Document-Processing/Word/Word-Processor/javascript-es5/unsupported-features.md +++ b/Document-Processing/Word/Word-Processor/javascript-es5/unsupported-features.md @@ -10,7 +10,7 @@ domainurl: ##DomainURL## # Unsupported Features in JavaScript (ES5) DOCX Editor -This section describes the unsupported elements in [JavaScript DOCX Editor](https://www.syncfusion.com/docx-editor-sdk/javascript-docx-editor) (Document Editor) +This section describes the unsupported features in [JavaScript DOCX Editor](https://www.syncfusion.com/docx-editor-sdk/javascript-docx-editor) (Document Editor). ## Document formatting @@ -28,7 +28,7 @@ This section describes the unsupported elements in [JavaScript DOCX Editor](http | | Number spacing | No | | | Number forms | No | | | Stylistic sets | No | -| | Contextual alternates| No | +| | Contextual alternates | No | | | Text Direction (Top to Bottom, Bottom to Top) | No | | | Border styles (*Except dotted and dashed; other styles are rendered as solid*) | Partial | | Section Formatting | Mirror margins | No | @@ -36,7 +36,7 @@ This section describes the unsupported elements in [JavaScript DOCX Editor](http | | Line numbers | No | | | Bi-direction | No | | Page background | Page background color or image | No | -| Watermark | Text and Picture watermark| No | +| Watermark | Text and Picture Watermark | No | | Table Format | Border styles (*Except dotted and dashed; other styles are rendered as solid*) | Partial | ## Word Document Elements @@ -50,8 +50,8 @@ This section describes the unsupported elements in [JavaScript DOCX Editor](http | Video or audio files | No | | Macros | No | | Models, Smart-Art, and Charts | [Supported Charts](https://help.syncfusion.com/document-processing/word/word-processor/javascript-es5/chart) | -| Shapes, Textboxes, and WordArt | [Supported shapes](https://help.syncfusion.com/document-processing/word/word-processor/javascript-es5/shapes) *(Shape Properties: Fill types, borders, rotation and effects are not supported) | +| Shapes, Textboxes, and WordArt | [Supported shapes](https://help.syncfusion.com/document-processing/word/word-processor/javascript-es5/shapes) *(Shape Properties: Fill types, borders, rotation, and effects are not supported)* | | Signature line | No | | Special Characters, Symbols, Equations | No | | Built-in and custom document properties | No | -| Comment reactions | No \ No newline at end of file +| Comment reactions | No | \ No newline at end of file diff --git a/Document-Processing/Word/Word-Processor/javascript-es5/view.md b/Document-Processing/Word/Word-Processor/javascript-es5/view.md index a6707fc104..5816b6e288 100644 --- a/Document-Processing/Word/Word-Processor/javascript-es5/view.md +++ b/Document-Processing/Word/Word-Processor/javascript-es5/view.md @@ -9,15 +9,15 @@ domainurl: ##DomainURL## --- # View in JavaScript (ES5) Document editor control -## Web layout +## Web Layout -[JavaScript DOCX Editor](https://www.syncfusion.com/docx-editor-sdk/javascript-docx-editor) (Document Editor) allows you to change the view to web layout and print using the [`layoutType`](https://ej2.syncfusion.com/javascript/documentation/api/document-editor#layouttype) property with the supported [`LayoutType`](https://ej2.syncfusion.com/javascript/documentation/api/document-editor/layoutType/). +[JavaScript DOCX Editor](https://www.syncfusion.com/docx-editor-sdk/javascript-docx-editor) (Document Editor) allows you to change the view to web layout and print layout using the [`layoutType`](https://ej2.syncfusion.com/javascript/documentation/api/document-editor#layouttype) property with the supported [`LayoutType`](https://ej2.syncfusion.com/javascript/documentation/api/document-editor/layoutType/). ```ts let docEdit: DocumentEditor = new DocumentEditor({ layoutType: 'Continuous'}); ``` ->Note: Default value of [`layoutType`](https://ej2.syncfusion.com/javascript/documentation/api/document-editor#layouttype) in DocumentEditor component is [`Pages`](https://ej2.syncfusion.com/javascript/documentation/api/document-editor/layoutType/). +N> The default value of [`layoutType`](https://ej2.syncfusion.com/javascript/documentation/api/document-editor#layouttype) in the DocumentEditor component is [`Pages`](https://ej2.syncfusion.com/javascript/documentation/api/document-editor/layoutType/). ### Online Demo @@ -25,9 +25,9 @@ Explore how to view Word documents in web layout using the JavaScript (ES5) Docu ## Ruler -Using ruler we can refer to setting specific margins, tab stops, or indentations within a document to ensure consistent formatting in Document Editor. +Use the ruler to set specific margins, tab stops, or indentations within a document to ensure consistent formatting in Document Editor. -The following example illustrates how to enable ruler in Document Editor +The following example illustrates how to enable the ruler in Document Editor. {% tabs %} {% highlight js tabtitle="index.js" %} @@ -48,20 +48,21 @@ Explore how to use the ruler in the JavaScript (ES5) Document Editor for working Using the heading navigation pane allows users to swiftly navigate documents by heading, enhancing their ability to move through the document efficiently. -The following example illustrates how to enable heading navigation pane in Document Editor +The following example illustrates how to enable the heading navigation pane in Document Editor. ```ts -let container: DocumentEditorContainer = new DocumentEditorContainer({ enableToolbar: true,height: '590px', -// Enable heading navigation pane in document editor +let container: DocumentEditorContainer = new DocumentEditorContainer({ enableToolbar: true, height: '590px', + // Enable the heading navigation pane in Document Editor. documentEditorSettings: { showNavigationPane: true, } }); -DocumentEditorContainer.Inject(Toolbar); +ej.documenteditor.DocumentEditorContainer.Inject(ej.documenteditor.Toolbar); container.serviceUrl = 'https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/'; container.appendTo('#container'); ``` -> 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. + +N> 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 to 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. ### Online Demo diff --git a/Document-Processing/Word/Word-Processor/javascript-es5/web-services-overview.md b/Document-Processing/Word/Word-Processor/javascript-es5/web-services-overview.md index fbd26514c1..9624703554 100644 --- a/Document-Processing/Word/Word-Processor/javascript-es5/web-services-overview.md +++ b/Document-Processing/Word/Word-Processor/javascript-es5/web-services-overview.md @@ -18,20 +18,20 @@ You can deploy web APIs for server-side dependencies of [JavaScript DOCX Editor] ## Which operations require server-side interaction -|Operations|When client-server communication will be triggered?|What type of data will be transferred between client and server?| +| Operations | When client-server communication is triggered | What type of data will be transferred between client and server? | |------------|--------------------------------------|------------------------| |[Open file formats other than SFDT](./import#convert-word-documents-into-sfdt)|When opening the document other than SFDT (JavaScript Document Editor's native file format), the server-side web API is invoked from client-side script.|**Client**: Sends the input file.
**Server**: Receives the input file and sends the converted SFDT back to the client.

The server-side web API internally extracts the content from the document (DOCX, DOC, WordML, RTF, HTML) using Word library (DocIO) and converts it into SFDT for opening the document in Document Editor.| -|[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.

**Note**: Whereas plain text received from system clipboard will be pasted directly in the client-side.|**Client**: Sends the input Html or Rtf string.
**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.
**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.
**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.
**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.

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.

First option (SFDT):
**Client**: Sends the SFDT.
**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.

Second option (DOCX):
**Client**: Sends the DOCX file.
**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.| +|[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.

**Note**: However, plain text received from the system clipboard will be pasted directly on the client side.|**Client**: Sends the input HTML or RTF string.
**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 a hash.|**Client**: Sends the input data for the hashing algorithm.
**Server**: Receives the input data for the hashing algorithm and sends the result hash information back to the client.| +|[Spellcheck](./spell-check) (default)|When the spellchecker is enabled on the 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.
**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 spell check page by page when loading the documents. By [enabling optimized spell check](./spell-check#enableoptimizedspellcheck) on the client side, you can perform spellcheck page by page when loading the documents.|**Client**: Sends the words (string) with their language for spelling validation.
**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 a file format other than DOCX and SFDT.

For saving the files as WordML, DOC, RTF, HTML, ODT, or Text using the Word library (DocIO) and PDF using the Word (DocIO) and PDF libraries.|You can transfer the document from the client to the server either as SFDT or DOCX format.

First option (SFDT):
**Client**: Sends the SFDT.
**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) on the server or sends the saved file to the client browser.

Second option (DOCX):
**Client**: Sends the DOCX file.
**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) on the 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, then you can deploy it as a pure client-side component 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: +If your running web service URL is `http://localhost:62869/`, set the serviceUrl as shown below: ```ts container.serviceUrl = "http://localhost:62869/api/documenteditor/"; @@ -39,56 +39,52 @@ 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 | +| Expected method name | Parameters | Return type | |-----|----|----| -|Import |Files(IFormCollection) |json(sfdt format) | -|SystemClipboard|CustomerParameter: content(type string either rtf or html) and type(either .rtf or .html) |json(sfdt format) | -|RestrictEditing |Parameter of type CustomRestrictParameter
public class CustomRestrictParameter
{
public string passwordBase64 { get; set; }
public string saltBase64 { get; set; }
public int spinCount { get; set; }
} |result hash information | -|SpellCheck(default) |Parameter: SpellCheckJsonData
public class SpellCheckJsonData
{
public int LanguageID { get; set; }
public string TexttoCheck { get; set; }
public bool CheckSpelling { get; set; }
public bool CheckSuggestion { get; set; }
public bool AddWord { get; set; }
} |Json type of Spellcheck containing details of spell checked word | -|SpellCheckByPage |Parameter: SpellCheckJsonData
public class SpellCheckJsonData
{
public int LanguageID { get; set; }
public string TexttoCheck { get; set; }
public bool CheckSpelling { get; set; }
public bool CheckSuggestion { get; set; }
public bool AddWord { get; set; }
} |Json type of Spellcheck containing details of spell checked word

**Note**: 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. | -|Save(optional API) |parameter: SaveParameter
public class SaveParameter
{
public string Content { get; set; }
public string FileName { get; set; }
} |void(Save the file as file stream) | -|ExportSFDT(optional API) |parameter: SaveParameter
public class SaveParameter
{
public string Content { get; set; }
public string FileName { get; set; }
} |FileStreamResult (to save the document in client-side) | -|Export(optional API) |Files(IFormCollection) |FileStreamResult (to save the document in client-side) | +| Import | Files(IFormCollection) | JSON (SFDT format) | +| SystemClipboard | CustomerParameter: content (type string either RTF or HTML) and type (either .rtf or .html) | JSON (SFDT format) | +| RestrictEditing | Parameter of type CustomRestrictParameter
public class CustomRestrictParameter
{
public string passwordBase64 { get; set; }
public string saltBase64 { get; set; }
public int spinCount { get; set; }
} | Result hash information | +| SpellCheck (default) | Parameter: SpellCheckJsonData
public class SpellCheckJsonData
{
public int LanguageID { get; set; }
public string TexttoCheck { get; set; }
public bool CheckSpelling { get; set; }
public bool CheckSuggestion { get; set; }
public bool AddWord { get; set; }
} | JSON type of Spellcheck containing details of the spell checked word | +| SpellCheckByPage | Parameter: SpellCheckJsonData
public class SpellCheckJsonData
{
public int LanguageID { get; set; }
public string TexttoCheck { get; set; }
public bool CheckSpelling { get; set; }
public bool CheckSuggestion { get; set; }
public bool AddWord { get; set; }
} | JSON type of Spellcheck containing details of the spell checked word | +| Save (optional API) | Parameter: SaveParameter
public class SaveParameter
{
public string Content { get; set; }
public string FileName { get; set; }
} | void (Save the file as a file stream) | +| ExportSFDT (optional API) | Parameter: SaveParameter
public class SaveParameter
{
public string Content { get; set; }
public string FileName { get; set; }
} | FileStreamResult (to save the document on the client side) | +| Export (optional API) | Files(IFormCollection) | FileStreamResult (to save the document on the client side) | ## 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/javascript/documentation/api/document-editor-container/documentEditorContainerModel#serveractionsettings). +The Document Editor component provides an option to customize the expected method name for Import, SystemClipboard, RestrictEditing, and SpellCheck using [serverActionSettings](https://ej2.syncfusion.com/javascript/documentation/api/document-editor-container/documentEditorContainerModel#serveractionsettings). The following example code illustrates how to customize the method name using serverActionSettings. ```javascript - - var container = new ej.documenteditor.DocumentEditorContainer({ enableToolbar: true, height: '590px' ,enableSpellCheck:true}); + var container = new ej.documenteditor.DocumentEditorContainer({ enableToolbar: true, height: '590px', enableSpellCheck: true }); ej.documenteditor.DocumentEditorContainer.Inject(ej.documenteditor.Toolbar); container.serviceUrl = hostUrl + 'api/documenteditor/'; - // Customize the API name - var settings = { import: 'Import1', systemClipboard: 'SystemClipboard1', spellCheck: 'SpellCheck1', restrictEditing: 'RestrictEditing1' } + // Customize the API name. + var settings = { import: 'Import1', systemClipboard: 'SystemClipboard1', spellCheck: 'SpellCheck1', restrictEditing: 'RestrictEditing1' }; container.serverActionSettings = settings; container.appendTo('#container'); - ``` -## Add the custom headers to XMLHttpRequest +## Add custom headers to the XMLHttpRequest -Document editor component provides an an option to add custom headers of XMLHttpRequest using the [`headers`](https://help.syncfusion.com/document-processing/word/word-processor/javascript-es5/header-footer). +The Document Editor component provides an option to add custom headers to the XMLHttpRequest using the [`headers`](https://help.syncfusion.com/document-processing/word/word-processor/javascript-es5/header-footer). ```javascript - var container = new ej.documenteditor.DocumentEditorContainer({ enableToolbar: true, height: '590px'}); ej.documenteditor.DocumentEditorContainer.Inject(ej.documenteditor.Toolbar); container.serviceUrl = hostUrl + 'api/documenteditor/'; - // custom headers + // Custom headers. var customHeaders = [{ 'Authorization': 'Bearer YOUR_ACCESS_TOKEN' }, { 'Content-Type': 'application/json' }]; container.headers = customHeaders; container.appendTo('#container'); - ``` -## Modify the XMLHttpRequest before request send +## Modify the XMLHttpRequest before sending a request -Document editor component provides an option to modify the XMLHttpRequest object (setting additional headers, if needed) using [`beforeXmlHttpRequestSend`](https://ej2.syncfusion.com/javascript/documentation/api/document-editor-container#beforexmlhttprequestsend) event and it gets triggered before a server request. +The Document Editor component provides an option to modify the XMLHttpRequest object (setting additional headers, if needed) using the [`beforeXmlHttpRequestSend`](https://ej2.syncfusion.com/javascript/documentation/api/document-editor-container#beforexmlhttprequestsend) event, which is triggered before a server request. You can customize the required [`XMLHttpRequest`](https://ej2.syncfusion.com/javascript/documentation/api/document-editor/xmlHttpRequestEventArgs) properties. @@ -99,10 +95,10 @@ var container = new ej.documenteditor.DocumentEditorContainer({ enableToolbar: true, height: '590px', }); -// Below action, cancel all server-side interactions expect spell check +// The below action cancels all server-side interactions except spell check. container.beforeXmlHttpRequestSend = function(args) { - //Here, modifying the request headers - args.headers = [{ syncfusion: 'true' }];; + // Here, modifying the request headers. + args.headers = [{ syncfusion: 'true' }]; args.withCredentials = true; switch (args.serverActionType) { case 'Import': @@ -113,7 +109,6 @@ container.beforeXmlHttpRequestSend = function(args) { } }; container.appendTo('#container'); - ``` -Note: Find the customizable serverActionType values are `'Import' | 'RestrictEditing' | 'SpellCheck' | 'SystemClipboard'`. \ No newline at end of file +N> The customizable serverActionType values are `'Import'`, `'RestrictEditing'`, `'SpellCheck'`, and `'SystemClipboard'`. \ No newline at end of file diff --git a/Document-Processing/Word/Word-Processor/javascript-es5/web-services/core.md b/Document-Processing/Word/Word-Processor/javascript-es5/web-services/core.md index 3d31b9c585..43afeabf6e 100644 --- a/Document-Processing/Word/Word-Processor/javascript-es5/web-services/core.md +++ b/Document-Processing/Word/Word-Processor/javascript-es5/web-services/core.md @@ -10,7 +10,7 @@ domainurl: ##DomainURL## # Core in JavaScript (ES5) Document editor control -DocumentEditor depends on server side interaction for below listed operations can be written in ASP.NET Core using [Syncfusion.EJ2.WordEditor.AspNet.Core](https://www.nuget.org/packages/Syncfusion.EJ2.WordEditor.AspNet.Core). +DocumentEditor depends on server-side interaction for the operations listed below, which can be written in ASP.NET Core using [Syncfusion.EJ2.WordEditor.AspNet.Core](https://www.nuget.org/packages/Syncfusion.EJ2.WordEditor.AspNet.Core). * Import Word Document * Paste with formatting @@ -18,15 +18,15 @@ DocumentEditor depends on server side interaction for below listed operations ca * Spell Check * Save as file formats other than SFDT and DOCX ->Note: Syncfusion® provides a predefined [Word Processor server docker image](https://hub.docker.com/r/syncfusion/word-processor-server) targeting ASP.NET Core 2.1 framework. You can directly pull this docker image and deploy it in server on the go. You can also create own docker image by customizing the existing [docker project from GitHub](https://github.com/SyncfusionExamples/Word-Processor-Server-Docker). To know more, refer this link.[Word Processor Server Docker Image Overview](../server-deployment/word-processor-server-docker-image-overview) +N> Syncfusion® provides a predefined [Word Processor server docker image](https://hub.docker.com/r/syncfusion/word-processor-server) targeting the ASP.NET Core 2.1 framework. You can directly pull this docker image and deploy it on the server on the go. You can also create your own docker image by customizing the existing [docker project from GitHub](https://github.com/SyncfusionExamples/Word-Processor-Server-Docker). To know more, refer to this link: [Word Processor Server Docker Image Overview](../server-deployment/word-processor-server-docker-image-overview). This section explains how to create the service for DocumentEditor in ASP.NET Core. -## Importing Word Document +## Importing a Word Document -As the Document editor client-side script requires the document in SFDT file format, you can convert the Word documents (.dotx,.docx,.docm,.dot,.doc), rich text format documents (.rtf), and text documents (.txt) into SFDT format by using this Web API. +As the Document Editor client-side script requires the document in SFDT file format, you can convert the Word documents (.dotx, .docx, .docm, .dot, .doc), rich text format documents (.rtf), and text documents (.txt) into SFDT format by using this Web API. -The following example code illustrates how to write a Web API for importing Word documents into Document Editor component. +The following example code illustrates how to write a Web API for importing Word documents into the Document Editor component. ```c# [AcceptVerbs("Post")] @@ -52,13 +52,13 @@ The following example code illustrates how to write a Web API for importing Word } ``` -### Import document with TIFF, EMF and WMF images +### Import document with TIFF, EMF, and WMF images -The web browsers do not support to display metafile images like EMF and WMF and also TIFF format images. As a fallback approach, you can convert the metafile/TIFF format image to raster image using any image converter in the `MetafileImageParsed` event and this fallback raster image will be displayed in the client-side Document editor component. +The web browsers do not support displaying metafile images like EMF and WMF, and also TIFF format images. As a fallback approach, you can convert the metafile/TIFF format image to a raster image using any image converter in the `MetafileImageParsed` event, and this fallback raster image will be displayed in the client-side Document Editor component. ->Note: In `MetafileImageParsedEventArgs` event argument, you can get the metafile stream using `MetafileStream` property and you can get the `IsMetafile` boolean value to determine whether the image is meta file images(WMF,EMF) or TIFF format images. In below example, we have converted the TIFF to raster image in `ConvertTiffToRasterImage()` method using `Bitmiracle https://www.nuget.org/packages/BitMiracle.LibTiff.NET`. +N> In the `MetafileImageParsedEventArgs` event argument, you can get the metafile stream using the `MetafileStream` property, and you can get the `IsMetafile` boolean value to determine whether the image is a metafile image (WMF, EMF) or a TIFF format image. In the example below, the TIFF is converted to a raster image in the `ConvertTiffToRasterImage()` method using `Bitmiracle https://www.nuget.org/packages/BitMiracle.LibTiff.NET`. -The following example code illustrates how to use `MetafileImageParsed` event for creating fallback raster image for metafile present in a Word document. +The following example code illustrates how to use the `MetafileImageParsed` event for creating a fallback raster image for a metafile present in a Word document. ```c# using SkiaSharp; @@ -76,35 +76,35 @@ The following example code illustrates how to use `MetafileImageParsed` event fo file.CopyTo(stream); stream.Position = 0; - //Hooks MetafileImageParsed event. + // Hooks the MetafileImageParsed event. WordDocument.MetafileImageParsed += OnMetafileImageParsed; - //Converts Stream DOM to SFDT DOM. + // Converts Stream DOM to SFDT DOM. WordDocument document = WordDocument.Load(stream, GetFormatType(type.ToLower())); - //Unhooks MetafileImageParsed event. + // Unhooks the MetafileImageParsed event. WordDocument.MetafileImageParsed -= OnMetafileImageParsed; - //Serializes SFDT DOM to SFDT string. + // Serializes SFDT DOM to SFDT string. string json = Newtonsoft.Json.JsonConvert.SerializeObject(document); document.Dispose(); return json; } - //Converts Metafile to raster image. + // Converts a Metafile to a raster image. private static void OnMetafileImageParsed(object sender, MetafileImageParsedEventArgs args) - { + { if (args.IsMetafile) { - //MetaFile image conversion(EMF and WMF) - //You can write your own method definition for converting metafile to raster image using any third-party image converter. + // Metafile image conversion (EMF and WMF) + // You can write your own method definition for converting a metafile to a raster image using any third-party image converter. args.ImageStream = ConvertMetafileToRasterImage(args.MetafileStream); } else { - //TIFF image conversion + // TIFF image conversion args.ImageStream = ConvertTiffToRasterImage(args.MetafileStream); } } - - // Converting Tiff to Png image using Bitmiracle https://www.nuget.org/packages/BitMiracle.LibTiff.NET + + // Converting a TIFF to a PNG image using Bitmiracle https://www.nuget.org/packages/BitMiracle.LibTiff.NET private static MemoryStream ConvertTiffToRasterImage(Stream tiffStream) { MemoryStream imageStream = new MemoryStream(); @@ -168,7 +168,7 @@ The following example code illustrates how to use `MetafileImageParsed` event fo ## Paste with formatting -This Web API converts the system clipboard data (HTML/RTF) to SFDT format which is required to paste content with formatting. +This Web API converts the system clipboard data (HTML/RTF) to SFDT format, which is required to paste content with formatting. The following example code illustrates how to write a Web API for paste with formatting. @@ -183,10 +183,10 @@ The following example code illustrates how to write a Web API for paste with for { try { - //Hooks MetafileImageParsed event. + // Hooks the MetafileImageParsed event. WordDocument.MetafileImageParsed += OnMetafileImageParsed; WordDocument document = WordDocument.LoadString(param.content, GetFormatType(param.type.ToLower())); - //Unhooks MetafileImageParsed event. + // Unhooks the MetafileImageParsed event. WordDocument.MetafileImageParsed -= OnMetafileImageParsed; string json = Newtonsoft.Json.JsonConvert.SerializeObject(document); document.Dispose(); @@ -206,19 +206,19 @@ The following example code illustrates how to write a Web API for paste with for public string type { get; set; } } - //Converts Metafile to raster image. + // Converts a Metafile to a raster image. private static void OnMetafileImageParsed(object sender, MetafileImageParsedEventArgs args) { - //You can write your own method definition for converting metafile to raster image using any third-party image converter. + // You can write your own method definition for converting a metafile to a raster image using any third-party image converter. args.ImageStream = ConvertMetafileToRasterImage(args.MetafileStream); } ``` ->Note: The web browsers do not support to display metafile images like EMF and WMF. As a fallback approach, you can convert the metafile to raster image using any image converter in the [MetafileImageParsed](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.DocumentEditor.WordDocument.html#Syncfusion_EJ2_DocumentEditor_WordDocument_MetafileImageParsed) event and this fallback raster image will be displayed in the client-side Document editor component. +N> The web browsers do not support displaying metafile images like EMF and WMF. As a fallback approach, you can convert the metafile to a raster image using any image converter in the [MetafileImageParsed](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.DocumentEditor.WordDocument.html#Syncfusion_EJ2_DocumentEditor_WordDocument_MetafileImageParsed) event, and this fallback raster image will be displayed in the client-side Document Editor component. -## Restrict editing +## Restrict Editing -This Web API generates hash from the specified password and salt value which is required for restrict editing functionality of Document Editor component. +This Web API generates a hash from the specified password and salt value, which is required for the restrict editing functionality of the Document Editor component. The following example code illustrates how to write a Web API for restrict editing. @@ -245,11 +245,11 @@ The following example code illustrates how to write a Web API for restrict editi ## Spell Check -Document Editor supports performing spell checking for any input text. You can perform spell checking for the text in Document Editor and it will provide suggestions for the mis-spelled words through dialog and in context menu. Document editor client-side script requires this Web API to show error words and list suggestions in context menu. This Web API returns the json type of spell-checked word which contains details about error words if any and suggestions. +Document Editor supports performing spell checking for any input text. You can perform spell checking for the text in Document Editor, and it will provide suggestions for the misspelled words through a dialog and the context menu. The Document Editor client-side script requires this Web API to show error words and list suggestions in the context menu. This Web API returns the JSON type of spell-checked word, which contains details about error words, if any, and suggestions. -To know more about configure spell check, please check this [link](https://github.com/SyncfusionExamples/EJ2-Document-Editor-Web-Services/tree/master/ASP.NET%20Core#steps-to-configure-spell-checker). +To know more about configuring spell check, please refer to this [link](https://github.com/SyncfusionExamples/EJ2-DocumentEditor-Web-Services/tree/master/ASP.NET%20Core#steps-to-configure-spell-checker). -In startup.cs file, you can configure the spell check files like below: +In the `startup.cs` file, you can configure the spell check files as shown below: ```c# @@ -279,7 +279,7 @@ In startup.cs file, you can configure the spell check files like below: //construct the dictionary file path using customer provided path and dictionary name foreach (var spellCheck in spellChecks) { - spellDictCollection.Add(new DictionaryData(spellCheck.LanguadeID, Path.Combine(path, spellCheck.DictionaryPath), Path.Combine(path, spellCheck.AffixPath))); + spellDictCollection.Add(new DictionaryData(spellCheck.LanguageID, Path.Combine(path, spellCheck.DictionaryPath), Path.Combine(path, spellCheck.AffixPath))); personalDictPath = Path.Combine(path, spellCheck.PersonalDictPath); } } @@ -287,11 +287,11 @@ In startup.cs file, you can configure the spell check files like below: ``` -Document editor provides options to spell check word by word and spellcheck page by page when loading the documents. +Document Editor provides options to spell check word by word and spell check page by page when loading the documents. ### Spell check word by word -This Web API performs the spell check word by word and return the json which contains information about error words and suggestions if any. By default, spell check word by word is performed in Document editor when enabling spell check in client-side. +This Web API performs the spell check word by word and returns the JSON, which contains information about error words and suggestions, if any. By default, spell check word by word is performed in Document Editor when enabling spell check on the client side. The following example code illustrates how to write a Web API for spell check word by word. @@ -326,7 +326,7 @@ The following example code illustrates how to write a Web API for spell check wo ### Spell check page by page -This Web API performs the spell check page by page and return the json which contains information about error words and suggestions if any. By [enabling optimized spell check](../spell-check#enableoptimizedspellcheck) in client-side, you can perform spellcheck page by page when loading the documents. +This Web API performs the spell check page by page and returns the JSON, which contains information about error words and suggestions, if any. By [enabling optimized spell check](../spell-check#enableoptimizedspellcheck) on the client side, you can perform spell check page by page when loading the documents. The following example code illustrates how to write a Web API for spell check page by page. @@ -362,13 +362,13 @@ The following example code illustrates how to write a Web API for spell check pa ## Save as file formats other than SFDT and DOCX -You can configure this API, if you want to save the document in file format other than DOCX and SFDT using server-side. You can save the document in following ways: +You can configure this API if you want to save the document in a file format other than DOCX and SFDT on the server side. You can save the document in the following ways: -### Save the document in database or file server +### Save the document in a database or file server This Web API saves the document in the server machine. You can customize this API to save the document into databases or file servers. -The following example code illustrates how to write a Web API for save document in server-side. +The following example code illustrates how to write a Web API to save a document on the server side. ```c# [AcceptVerbs("Post")] @@ -384,7 +384,7 @@ The following example code illustrates how to write a Web API for save document name = "Document1.doc"; } WDocument document = WordDocument.Save(data.Content); - // Saves the document to server machine file system, you can customize here to save into databases or file servers based on requirement. + // Saves the document to the server machine file system; you can customize this to save into databases or file servers based on your requirement. FileStream fileStream = new FileStream(name, FileMode.OpenOrCreate, FileAccess.ReadWrite); document.Save(fileStream, GetWFormatType(format)); document.Close(); @@ -398,11 +398,11 @@ The following example code illustrates how to write a Web API for save document } ``` -### Save as other file formats by passing SFDT string +### Save as other file formats by passing an SFDT string -This Web API converts the SFDT string to required format and returns the document as FileStreamResult to client-side. Using this API, you can save the document in file format other than SFDT and DOCX and download the document in client browser. +This Web API converts the SFDT string to the required format and returns the document as a FileStreamResult to the client side. Using this API, you can save the document in a file format other than SFDT and DOCX and download the document in the client browser. -The following example code illustrates how to write a Web API for export sfdt. +The following example code illustrates how to write a Web API to export SFDT. ```c# [AcceptVerbs("Post")] @@ -470,9 +470,9 @@ The following example code illustrates how to write a Web API for export sfdt. } ``` -### Save as other file formats by passing DOCX file +### Save as other file formats by passing a DOCX file -This Web API converts the DOCX document to required format and returns the document as FileStreamResult to client-side. Using this API, you can save the document in file format other than SFDT and DOCX and download the document in client browser. +This Web API converts the DOCX document to the required format and returns the document as a FileStreamResult to the client side. Using this API, you can save the document in a file format other than SFDT and DOCX and download the document in the client browser. The following example code illustrates how to write a Web API for export. @@ -520,4 +520,4 @@ The following example code illustrates how to write a Web API for export. ``` ->Note: Please refer the [ASP.NET Core Web API sample](https://github.com/SyncfusionExamples/EJ2-DocumentEditor-WebServices/tree/master/ASP.NET%20Core). +N> Please refer to the [ASP.NET Core Web API sample](https://github.com/SyncfusionExamples/EJ2-DocumentEditor-WebServices/tree/master/ASP.NET%20Core).