//Set the properties to paginate the text.
PdfLayoutFormat layoutFormat = new PdfLayoutFormat();
layoutFormat.Break = PdfLayoutBreakType.FitPage;
layoutFormat.Layout = PdfLayoutType.Paginate;
//Draw the text element with the properties and formats set.
PdfTextLayoutResult result = element.Draw(page, bounds, layoutFormat);
// Set bounds of next text based on last layout bounds
bounds = new RectangleF( result.LastLineBounds.X , result.LastLineBounds.Y+20, page.Graphics.ClientSize.Width, page.Graphics.ClientSize.Height);
// Use the PdfTextLayoutResult Page propoerty whihch gets the last layout page after pagination.
element.Draw(result.Page, bounds, layoutFormat);
|