Rich Text Box Content

Rich Text Box Content

Forum member · Sep 24, 2009
I am generating a PDF from the rich text box content in a WPF application.The content is generating properly but the styles like bold,underline text is not comming properly.Here is the code snippet which is generating PDF. ceTe.DynamicPDF.Document document = new ceTe.DynamicPDF.Document(); ceTe.DynamicPDF.Page page = new ceTe.DynamicPDF.Page(PageSize.Letter, PageOrientation.Portrait, 54.0f); TextRange range = new TextRange(rtBehavioralLetter.Document.ContentStart, rtBehavioralLetter.Document.ContentEnd); page.Elements.Add(new TextArea(range.Text, 0, 0, 600, 800, Font.Helvetica, 12, TextAlign.Left)); document.Pages.Add(page); document.Draw(Constants.BEHAVIORALLETTERNAME); System.Diagnostics.Process.Start(Constants.BEHAVIORALLETTERNAME);

Re: Rich Text Box Content

Support · Sep 24, 2009
Hello, It is not possible to add rich text using the TextArea page element to the PDF document. The TextArea page element can add normal text only. The properties set to the TextArea object will be set to whole text and it is not possible to have different formatting to the text. If you want any formatting to the text then you will have to use the FormattedTextArea page element which can take the formatted text. You can refer to the help documentation for the supported tags . Thanks, ceTe Software Support Team.