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 @@ -4,14 +4,14 @@ description: Learn here all about how to export the inserted image as an Embedde
platform: document-processing
control: SfRichTextBoxAdv
documentation: ug
keywords: embedded-image-html
keywords: embedded-image-html,image-node-visited,html-import-export-settings,embedded-image,html-export,image-source
---

# Export Image as Embedded in HTML in UWP SfRichTextBoxAdv
# Export inserted image as embedded in HTML in UWP SfRichTextBoxAdv

This page explains how to export the inserted image as an Embedded image in HTML in Syncfusion® UWP SfRichTextBoxAdv.

In the SfRichTextBoxAdv control, we offer an option to specify HTML export settings. By utilizing the [ImageNodeVisitedEvent](https://help.syncfusion.com/cr/uwp/Syncfusion.UI.Xaml.RichTextBoxAdv.ImageNodeVisitedEventArgs.html) event of the [HtmlImportExportSettings](https://help.syncfusion.com/cr/uwp/Syncfusion.UI.Xaml.RichTextBoxAdv.HtmlImportExportSettings.html) instance, you can both retrieve and define the image stream and image source. When setting the image source as Empty, the inserted picture can be exported as an embedded image in the HTML.
SfRichTextBoxAdv lets you specify HTML export settings. By using the [`ImageNodeVisited`](https://help.syncfusion.com/cr/uwp/Syncfusion.UI.Xaml.RichTextBoxAdv.ImageNodeVisitedEventArgs.html) event of the [`HtmlImportExportSettings`](https://help.syncfusion.com/cr/uwp/Syncfusion.UI.Xaml.RichTextBoxAdv.HtmlImportExportSettings.html) instance, you can retrieve or set the image stream and image source. When you set the image source to an empty string, the inserted picture is exported as an embedded image in the HTML.

The following code example illustrates to export the inserted image as an Embedded image in HTML in the SfRichTextBoxAdv.

Expand All @@ -36,4 +36,9 @@ richTextBoxAdv.HtmlImportExportSettings.ImageNodeVisited += HtmlImportExportSett
// Unhooks the event handler for ImageNodeVisited event.
richTextBoxAdv.HtmlImportExportSettings.ImageNodeVisited -= HtmlImportExportSettings_ImageNodeVisited;
{% endhighlight %}
{% endtabs %}
{% endtabs %}

## See also

- [UWP RichTextBox Feature Tour](https://www.syncfusion.com/docx-editor-sdk/uwp-docx-editor)
- [UWP RichTextBox Examples](https://github.com/syncfusion/docx-editor-sdk-uwp-demos)
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,53 @@ description: Learn here all about how to identify whether the viewer is scrolled
platform: document-processing
control: SfRichTextBoxAdv
documentation: ug
keywords: scroll-to-bottom
keywords: scroll-to-bottom,scroll,verticalscrollbar,horizontalscrollbar,scrollbar,scrolling-events
---

# Detect viewer scrolled to bottom in UWP SfRichTextBoxAdv

This page explains how to identify whether the viewer is scrolled to the bottom in Syncfusion® UWP SfRichTextBoxAdv.
This page explains how to identify whether the viewer is scrolled to the bottom in the UWP [`SfRichTextBoxAdv`](https://help.syncfusion.com/cr/uwp/Syncfusion.UI.Xaml.RichTextBoxAdv.SfRichTextBoxAdv.html) control.

SfRichTextBoxAdv scrollbars can be accessed through the [VerticalScrollBar](https://help.syncfusion.com/cr/uwp/Syncfusion.UI.Xaml.RichTextBoxAdv.SfRichTextBoxAdv.html#Syncfusion_UI_Xaml_RichTextBoxAdv_SfRichTextBoxAdv_VerticalScrollBar) and [HorizontalScrollBar](https://help.syncfusion.com/cr/uwp/Syncfusion.UI.Xaml.RichTextBoxAdv.SfRichTextBoxAdv.html#Syncfusion_UI_Xaml_RichTextBoxAdv_SfRichTextBoxAdv_HorizontalScrollBar) properties of [SfRichTextBoxAdv](https://help.syncfusion.com/cr/uwp/Syncfusion.UI.Xaml.RichTextBoxAdv.SfRichTextBoxAdv.html) class. Using these properties, we can identify when the document is scrolled to the bottom of the control.
## Detecting scroll-to-bottom

We can use the ValueChanged event of the [VerticalScrollBar](https://help.syncfusion.com/cr/uwp/Syncfusion.UI.Xaml.RichTextBoxAdv.SfRichTextBoxAdv.html#Syncfusion_UI_Xaml_RichTextBoxAdv_SfRichTextBoxAdv_VerticalScrollBar) for this purpose. Check if the scroll bar's value equals the [VerticalScrollBar](https://help.syncfusion.com/cr/uwp/Syncfusion.UI.Xaml.RichTextBoxAdv.SfRichTextBoxAdv.html#Syncfusion_UI_Xaml_RichTextBoxAdv_SfRichTextBoxAdv_VerticalScrollBar) Maximum property value, if these values are equal then the vertical scroll bar has been scrolled to the bottom of the control.
SfRichTextBoxAdv exposes the document scroll bars through the [`VerticalScrollBar`](https://help.syncfusion.com/cr/uwp/Syncfusion.UI.Xaml.RichTextBoxAdv.SfRichTextBoxAdv.html#Syncfusion_UI_Xaml_RichTextBoxAdv_SfRichTextBoxAdv_VerticalScrollBar) and [`HorizontalScrollBar`](https://help.syncfusion.com/cr/uwp/Syncfusion.UI.Xaml.RichTextBoxAdv.SfRichTextBoxAdv.html#Syncfusion_UI_Xaml_RichTextBoxAdv_SfRichTextBoxAdv_HorizontalScrollBar) properties of the `SfRichTextBoxAdv` class. Using these properties, you can detect when the document is scrolled to the bottom of the control.

The following code example illustrates to identify whether the viewer is scrolled to the bottom of the SfRichTextBoxAdv.
Use the `ValueChanged` event of the `VerticalScrollBar` for this purpose. Check whether the scroll bar's value equals the `VerticalScrollBar.Maximum` value; if so, the vertical scroll bar has been scrolled to the bottom of the control.

The following code example illustrates how to identify whether the viewer is scrolled to the bottom of `SfRichTextBoxAdv`.

{% tabs %}
{% highlight c# %}
/// <summary>
/// Occurs when the element is laid out, rendered, and ready for interaction.
/// Occurs when the SfRichTextBoxAdv is loaded and ready for interaction.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The RoutedEventArgs instance containing the event data.</param>
private void RichTextBoxAdv_Loaded(object sender, RoutedEventArgs e)
{
if (richTextBoxAdv.VerticalScrollBar != null)
{
richTextBoxAdv.VerticalScrollBar.ValueChanged += VerticalScrollBar_ValueChanged;
}
}
private void RichTextBoxAdv_Loaded(object sender, RoutedEventArgs e)
{
if (richTextBoxAdv.VerticalScrollBar != null)
{
richTextBoxAdv.VerticalScrollBar.ValueChanged += VerticalScrollBar_ValueChanged;
}
}

/// <summary>
/// Occurs when vertical scrollbar value is changed.
/// Occurs when the vertical scroll bar value changes.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The RangeBaseValueChangedEventArgs instance containing the event data.</param>
private void VerticalScrollBar_ValueChanged(object sender, RangeBaseValueChangedEventArgs e)
{
if (e.NewValue == richTextBoxAdv.VerticalScrollBar.Maximum)
{
///When the scroll bar value and its maximum value are same.
///Then scroll reached the bottom of the control.
}
}
private void VerticalScrollBar_ValueChanged(object sender, RangeBaseValueChangedEventArgs e)
{
// When the scroll bar value equals its Maximum, the scroll has reached the bottom of the control.
if (e.NewValue == richTextBoxAdv.VerticalScrollBar.Maximum)
{
// Add your "reached the bottom" logic here.
}
}
{% endhighlight %}
{% endtabs %}
{% endtabs %}

## See also

- [UWP RichTextBox Feature Tour](https://www.syncfusion.com/docx-editor-sdk/uwp-docx-editor)
- [UWP RichTextBox Examples](https://github.com/syncfusion/docx-editor-sdk-uwp-demos)
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,26 @@ description: Learn here all about how to paste WordDocument from .NET Word libra
platform: document-processing
control: SfRichTextBoxAdv
documentation: ug
keywords: paste-WordDocument-from-DocIO
keywords: paste-WordDocument-from-DocIO,paste,worddocument,docio,pastecommand
---

# Paste WordDocument from DocIO in the UWP SfRichTextBoxAdv

The PasteCommand with [WordDocument](https://help.syncfusion.com/cr/file-formats/Syncfusion.DocIO.DLS.WordDocument.html) as a parameter is a feature that allows you to paste the contents of a WordDocument into the current selection of the SfRichTextBoxAdv control.This provides a convenient and efficient way to transfer and display complex document structures from Word documents directly within the SfRichTextBoxAdv.
The [`PasteCommand`](https://help.syncfusion.com/cr/uwp/Syncfusion.UI.Xaml.RichTextBoxAdv.SfRichTextBoxAdv.html#Syncfusion_UI_Xaml_RichTextBoxAdv_SfRichTextBoxAdv_PasteCommand) accepts a [`WordDocument`](https://help.syncfusion.com/cr/document-processing/Syncfusion.DocIO.DLS.WordDocument.html) as a parameter, allowing you to paste the contents of a Word document into the current selection of the [`SfRichTextBoxAdv`](https://help.syncfusion.com/cr/uwp/Syncfusion.UI.Xaml.RichTextBoxAdv.SfRichTextBoxAdv.html) control. This provides a convenient way to transfer and display complex document structures from Word documents directly within SfRichTextBoxAdv.

Using this feature, you can achieve below things by pasting WordDocument into the SfRichTextBoxAdv at current selection:
Using this feature, you can achieve the following by pasting a `WordDocument` into SfRichTextBoxAdv at the current selection:

* Perform all the document manipulation features of [.NET Word library (DocIO)](https://help.syncfusion.com/file-formats/docio/overview) and then finally insert into SfRichTextBoxAdv
* Perform all the document manipulation features of the [.NET Word library (DocIO)](https://help.syncfusion.com/document-processing/word/word-library/net/overview) and then finally insert the result into SfRichTextBoxAdv.

* Insert another [Word document](https://help.syncfusion.com/file-formats/docio/word-file-formats) (DOC, DOCX) and [HTML](https://help.syncfusion.com/file-formats/docio/html) document from DocIO.
* Insert another [Word document](https://help.syncfusion.com/document-processing/word/conversions/word-file-formats-conversions) (DOC, DOCX) and [HTML](https://help.syncfusion.com/document-processing/word/conversions/html-conversions) document from DocIO.

* Insert part of another Word document by retrieving the part of content using [bookmark functionality](https://help.syncfusion.com/file-formats/docio/working-with-bookmarks) in DocIO.
* Insert part of another Word document by retrieving a range of content using the [bookmark functionality](https://help.syncfusion.com/document-processing/word/word-library/net/working-with-bookmarks) in DocIO.

* Create new elements in scratch as per desired formatting such as [text](https://help.syncfusion.com/file-formats/docio/working-with-paragraph#working-with-text), [images](https://help.syncfusion.com/file-formats/docio/working-with-paragraph#working-with-images), [tables](https://help.syncfusion.com/file-formats/docio/working-with-tables) and more using DocIO and paste that WordDocument instance.
* Create new elements from scratch with the desired formatting, such as [text](https://help.syncfusion.com/document-processing/word/word-library/net/working-with-paragraph#working-with-text), [images](https://help.syncfusion.com/document-processing/word/word-library/net/working-with-paragraph#working-with-images), and [tables](https://help.syncfusion.com/document-processing/word/word-library/net/working-with-tables), using DocIO and paste that `WordDocument` instance.

The following code example illustrates how to design a table with set of formatting using DocIO and paste it into the SfRichTextBoxAdv using WordDocument.
## Pasting a WordDocument

The following code example illustrates how to design a table with applied formatting using DocIO and paste it into the SfRichTextBoxAdv using `WordDocument`.

{% tabs %}
{% highlight c# %}
Expand All @@ -30,50 +32,59 @@ WordDocument document = CreateTable();
richTextBoxAdv.PasteCommand.Execute(document);

/// <summary>
/// The following helper method illustrates how to create table in DocIO.
/// The following helper method illustrates how to create a table in DocIO.
/// </summary>
Private WordDocument CreateTable()
private WordDocument CreateTable()
{
///Creates an instance of WordDocument class
WordDocument document = new WordDocument();
///Adds a section into Word document
IWSection section = document.AddSection();
///Adds a new table into Word document
IWTable table = section.AddTable();
///Specifies the total number of rows & columns
table.ResetCells(10, 6);
///Iterates the rows of the table
for (int i = 0; i < table.Rows.Count; i++)
{
WTableRow wTableRow = table.Rows[i];
///Iterates through the cells of rows
for (int j = 0; j < wTableRow.Cells.Count; j++)
{
// Creates an instance of the WordDocument class.
WordDocument document = new WordDocument();
// Adds a section to the Word document.
IWSection section = document.AddSection();
// Adds a new table to the Word document.
IWTable table = section.AddTable();
// Specifies the total number of rows and columns.
table.ResetCells(10, 6);
// Iterates the rows of the table.
for (int i = 0; i < table.Rows.Count; i++)
{
WTableRow wTableRow = table.Rows[i];
// Iterates the cells of the row.
for (int j = 0; j < wTableRow.Cells.Count; j++)
{
WTableCell wTableCell = wTableRow.Cells[j];
///Specifies the left, right, top and bottom padding of the cell.
// Specifies the left, right, top, and bottom padding of the cell.
wTableCell.CellFormat.Paddings.Left = 7.5f;
wTableCell.CellFormat.Paddings.Top = 7.5f;
wTableCell.CellFormat.Paddings.Right = 7.5f;
wTableCell.CellFormat.Paddings.Bottom = 7.5f;
///set background color for cell.
// Sets the background color for the cell.
wTableCell.CellFormat.BackColor = Color.Blue;
///Set border type for tablecell borders
// Sets the border type for the table cell borders.
wTableCell.CellFormat.Borders.BorderType = BorderStyle.Single;
///Set color for tablecell borders
// Sets the color for the table cell borders.
wTableCell.CellFormat.Borders.Color = Color.Red;
wTableCell.CellFormat.Borders.Top.Color = Color.Red;
wTableCell.CellFormat.Borders.Bottom.Color = Color.Red;
wTableCell.CellFormat.Borders.Right.Color = Color.Red;
wTableCell.CellFormat.Borders.Left.Color = Color.Red;
///Set line width for tablecell borders.
wTableCell.CellFormat.Borders.LineWidth = 7.5f;
}
}
return WordDocument
}
}
return document;
}

{% endhighlight %}
{% endtabs %}

## Limitation
When the document content is pasted into the SfRichTextBoxAdv control using WordDocument as a parameter, the history will not be maintained. That is, if a table is created using WordDocument, with multiple formats applied, and then table is pasted into the SfRichTextBoxAdv control, performing Undo will remove the inserted table, and performing Redo will insert the table again. Since, we are creating table outside of SfRichTextBoxAdv and it will not maintain history.
When the document content is pasted into the SfRichTextBoxAdv control using WordDocument as a parameter, the history will not be maintained. That is, if a table is created using WordDocument, with multiple formats applied, and then table is pasted into the SfRichTextBoxAdv control, performing Undo will remove the inserted table, and performing Redo will insert the table again. Since, we are creating table outside of SfRichTextBoxAdv and it will not maintain history.

N> This feature is supported from v22.2.5.

## See also

- [PasteCommand API Reference](https://help.syncfusion.com/cr/uwp/Syncfusion.UI.Xaml.RichTextBoxAdv.SfRichTextBoxAdv.html#Syncfusion_UI_Xaml_RichTextBoxAdv_SfRichTextBoxAdv_PasteCommand)
- [.NET Word Library (DocIO) Documentation](https://help.syncfusion.com/file-formats/docio/overview)
- [UWP RichTextBox Feature Tour](https://www.syncfusion.com/docx-editor-sdk/uwp-docx-editor)
- [UWP RichTextBox Examples](https://github.com/syncfusion/docx-editor-sdk-uwp-demos)
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
---
title: How to use SfRichTextBoxAdv as a standard RichTextBox. | Syncfusion
title: How to use SfRichTextBoxAdv as a standard RichTextBox | Syncfusion
description: Learn how to use UWP SfRichTextBoxAdv as a standard RichTextBox along with its core key features and usage.
platform: document-processing
control: SfRichTextBoxAdv
documentation: ug
keywords: use-sfrichtextboxadv-like-richtextbox
keywords: use-sfrichtextboxadv-like-richtextbox,standard-richtextbox,toolbar
---

# Use SfRichTextBoxAdv as a standard RichTextBox
# Use SfRichTextBoxAdv as a standard RichTextBox in UWP

Use the following code to configure the SfRichTextBoxAdv control as a standard RichTextBox with rich text formatting options.

{% tabs %}
{% highlight xaml tabtitle="MainWindow.xaml" %}
{% highlight xaml tabtitle="MainPage.xaml" %}
<Page
x:Class="Standard_RichTextBox.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
Expand Down Expand Up @@ -111,7 +111,12 @@ Use the following code to configure the SfRichTextBoxAdv control as a standard R

{% endtabs %}

When the application is executed, the standard RichTextBox control is displayed as illustrated below.
![UWP Standard RichTextBox](../Getting-Started_images/uwp-standard-sfrichtextboxadv.png)
When you run the application, the standard RichTextBox control is displayed as illustrated below.
![SfRichTextBoxAdv used as a standard RichTextBox with built-in toolbar](../Getting-Started_images/uwp-standard-sfrichtextboxadv.png)

N> [View Sample in GitHub](https://github.com/SyncfusionExamples/UWP-RichTextBox-Examples/tree/main/Samples/Standard%20RichTextBox).
N> [View Sample in GitHub](https://github.com/SyncfusionExamples/UWP-RichTextBox-Examples/tree/main/Samples/Standard%20RichTextBox).

## See also

- [UWP RichTextBox Feature Tour](https://www.syncfusion.com/docx-editor-sdk/uwp-docx-editor)
- [UWP RichTextBox Examples](https://github.com/syncfusion/docx-editor-sdk-uwp-demos)
Loading