I have a C# program, and I created a table and put content into the cell, while the content format is a rich text format, the content was cut by the end of the page and didn’t get extend to put in a new page as I expected, here is the code:
DocumentModel document = new DocumentModel();
var section = new Section(document);
section.PageSetup.PageMargins = new PageMargins() { Top = 20, Header = 50, Footer = 10, Bottom = 0, Left = 20, Right = 20 };
document.Sections.Add(section);
var table = new Table(document);
table.TableFormat.Positioning.VerticalPosition = new VerticalPosition(90, LengthUnit.Pixel, VerticalPositionAnchor.Page);
table.TableFormat.AutomaticallyResizeToFitContents = false;
section.Blocks.Add(table);
var myCell= new TableCell(document);
var richTextControl = new BlockContentControl(document, ContentControlType.RichText, new Paragraph(document, ***sRichTextContent***) { ParagraphFormat = {KeepLinesTogether=false} });
myCell.Block.add(richTextControl );
var myRow= new TableRow(document);
myRow.Cells.Add(myCell);
table.Rows.Add(myRow);
MemoryStream ms = new MemoryStream();
byte[] bytes = ms.ToArray();
SendFile file = new SendFile();
file.FileName = "myPdfFile";
file.AttachmentData = bytes;
file.FileType = "pdf";
file.FileSize = bytes.Length;
document.Save(ms, SaveOptions.PdfDefault);
The sRichTextContent retains the input from a web page, which is in rich text format, and while I export the content to PDF format, the content is just on one page, and I can have the rest of the content got put into a new page.