This is a migrated thread and some comments may be shown as answers.

Problem With Export Method when Convert To ArrayByte

3 Answers 17 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
vahid
Top achievements
Rank 1
vahid asked on 17 Sep 2014, 12:11 PM
I Use of tow method for Import/Exort

public RadDocument ImportDocx()
{
RadDocument document = null;
IDocumentFormatProvider provider = new DocxFormatProvider();
OpenFileDialog openDialog = new OpenFileDialog();
openDialog.Filter = "Documents|*.docx";
openDialog.Multiselect = false;
bool? dialogResult = openDialog.ShowDialog();
if (dialogResult == true)
{
using (Stream stream = openDialog.File.OpenRead())
{
document = provider.Import(stream);
}
}
return document;
}

public void ExportToDocx(RadDocument document)
{
DocxFormatProvider provider = new DocxFormatProvider();
SaveFileDialog saveDialog = new SaveFileDialog();
saveDialog.DefaultExt = ".docx";
saveDialog.Filter = "Documents|*.docx";
bool? dialogResult = saveDialog.ShowDialog();
if (dialogResult == true)
{
using (Stream output = saveDialog.OpenFile())
{
provider.Export(document, output);
MessageBox.Show("Saved Successfuly!");
}
}
}
buuuuuuuuuut  the size of (output) variable not equal with (document) variable !!!!!!!!!
please help me








3 Answers, 1 is accepted

Sort by
0
Mihail
Telerik team
answered on 22 Sep 2014, 07:20 AM
Hello vahid,

 As you already noticed the input and output streams are with different length. This is expected and the reason behind this is that RadRichTextBox may not support all of the features used in the file and won't import the corresponding data.

I hope this information is helpful for you.

Regards,
Mihail
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
vahid
Top achievements
Rank 1
answered on 22 Sep 2014, 07:46 AM
Hi Mihail

when Convert Byte to RadDocument,Keep Not Font Color and ....

please help me
0
Petya
Telerik team
answered on 24 Sep 2014, 12:55 PM
Hi Vahid,

Rich text formatting such as font color is supported by RadRichTextBox, so I am not sure why you are experiencing this issue. Please provide us with the original document and we will further look into the cause of the behavior.

Regards,
Petya
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
RichTextBox
Asked by
vahid
Top achievements
Rank 1
Answers by
Mihail
Telerik team
vahid
Top achievements
Rank 1
Petya
Telerik team
Share this question
or