MarkupConverter | This sample shows how convert from HTML RTF , RTF | Document Editor library
kandi X-RAY | MarkupConverter Summary
kandi X-RAY | MarkupConverter Summary
This sample shows how to convert from HTML to RTF, RTF to HTML, XAML to HTML and HTML to XAML.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of MarkupConverter
MarkupConverter Key Features
MarkupConverter Examples and Code Snippets
Community Discussions
Trending Discussions on MarkupConverter
QUESTION
I have an RTF
format text, received from a UWP RichEditBox
by calling Editor.Document.GetText(TextGetOptions.FormatRtf, out string rtf);
. I need to convert it to an html, but the best solution what I found is the MarkupConverter
. Anyway, this uses a WPF RichTextBox
, which loads the RTF formatted text, then gets from there as an XAML, and then converts it to HTML.
The problem is that if I set a bigger font size, in RTF displays as \fs44
, and when it converts to XAML, it is shown the following way: FontSize="34.666666666666664"
. I would like to see FontSize="34pt"
(or 35, doesn't matter).
I understand why is this happening, but is there a way to tell the RichTextBox to round it and put that pt text?
I would be also thankful if you can suggest a better way to convert RTF to HTML.
...ANSWER
Answered 2021-Feb-03 at 13:50I solved it by searching and replacing the font sizes in the html with a regexp:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install MarkupConverter
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page