---
title: "Create Business Card"
canonical: https://www.graphicsmill.com/samples/Codecs/Pdf/CreateBusinessCard_cs
product: "Graphics Mill"
source: "Codecs/Pdf/CreateBusinessCard.cs"
---

# Create Business Card

Creates business card in PDF format.

## Instruction

Write a C# program that creates a business card layout in a PDF format.

## Usings

```csharp
using Aurigma.GraphicsMill.Codecs;
using Aurigma.GraphicsMill.Drawing;
```

## Code Snippet

```csharp
using (var writer = new PdfWriter("CreateBusinessCard.pdf"))
{
    int width = 350;
    int height = 200;

    using (var graphics = writer.GetGraphics())
    {
        // Front side
        writer.AddPage(width, height, RgbColor.White);

        var blueBrush = new SolidBrush(RgbColor.DeepSkyBlue);

        // Draw circle
        graphics.DrawEllipse(new Pen(RgbColor.DeepSkyBlue, 2f), 15f, 20f, 30f, 30f);

        // Draw text
        var font = graphics.CreateFont("Arial", 18f);
        var text = new PlainText("Front side", font, new SolidBrush(RgbColor.Gray), 95f, 41f, TextAlignment.Center);
        graphics.DrawText(text);

        font = graphics.CreateFont("Arial", 16f);
        text = new PlainText("<span>John Doe</span><br/><span style='color:gray;font-size:16pt'>General Manager</span>", font, blueBrush, 335f, 100f, TextAlignment.Right);

        graphics.DrawText(text);

        graphics.FillRectangle(blueBrush, 0, height - 50, width, 50);

        font = graphics.CreateFont("Arial", 12f);
        text = new PlainText(@"<span>123.456.7890</span><br/><span>info@website.com</span>", font, new SolidBrush(RgbColor.White), 15f, 170f, TextAlignment.Left);

        graphics.DrawText(text);

        text = new PlainText("<span>335 Cloverfield Blvd</span><br/><span>Charlington, NY 10123</span>", font, new SolidBrush(RgbColor.White), 200f, 170f, TextAlignment.Left);

        graphics.DrawText(text);

        // Back side
        writer.AddPage(width, height, RgbColor.DeepSkyBlue);

        graphics.DrawEllipse(new Pen(RgbColor.White, 3f), 65f, 72f, 55f, 55f);

        font = graphics.CreateFont("Arial", 36);

        text = new PlainText("Back side", font, new SolidBrush(RgbColor.White), 140f, 112f, TextAlignment.Left);
        graphics.DrawText(text);
    }
}
```

## Explanation

Below is a C# code sample that demonstrates how to create a business card in PDF format. The code draws the front and back sides with text and graphics, such as circles and rectangles, using `PdfWriter`:

This code generates a business card with personal information, contact details, and two pages representing the front and back sides.

## Tags

- [Drawing](<https://www.graphicsmill.com/samples/tags/drawing_md>): Drawing vector shapes and text
- [Filesystem](<https://www.graphicsmill.com/samples/tags/filesystem_md>): Loading and saving images from files
- [PDF](<https://www.graphicsmill.com/samples/tags/pdf_md>): Importing and exporting PDF documents
- [Text](<https://www.graphicsmill.com/samples/tags/text_md>): Rendering and formatting text
- [Write](<https://www.graphicsmill.com/samples/tags/write_md>): Writing images with codecs

## Output

- [CreateBusinessCard.pdf](<https://www.graphicsmill.com/samples/Codecs/compiled/Debug/CreateBusinessCard_pdf>) (download)
- [CreateBusinessCard.png](<https://www.graphicsmill.com/samples/Codecs/compiled/Debug/CreateBusinessCard_png>) (preview)

## Used APIs

- [Aurigma.GraphicsMill.Codecs.PdfWriter](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Codecs_PdfWriter.htm.md>)
- [Aurigma.GraphicsMill.Codecs.PdfWriter.AddPage(Single,Single,Color)](<https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_Codecs_PdfWriter_AddPage_3_edd08af9.htm.md>)
- [Aurigma.GraphicsMill.Codecs.PdfWriter.GetGraphics](<https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_Codecs_PdfWriter_GetGraphics.htm.md>)
- [Aurigma.GraphicsMill.Drawing.Graphics.CreateFont(String,Single)](<https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_Drawing_Graphics_CreateFont_2_1dbfa9fa.htm.md>)
- [Aurigma.GraphicsMill.Drawing.Graphics.DrawEllipse(Pen,Single,Single,Single,Single)](<https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_Drawing_Graphics_DrawEllipse_5_b3708ac1.htm.md>)
- [Aurigma.GraphicsMill.Drawing.Graphics.DrawText(Text)](<https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_Drawing_Graphics_DrawText_1_f576d03f.htm.md>)
- [Aurigma.GraphicsMill.Drawing.Graphics.FillRectangle(Brush,Single,Single,Single,Single)](<https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_Drawing_Graphics_FillRectangle_5_2d30ad96.htm.md>)
- [Aurigma.GraphicsMill.Drawing.Pen](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Drawing_Pen.htm.md>)
- [Aurigma.GraphicsMill.Drawing.PlainText](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Drawing_PlainText.htm.md>)
- [Aurigma.GraphicsMill.Drawing.SolidBrush](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Drawing_SolidBrush.htm.md>)
- [Aurigma.GraphicsMill.Drawing.TextAlignment](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Drawing_TextAlignment.htm.md>)
