The "txtContent.Text" is a CKEditor richtext box. Spire.PDF is able to read the textbox but the format isn't what it looks like in the textbox. It doesn't add all the HTML elements like bullets and carriage returns. What am I doing wrong?
- Code: Select all
PdfDocument Doc= new PdfDocument();
PdfNewPage page = Doc.Pages.Add(PdfPageSize.Note) as PdfNewPage;
PdfFont font = new PdfFont(PdfFontFamily.Helvetica,2,PdfFontStyle.Regular);
PdfBrush brush = PdfBrushes.Black;
PdfHTMLTextElement kbContent = new PdfHTMLTextElement(txtContent.Text, font, brush);
kbContent.TextAlign = Spire.Pdf.Graphics.TextAlign.Left;
PdfMetafileLayoutFormat format = new PdfMetafileLayoutFormat();
format.Layout = PdfLayoutType.Paginate;
format.Break = PdfLayoutBreakType.FitPage;
kbContent.Draw(page, new RectangleF(0, 0, page.GetClientSize().Width, page.GetClientSize().Height), format);