Como adicionar um rico Textbox (HTML) a uma célula da tabela?
Eu tenho uma caixa de rich text chamada: "DocumentContent", que adicionarei seu conteúdo ao pdf usando o código abaixo:
iTextSharp.text.Font font = FontFactory.GetFont(@"C:\Windows\Fonts\arial.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED, 12f, Font.NORMAL, BaseColor.BLACK);
DocumentContent = System.Web.HttpUtility.HtmlDecode(DocumentContent);
Chunk chunkContent = new Chunk(DocumentContent);
chunkContent.Font = font;
Phrase PhraseContent = new Phrase(chunkContent);
PhraseContent.Font = font;
PdfPTable table = new PdfPTable(2);
table.WidthPercentage = 100;
PdfPCell cell;
cell = new PdfPCell(new Phrase(PhraseContent));
cell.Border = Rectangle.NO_BORDER;
table.AddCell(cell);
O problema é que, quando abro o arquivo PDF, o conteúdo aparece como HTML, não como texto, como abaixo:
<p>Overview  line1 </p><p>Overview  line2
</p><p>Overview  line3 </p><p>Overview 
line4</p><p>Overview  line4</p><p>Overview 
line5 </p>
Mas deve parecer como abaixo
Overview line1
Overview line2
Overview line3
Overview line4
Overview line4
Overview line5
O que vou fazer é manter todo o estilo que o usuário aplica ao rich text e apenas alterar a família de fontes para Arial.
Posso alterar a família de fontes, mas preciso decodificar esse conteúdo de HTML para texto.
Você poderia avisar, por favor? obrigado