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
26 changes: 13 additions & 13 deletions Document-Processing/Word/Word-Processor/javascript-es6/print.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
---
layout: post
title: Print in JavaScript (ES6) Document editor control | Syncfusion
description: Learn here all about Print in Syncfusion JavaScript (ES6) Document editor control of Syncfusion Essential JS 2 and more.
title: Print in JavaScript (ES6) DOCX Editor | Syncfusion
description: Learn about Print in the Syncfusion JavaScript (ES6) DOCX Editor of Essential JS 2 and more details on how to print Word documents.
platform: document-processing
control: Print
documentation: ug
domainurl: ##DomainURL##
---

# Print in JavaScript (ES6) Document editor control
# Print in JavaScript (ES6) Document Editor

To print the document, use the [`print`](https://ej2.syncfusion.com/documentation/api/document-editor#print) method from [TypeScript DOCX Editor](https://www.syncfusion.com/docx-editor-sdk/javascript-docx-editor) (Document Editor) instance.
To print the document, use the [`print`](https://ej2.syncfusion.com/documentation/api/document-editor#print) method from the [TypeScript DOCX Editor](https://www.syncfusion.com/docx-editor-sdk/javascript-docx-editor) (Document Editor) instance.

Refer to the following example for showing a document and print it.
Refer to the following example for showing a document and printing it.



Expand All @@ -27,7 +27,7 @@ Refer to the following example for showing a document and print it.

{% previewsample "/document-processing/code-snippet/document-editor/javascript-es6/print-cs1" %}

Refer to the following example for creating a document and print it.
Refer to the following example for creating a document and printing it.



Expand All @@ -44,9 +44,9 @@ Refer to the following example for creating a document and print it.

## Improve print quality

Document editor provides an option to improve the print quality using [`printDevicePixelRatio`](https://ej2.syncfusion.com/documentation/api/document-editor/documentEditorSettingsModel#printdevicepixelratio) in Document editor settings. Document editor using canvas approach to render content. Then, canvas are converted to image and it process for print. Using printDevicePixelRatio API, you can increase the image quality based on your requirement.
The Document Editor provides an option to improve the print quality using [`printDevicePixelRatio`](https://ej2.syncfusion.com/documentation/api/document-editor/documentEditorSettingsModel#printdevicepixelratio) in Document Editor settings. The Document Editor uses a canvas approach to render content. The canvas is then converted to an image and processed for print. Using the `printDevicePixelRatio` API, you can increase the image quality based on your requirement.

The following example code illustrates how to improve the print quality in Document editor container.
The following example code illustrates how to improve the print quality in the Document Editor container.

```ts
let container: DocumentEditorContainer = new DocumentEditorContainer({ enableToolbar: true, height: '590px',
Expand All @@ -58,13 +58,13 @@ let container: DocumentEditorContainer = new DocumentEditorContainer({ enableToo
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 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: By default, printDevicePixelRatio value is 1
N> By default, the `printDevicePixelRatio` value is 1.

## Print using window object

You can print the document in Document Editor by passing the window instance. This is useful to implement print in third party frameworks such as electron, where the window instance will not be available. Refer to the following example.
You can print the document in the Document Editor by passing the window instance. This is useful to implement print in third-party frameworks such as Electron, where the window instance will be available. Refer to the following example.

```ts
import { DocumentEditor, Print } from '@syncfusion/ej2-documenteditor';
Expand All @@ -85,7 +85,7 @@ Some of the print options cannot be configured using JavaScript. Refer to the fo
* [`Chrome`](https://support.google.com/chrome/answer/1069693?hl=en&visit_id=1-636335333734668335-3165046395&rd=1/)
* [`Firefox`](https://support.mozilla.org/en-US/kb/how-print-web-pages-firefox/)

However, you can customize margins, paper, and layout options by modifying the section format properties using page setup dialog
However, you can customize margins, paper, and layout options by modifying the section format properties using the page setup dialog.

```ts
import { DocumentEditor, Print, PageSetupDialog, Editor, Selection, EditorHistory } from '@syncfusion/ej2-documenteditor';
Expand All @@ -105,7 +105,7 @@ documenteditor.appendTo('#DocumentEditor');
documenteditor.showPageSetupDialog();
```

By customizing margins, papers, and layouts, the layout of the document will be changed in Document Editor. To modify these options during print operation, serialize the document as SFDT using the [`serialize`](https://ej2.syncfusion.com/documentation/api/document-editor#serialize) method in Document Editor instance and open the SFDT data in another instance of Document Editor in separate window.
By customizing margins, papers, and layouts, the layout of the document will be changed in the Document Editor. To modify these options during the print operation, serialize the document as SFDT using the [`serialize`](https://ej2.syncfusion.com/documentation/api/document-editor#serialize) method in the Document Editor instance and open the SFDT data in another instance of the Document Editor in a separate window.

The following example shows how to customize layout options only for printing.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ documentation: ug
domainurl: ##DomainURL##
---

# R t l in JavaScript (ES6) Document editor control
# Right to Left in JavaScript (ES6) Document Editor

[TypeScript DOCX Editor](https://www.syncfusion.com/docx-editor-sdk/javascript-docx-editor) (Document Editor) provides RTL (right-to-left) support. This can be enabled using the "enableRtl" property.
[TypeScript DOCX Editor](https://www.syncfusion.com/docx-editor-sdk/javascript-docx-editor) (Document Editor) provides RTL (right-to-left) support. This can be enabled using the `enableRtl` property.



Expand All @@ -27,4 +27,4 @@ domainurl: ##DomainURL##

## Online Demo

Explore how to use right-to-left layout in Word documents using the JavaScript Document Editor in this live demo [here](https://document.syncfusion.com/demos/docx-editor/javascript/#/material3/document-editor/right-to-left.html).
Explore how to enable right-to-left layout in Word documents using the JavaScript Document Editor in this [live demo](https://document.syncfusion.com/demos/docx-editor/javascript/#/material3/document-editor/right-to-left.html).
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
---
layout: post
title: Restrict editing in JavaScript (ES6) DOCX Editor | Syncfusion
description: Learn how to enable Restrict Editing in the JavaScript (ES6) DOCX Editor to securely manage document access and control user modifications.
description: Learn how to enable Restrict Editing in the JavaScript (ES6) Document Editor to securely manage document access and control user modifications.
platform: document-processing
control: Restrict editing
documentation: ug
domainurl: ##DomainURL##
---

# Restrict Editing in JavaScript (ES6) DOCX Editor
# Restrict Editing in JavaScript (ES6) Document Editor

Syncfusion® JavaScript (ES6) DOCX Editor (Document Editor) provides support for restricting editing within a document. It enables control over how and where content can be modified. This helps limit editing so only specific sections of the document can be changed.

## Configure on client side

Document Editor provides options to protect and unprotect a document using the [enforceProtection](https://ej2.syncfusion.com/documentation/api/document-editor/editor#enforceprotection) and [stopProtection](https://ej2.syncfusion.com/documentation/api/document-editor/editor#stopprotection) APIs, enabling various restricting editing operations.
The Document Editor provides options to protect and unprotect a document using the [enforceProtection](https://ej2.syncfusion.com/documentation/api/document-editor/editor#enforceprotection) and [stopProtection](https://ej2.syncfusion.com/documentation/api/document-editor/editor#stopprotection) APIs, enabling various restrict-editing operations.

### Read only mode
### Read-only mode

Document Editor supports protecting a document in read-only mode, where users can only view the content without making changes.
The Document Editor supports protecting a document in read-only mode, where users can only view the content without making changes.

The following example code illustrates how to enforce or remove read-only protection in the Document Editor.

Expand Down Expand Up @@ -109,7 +109,7 @@ document.getElementById('stopProtection').addEventListener('click', function ()

### Form filling mode

Document Editor supports protecting a document with form-filling restrictions, allowing users to edit only form fields.
The Document Editor supports protecting a document with form-filling restrictions, allowing users to edit only form fields.

The following example code illustrates how to enforce or remove form-filling restrictions in the Document Editor.

Expand Down Expand Up @@ -200,7 +200,7 @@ document.getElementById('stopProtection').addEventListener('click', function ()

### Comments only mode

Document Editor supports protecting a document in comments-only mode, allowing users to add or edit comments only.
The Document Editor supports protecting a document in comments-only mode, allowing users to add or edit comments only.

The following example code illustrates how to enforce and remove comments-only protection in the Document Editor.

Expand Down Expand Up @@ -292,7 +292,7 @@ document.getElementById('stopProtection').addEventListener('click', function ()

### Track changes only mode

Document Editor supports protecting a document in revisions-only mode, allowing users to view the document and make corrections while tracking all changes. Users cannot accept or reject tracked changes; only the author can review and finalize them later.
The Document Editor supports protecting a document in revisions-only mode, allowing users to view the document and make corrections while tracking all changes. Users cannot accept or reject tracked changes; only the author can review and finalize them later.

The following example code illustrates how to enforce and remove revisions-only protection in the Document Editor.

Expand Down Expand Up @@ -383,7 +383,7 @@ document.getElementById('stopProtection').addEventListener('click', function ()

### Format restrictions

Enforces document protection using the specified credentials. In the [enforceProtection](https://ej2.syncfusion.com/documentation/api/document-editor/editor#enforceprotection-1) method, the second parameter represents limitToFormatting, and the third parameter represents isReadOnly.
The Document Editor enforces document protection using the specified credentials. In the [enforceProtection](https://ej2.syncfusion.com/documentation/api/document-editor/editor#enforceprotection-1) method, the second parameter represents `limitToFormatting`, and the third parameter represents `isReadOnly`.

{% tabs %}
{% highlight ts tabtitle="index.ts" %}
Expand All @@ -409,9 +409,9 @@ For more information on configuring restrict editing on the server side, refer t

## Set current user

The [`currentUser`](https://ej2.syncfusion.com/documentation/api/document-editor#currentuser) property can be used to authorize the current document user by name, email, or user group.
The [currentUser](https://ej2.syncfusion.com/documentation/api/document-editor-container/documenteditor#currentuser) property can be used to authorize the current document user by name, email, or user group.

The following code example demonstrates how to set the currentUser.
The following code example demonstrates how to set the `currentUser`.

{% tabs %}
{% highlight ts tabtitle="index.ts" %}
Expand All @@ -422,10 +422,12 @@ container.documentEditor.currentUser = 'engineer@mycompany.com';
{% endtabs %}

## Protect document with editable region
User can select a specific section and mark it as an editable region, allowing modification only in that part. The rest of the document remains protected from any changes.

Users can select a specific section and mark it as an editable region, allowing modification only in that part. The rest of the document remains protected from any changes.

### Insert editable region
Use the [insertEditingRegion](https://ej2.syncfusion.com/documentation/api/document-editor/editor#inserteditingregion) method to mark specific paragraphs as editable.This allows you to control editing by giving access to all users or only selected users.

Use the [insertEditingRegion](https://ej2.syncfusion.com/documentation/api/document-editor/editor#inserteditingregion) method to mark specific paragraphs as editable. This allows you to control editing by giving access to all users or only selected users.

The following example shows how to insert an editable region.
{% tabs %}
Expand Down Expand Up @@ -475,8 +477,8 @@ Restrict Editing Pane provides the following options to manage the document:
* To apply editing restrictions to the current document, select the read only check box.
* To add users to the current document, select more users option and add user from the popup dialog.
* To include range permission to the current document, select parts of the document and choose users who are allowed to freely edit them from the listed check box.
* To apply the chosen editing restrictions, click the **YES,START ENFORCING PROTECTION** button. A dialog box displays asking for a password to protect.
* To stop protection, select **STOP PROTECTION** button. A dialog box displays asking for a password to stop protection.
* To apply the chosen editing restrictions, click the **YES, START ENFORCING PROTECTION** button. A dialog box displays asking for a password to protect.
* To stop protection, select the **STOP PROTECTION** button. A dialog box displays asking for a password to stop protection.

The following code shows Restrict Editing Pane. To unprotect the document, use password '123'.

Expand All @@ -491,4 +493,4 @@ The following code shows Restrict Editing Pane. To unprotect the document, use p

{% previewsample "/document-processing/code-snippet/document-editor/javascript-es6/data-protection-cs2" %}

N> The hosted Web API URL is for demo and evaluation purposes only. For production, host your own web service using 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 URL is for demo and evaluation purposes only. For production, host your own web service using the [GitHub Web Service example](https://github.com/SyncfusionExamples/EJ2-DocumentEditor-WebServices) or the [Docker image](https://hub.docker.com/r/syncfusion/word-processor-server).
12 changes: 6 additions & 6 deletions Document-Processing/Word/Word-Processor/javascript-es6/ribbon.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
layout: post
title: Ribbon in JavaScript (ES6) Document editor | Syncfusion
description: Learn here all about the Ribbon UI in Syncfusion JavaScript (ES6) Document editor control, how to switch between Ribbon and Toolbar modes.
title: Ribbon in JavaScript (ES6) DOCX Editor | Syncfusion
description: Learn here all about the Ribbon UI in the Syncfusion JavaScript (ES6) Document Editor, how to switch between Ribbon and Toolbar modes.
platform: document-processing
control: Ribbon
documentation: ug
Expand All @@ -16,14 +16,14 @@ You can switch between the classic **Toolbar** and the new **Ribbon** UI, and yo

## Enable Ribbon Mode

To enable Ribbon in Document Editor, use the [`toolbarMode`](https://ej2.syncfusion.com/documentation/api/document-editor-container/#toolbarmode) property of `DocumentEditorContainer`. The available toolbar modes are:
To enable Ribbon in the Document Editor, use the [`toolbarMode`](https://ej2.syncfusion.com/documentation/api/document-editor-container#toolbarmode) property of `DocumentEditorContainer`. The available toolbar modes are:

- **'Toolbar'** - The traditional toolbar UI.
- **'Ribbon'** - The Ribbon UI, which provides a tabbed interface with grouped commands.

By default, `toolbarMode` is `Toolbar`.

The following code shows the how to enable the `Ribbon` in Document Editor.
The following code shows how to enable the `Ribbon` in the Document Editor.

```ts

Expand All @@ -42,14 +42,14 @@ container.appendTo('#container');

## Ribbon Layouts

Document Editor provides two different Ribbon layouts:
The Document Editor provides two different Ribbon layouts:

- **Classic**: A traditional Office-like ribbon with detailed grouping and larger icons
- **Simplified**: A more compact ribbon design with streamlined controls

By default, `ribbonLayout` is set to `Simplified`.

The following code shows the how to configure the ribbon layout in Document Editor:
The following code shows how to configure the ribbon layout in the Document Editor:

```ts

Expand Down
Loading