Skip to main content Skip to footer

How to generate a page border with the featured graphics object in C#

Background:

How to generate a page border with the featured graphics object in C#

Steps to Complete:

DrawRectangle Method

public void CreatePDF(Stream stream)
        {
            GcPdfDocument doc = new GcPdfDocument();
            Page page = doc.NewPage();
            GcPdfGraphics g = page.Graphics;

            g.DrawString("Hello, World!",
                new TextFormat() { Font = StandardFonts.Times, FontSize = 12 },
                new PointF(72, 72));

            g.DrawRectangle(new RectangleF(36, 36, page.Size.Width - 72, page.Size.Height - 72), new Pen(Color.Black, 3));

            doc.Save(stream);
        }

Tags:

Mackenzie Albitz