I've looked around trying to find an answer to this, but couldn't find anything relevant. Simply I want to control whether a row moves to a new page or splits across a page. In the below example, I want the second row to draw the first 50 pts on the first page and the remaining 25 pts on the second page.
void Main()
{
var doc = new PdfDocument();
doc.PageSettings.Size = new SizeF(100, 100);
doc.PageSettings.Margins = new PdfMargins { All = 0};
PdfPage page = doc.Pages.Add();
var parent = new PdfGrid();
parent.AllowRowBreakAcrossPages = true;
parent.Columns.Add(1);
// first row that is taller than the page
var row = parent.Rows.Add();
row.Height = 50;
// I want this row to split across the page break, so 50 on the first page and 25 on the next
row = parent.Rows.Add();
row.Height = 75;
parent.Draw(page, new RectangleF(0, 0, page.Size.Width, page.Size.Height));
using (var stream = new MemoryStream())
{
doc.Save(stream);
Display(stream.ToArray());
}
}
static void Display(byte[] pdf)
{
var proc = Process.GetProcessesByName("Acrobat").FirstOrDefault();
if (proc != null)
{
proc.Kill();
Thread.Sleep(100);
}
string filename = Path.GetTempFileName();
File.WriteAllBytes(filename, pdf);
Process.Start(@"C:\Program Files (x86)\Adobe\Acrobat DC\Acrobat\Acrobat.exe", filename);
}