How to get document contents of SfRichTextBoxAdv as text without formatting in WindowsPhone ?
How to get document contents of SfRichTextBoxAdv as text without formatting?
The SfRichTextBoxAdv control supports exporting the document contents to text files. With the help of this functionality, you can retrieve the document text without formatting.
The following Xaml code denotes how to initialize SfRichTextBoxAdv control.
Xaml
<RichTextBox:SfRichTextBoxAdv x:Name="richTextBoxAdv" xmlns:RichTextBox="using:Syncfusion.UI.Xaml.RichTextBoxAdv"/>
The following sample code snippet demonstrates to retrieve the document text of SfRichTextBoxAdv.
C#
// Initializes a stream Stream stream = new MemoryStream(); // Saves the SfRichTextBoxAdv content as Text format into the stream richTextBoxAdv.Save(stream, Syncfusion.UI.Xaml.RichTextBoxAdv.FormatType.Txt); stream.Position = 0; // Reads the text bytes from the stream byte[] textBytes = new byte[stream.Length]; stream.Read(textBytes, 0, textBytes.Length); // Gets the string from text bytes string text = System.Text.Encoding.GetEncoding("ASCII").GetString(textBytes, 0, textBytes.Length);
VB
' Initializes a stream Dim stream As Stream = New MemoryStream() ' Saves the SfRichTextBoxAdv content as Text format into the stream richTextBoxAdv.Save(stream, Syncfusion.UI.Xaml.RichTextBoxAdv.FormatType.Txt) stream.Position = 0 ' Reads the text bytes from the stream Dim textBytes As Byte() = New Byte(stream.Length - 1) {} stream.Read(textBytes, 0, textBytes.Length) ' Gets the string from text bytes Dim text As String = System.Text.Encoding.GetEncoding("ASCII").GetString(textBytes, 0, textBytes.Length)
Conclusion
I hope you enjoyed learning about how to get document contents of SfRichTextBoxAdv as text without formatting in WindowsPhone.
You can refer to our WindowsPhone SfRichTextBox featuretour page to know about its other groundbreaking feature representations and how to quickly get started for configuration specifications. You can also explore our example to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!