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

Paste from esternal source issues

3 Answers 66 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Daní
Top achievements
Rank 1
Daní asked on 09 Jan 2013, 10:19 AM
Hi,

I have an application that allows users to create annotations that are persisted in a database and then can be retrievied read them. I have detected some formating errors when reading these annotations, some paragraphs are not shown, missing some text despite the full text is present in formatted xaml. I think the reason is a paste from an external source (worf, browser, pdf,...). After checking the erroneous annotations xaml, I can see non usuals font families as "Symbols" or "Wingdings".

How can I deal with this issues. What's the best strategy to allow paste from external source and formatting correctly?

thanks

3 Answers, 1 is accepted

Sort by
0
Petya
Telerik team
answered on 11 Jan 2013, 04:03 PM
Hello Dani,

I am a bit confused what is your exact scenario.

You say you are exporting/importing a document to a database. If this is the case, what is the relation with pasting from external format?

Overall, pasting from external sources such as MS Word or a browser will indeed result in loss of formatting due to Silverlight's clipboard not supporting rich-text. This should not be causing any loss of actual contents though - paragraphs, text and so on. As for your remark about the fonts - I am not sure what you mean. Was your document exported with those fonts and not imported correctly?

If you think it may help us in faster pinpointing the issue you can open a support ticket and attach the file you are trying to import, so we can investigate it. Any additional details will be appreciated.
 
Greetings,
Petya
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Daní
Top achievements
Rank 1
answered on 11 Jan 2013, 07:53 PM
Hi Petya,

Thanks for your interest.

First of all, my apologizes for my horrible explanation. I'll try to explain the scenario again.

Users can write annotations with a RichTextBox and save thes annotation to the backend. The backend saves the RadDocument xaml into a data base field. These annotations can be reviewed. I've received some incedences about bad formatting and 'losses' of some text fragments in a few of annotations. Revising these conflicting annotations I can observe that all of them are using non common fonts such as Symbol and Wingdings. I suspect this is the result of a paste from an external source.

Hope the scenario becomes more clear.

DanĂ­
0
Boby
Telerik team
answered on 15 Jan 2013, 07:42 AM
Hello DanĂ­,
The only way I can think of to create spans with fonts which are not among the default ones is through import process - for example from docx or RTF document. If the document is created on one machine and transferred to another (where the additional font is not present), this could lead to improper visualization of the span (for example with squares).
You can avoid such issue by validating that all spans/paragraphs in the document has fonts among the default fonts supported by Silverlight.

Kind regards,
Boby
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
RichTextBox
Asked by
Daní
Top achievements
Rank 1
Answers by
Petya
Telerik team
Daní
Top achievements
Rank 1
Boby
Telerik team
Share this question
or