private void EndPageLayout(object sender, EndPageLayoutEventArgs e) { EndTextPageLayoutEventArgs args = (EndTextPageLayoutEventArgs)e; PdfPage page = args.Result.Page; PdfPen pen = PdfPens.Black; page.Graphics.DrawRectangle(pen, new RectangleF(Point.Empty, page.Graphics.ClientSize)); }
private void EndPageLayout2(object sender, EndPageLayoutEventArgs e) { EndTextPageLayoutEventArgs args = (EndTextPageLayoutEventArgs)e; PdfTextLayoutResult tlr = args.Result; RectangleF bounds = tlr.Bounds; args.NextPage = tlr.Page; }
/// <summary> /// Draw border for each page in the document. /// </summary> private void EndPageLayout(object sender, EndPageLayoutEventArgs e) { PdfPage page = e.Result.Page; page.Graphics.DrawRectangle(PdfPens.Black, new RectangleF(PointF.Empty, page.Graphics.ClientSize)); }