/// <summary> /// Extract RTF text to HTML /// </summary> /// <param name="bodyRtf">The RTF in bytes</param> /// <param name="length">The length of the body to use</param> /// <returns>RTF converted to HTML</returns> public static string extractRtf2HtmlAsStaThread(byte[] bodyRtf, int length) { string retVal = string.Empty; Thread thread = new Thread(() => { retVal = HtmlFromXamlConverter.extractRtf2Html(bodyRtf, length); }); thread.SetApartmentState(ApartmentState.STA); thread.Start(); thread.Join(); return(retVal); }
public void convertContent2(object sender, RoutedEventArgs e) { myTextBox2.Text = HtmlFromXamlConverter.ConvertXamlToHtml(myTextBox2.Text); MessageBox.Show("Content Conversion Complete!"); }