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
@@ -1,21 +1,21 @@
---
layout: post
title: Disable Optimized Text Measuring in Blazor DocumentEditor | Syncfusion
description: Learn how to disable optimized text measuring in Syncfusion Blazor DocumentEditor component and much more.
title: Disable Optimized Text Measuring in Blazor DOCX Editor | Syncfusion
description: Learn how to disable optimized text measuring in Syncfusion Blazor Document Editor component and much more.
platform: document-processing
control: DocumentEditor
control: Document Editor
documentation: ug
---

# Disable Optimized Text Measuring in Blazor DocumentEditor component
# Disable optimized text measuring in Blazor Document Editor component

Starting from v19.3.0.x, the accuracy of text size measurements in [Blazor DOCX Editor](https://www.syncfusion.com/docx-editor-sdk/blazor-docx-editor) (Document Editor) is improved such as to match Microsoft Word pagination for most Word documents. This improvement is included as default behavior along with an optional API [`EnableOptimizedTextMeasuring`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DocumentEditor.DocumentEditorSettingsModel.html#Syncfusion_Blazor_DocumentEditor_DocumentEditorSettingsModel_EnableOptimizedTextMeasuring) in Document editor settings.
Starting from v19.3.0.x, the accuracy of text size measurements in [Blazor Document Editor](https://www.syncfusion.com/docx-editor-sdk/blazor-docx-editor) (Document Editor) is improved to match Microsoft Word pagination for most Word documents. This improvement is included as default behavior along with an optional API [`EnableOptimizedTextMeasuring`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DocumentEditor.DocumentEditorSettingsModel.html#Syncfusion_Blazor_DocumentEditor_DocumentEditorSettingsModel_EnableOptimizedTextMeasuring) in Document Editor settings.

If you want the [`Blazor DOCX Editor`](https://www.syncfusion.com/docx-editor-sdk/blazor-docx-editor) component (Document Editor) component to retain the document pagination (display page-by-page) behavior like v19.2.0.x and older versions. Then you can disable this optimized text measuring improvement, by setting `false` to [`EnableOptimizedTextMeasuring`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DocumentEditor.DocumentEditorSettingsModel.html#Syncfusion_Blazor_DocumentEditor_DocumentEditorSettingsModel_EnableOptimizedTextMeasuring) property of Blazor Document Editor component.
If you want the [Blazor Document Editor](https://www.syncfusion.com/docx-editor-sdk/blazor-docx-editor) (Document Editor) component to retain the document pagination (display page-by-page) behavior like v19.2.0.x and older versions, you can disable the optimized text measuring feature by setting `false` to the [`EnableOptimizedTextMeasuring`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DocumentEditor.DocumentEditorSettingsModel.html#Syncfusion_Blazor_DocumentEditor_DocumentEditorSettingsModel_EnableOptimizedTextMeasuring) property of the Blazor Document Editor component.

## Disable Optimized Text Measuring in DocumentEditorContainer instance
## Disable optimized text measuring in Document Editor Container instance

The following example code illustrates how to disable optimized text measuring improvement in [`DocumentEditorContainer`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DocumentEditor.SfDocumentEditorContainer.html) instance.
The following example code illustrates how to disable the optimized text measuring feature in the [`Document Editor Container`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DocumentEditor.SfDocumentEditorContainer.html) instance.

```csharp

Expand All @@ -26,14 +26,14 @@ The following example code illustrates how to disable optimized text measuring i

@code {
SfDocumentEditorContainer container;
// Disable optimized text measuring improvement
DocumentEditorSettingsModel settings = new DocumentEditorSettingsModel() { EnableOptimizedTextMeasuring = true };
// Disable optimized text measuring feature
DocumentEditorSettingsModel settings = new DocumentEditorSettingsModel() { EnableOptimizedTextMeasuring = false };
}
```

## Disable optimized text measuring in DocumentEditor instance
## Disable optimized text measuring in Document Editor instance

The following example code illustrates how to disable optimized text measuring improvement in [`DocumentEditor`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DocumentEditor.SfDocumentEditor.html) instance.
The following example code illustrates how to disable the optimized text measuring feature in the [`Document Editor`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DocumentEditor.SfDocumentEditor.html) instance.

```csharp

Expand All @@ -43,7 +43,7 @@ The following example code illustrates how to disable optimized text measuring i
</SfDocumentEditor>

@code {
// Disable optimized text measuring improvement
DocumentEditorSettingsModel settings = new DocumentEditorSettingsModel() { EnableOptimizedTextMeasuring = true };
// Disable optimized text measuring feature
DocumentEditorSettingsModel settings = new DocumentEditorSettingsModel() { EnableOptimizedTextMeasuring = false };
}
```
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
layout: post
title: How to enable Ruler in Blazor DocumentEditor Component | Syncfusion
title: How to enable Ruler in Blazor DOCX Editor Component | Syncfusion
description: Learn how to show or hide ruler component in Syncfusion Blazor Document Editor component and much more.
platform: document-processing
control: DocumentEditor
control: Document Editor
documentation: ug
---

## How to enable ruler in Blazor Document Editor Container component
# How to enable ruler in Blazor Document Editor Container component

Using ruler we can refer to setting specific margins, tab stops, or indentations within a document to ensure consistent formatting in [Blazor DOCX Editor](https://www.syncfusion.com/docx-editor-sdk/blazor-docx-editor) (Document Editor) Container.
Using the ruler, you can set specific margins, tab stops, or indentations within a document to ensure consistent formatting in the [Blazor Document Editor](https://www.syncfusion.com/docx-editor-sdk/blazor-docx-editor) (Document Editor) Container.

The following example illustrates how to enable ruler in Document Editor Container.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
---
layout: post
title: Export a Document as a PDF in Blazor DocumentEditor | Syncfusion
description: Learn how to export the document as PDF in Syncfusion Blazor DocumentEditor component and much more.
title: Export a Document as a PDF in Blazor DOCX Editor | Syncfusion
description: Learn how to export the document as PDF in Syncfusion Blazor Document Editor component and much more.
platform: document-processing
control: DocumentEditor
control: Document Editor
documentation: ug
---

# How to export the document as PDF in Blazor Document Editor

In this article, we are going to see how to export the document as PDF format.
In this article, we are going to see how to export the document as a PDF format.

With the help of [`Syncfusion`<sup style="font-size:70%">&reg;</sup>` DocIO`](https://help.syncfusion.com/file-formats/docio/word-to-pdf), you can export the document as PDF.
With the help of [`Syncfusion`<sup style="font-size:70%">&reg;</sup>` DocIO`](https://help.syncfusion.com/file-formats/docio/word-to-pdf), you can export the document as a PDF.

The following way illustrates how to convert the document as PDF:
The following example illustrates how to convert the document to PDF:

* Using [`SaveAsBlobAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DocumentEditor.SfDocumentEditor.html#Syncfusion_Blazor_DocumentEditor_SfDocumentEditor_SaveAsBlobAsync_System_Nullable_Syncfusion_Blazor_DocumentEditor_FormatType__) API, convert the document as Base64String, then convert to stream and send it to Syncfusion<sup style="font-size:70%">&reg;</sup> DocIO.
* Finally, convert the stream to PDF using [`Syncfusion.DocIORenderer.Net.Core`](https://www.nuget.org/packages/Syncfusion.DocIORenderer.Net.Core) library.
* Using [`SaveAsBlobAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DocumentEditor.SfDocumentEditor.html#Syncfusion_Blazor_DocumentEditor_SfDocumentEditor_SaveAsBlobAsync_System_Nullable_Syncfusion_Blazor_DocumentEditor_FormatType__) API, convert the document to a Base64 string, then convert it to a stream and pass it to Syncfusion<sup style="font-size:70%">&reg;</sup> DocIO.
* Finally, convert the stream to PDF using the [`Syncfusion.DocIORenderer.Net.Core`](https://www.nuget.org/packages/Syncfusion.DocIORenderer.Net.Core) library.

The following example code illustrates how to process the sfdt in server-side.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
---
layout: post
title: Get Word and Paragraph in Blazor DocumentEditor | Syncfusion
description: Learn how to select and retrieve current word and Paragraph in the Syncfusion Blazor Document Editor component and much more.
title: Get Word and Paragraph in Blazor DOCX Editor | Syncfusion
description: Learn how to select and retrieve the current word and paragraph in the Syncfusion Blazor Document Editor component and much more.
platform: document-processing
control: DocumentEditor
control: Document Editor
documentation: ug
---

# How to select and retrieve the word and paragraph in Document Editor
# Get the current word and paragraph in Blazor Document Editor

The [Blazor DOCX Editor](https://www.syncfusion.com/docx-editor-sdk/blazor-docx-editor) (Document Editor) component allows for getting the current word or paragraph content as plain text and SFDT (rich text).
The [Blazor Document Editor](https://www.syncfusion.com/docx-editor-sdk/blazor-docx-editor) (Document Editor) component allows you to get the current word or paragraph content as plain text or SFDT (rich text).

## Select and get the word in current cursor position
## Select and get the word at the current cursor position

Use the [`SelectCurrentWordAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DocumentEditor.SelectionModule.html#Syncfusion_Blazor_DocumentEditor_SelectionModule_SelectCurrentWordAsync_System_Boolean_) API in the selection module to select the current word at the cursor position, and use the [`GetTextAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DocumentEditor.SelectionModule.html#Syncfusion_Blazor_DocumentEditor_SelectionModule_GetTextAsync) API to get the selected content as plain text from Blazor Document Editor component.
Use the [`SelectCurrentWordAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DocumentEditor.SelectionModule.html#Syncfusion_Blazor_DocumentEditor_SelectionModule_SelectCurrentWordAsync_System_Boolean_) API in the selection module to select the current word at the cursor position. Then, use the [`GetTextAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DocumentEditor.SelectionModule.html#Syncfusion_Blazor_DocumentEditor_SelectionModule_GetTextAsync) API to get the selected content as plain text from the Blazor Document Editor component.

The following example code illustrates how to select and get the current word as plain text.

Expand All @@ -29,9 +29,9 @@ The following example code illustrates how to select and get the current word as

public async void OnCreated(object args)
{
// To insert text in cursor position
await container.DocumentEditor.Editor.InsertTextAsync("Document editor");
// To select the current word in document
// To insert text at the cursor position
await container.DocumentEditor.Editor.InsertTextAsync("Document Editor");
// To select the current word in the document
await container.DocumentEditor.Selection.SelectCurrentWordAsync();
// To get the selected content as text
string selectedContent = await container.DocumentEditor.Selection.GetTextAsync();
Expand All @@ -41,9 +41,9 @@ The following example code illustrates how to select and get the current word as

To get the bookmark content as SFDT (rich text), check this [`link`](./get-the-selected-content).

## Select and get the paragraph in current cursor position
## Select and get the paragraph at the current cursor position

You can use [`SelectParagraphAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DocumentEditor.SelectionModule.html#Syncfusion_Blazor_DocumentEditor_SelectionModule_SelectParagraphAsync) API in selection module to select the current paragraph at cursor position and use [`GetTextAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DocumentEditor.SelectionModule.html#Syncfusion_Blazor_DocumentEditor_SelectionModule_GetTextAsync) API or [`GetSfdtAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DocumentEditor.SelectionModule.html#Syncfusion_Blazor_DocumentEditor_SelectionModule_GetSfdtAsync) API to get the selected content as plain text or SFDT from Blazor Document Editor component.
You can use the [`SelectParagraphAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DocumentEditor.SelectionModule.html#Syncfusion_Blazor_DocumentEditor_SelectionModule_SelectParagraphAsync) API in the selection module to select the current paragraph at the cursor position, and use the [`GetTextAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DocumentEditor.SelectionModule.html#Syncfusion_Blazor_DocumentEditor_SelectionModule_GetTextAsync) API or the [`GetSfdtAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DocumentEditor.SelectionModule.html#Syncfusion_Blazor_DocumentEditor_SelectionModule_GetSfdtAsync) API to get the selected content as plain text or SFDT from the Blazor Document Editor component.

The following example code illustrates how to select and get the current paragraph as SFDT.

Expand All @@ -59,9 +59,9 @@ The following example code illustrates how to select and get the current paragra

public async void OnCreated(object args)
{
// To insert text in cursor position
await container.DocumentEditor.Editor.InsertTextAsync("Document editor");
// To select the current paragraph in document
// To insert text at the cursor position
await container.DocumentEditor.Editor.InsertTextAsync("Document Editor");
// To select the current paragraph in the document
await container.DocumentEditor.Selection.SelectParagraphAsync();
// To get the selected content as SFDT
string selectedContent = await container.DocumentEditor.Selection.GetSfdtAsync();
Expand Down
Loading