Can't find what you're looking for?

Contact us or post in our forums and we'll help you find an answer.

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);
        }

Get the Latest Version of Documents for PDF for .NET
Download the Free Trial Now