# Small-format workshop badges

Generate two individual 340-by-255-point PDF workshop badges with participant names, roles and event details. Preview both pages and adapt the C# source.

PDF · C# walkthrough

Produce individual event badges without scaling an A4 report down to badge size.

[Build this report](#example-code)[Download PDF](/downloads/showcase/workflows/pdf-event-badges/example.pdf) [Try this file in your browser](/browser/inspect-pdf/)

Opens the generated download in a local browser tool. The C# example below creates the document.

**Start with**

Participant names, roles and event details

**Generate**

PDF

[!\[Generated PDF example: Small-format workshop badges\](/downloads/showcase/workflows/pdf-event-badges/preview.webp)](/downloads/showcase/workflows/pdf-event-badges/preview.png)

Page 1 · Generated by the example below

## How it works

1. ### Choose the stock size
  
  Set explicit page dimensions and margins.
2. ### Emphasise identity
  
  Give the name and role more space than event metadata.
3. ### Separate participants
  
  Create one page per badge for individual printing.

## The rest of the document

[!\[Small-format workshop badges: Badge 2\](/downloads/showcase/workflows/pdf-event-badges/page-2.png)](/downloads/showcase/workflows/pdf-event-badges/page-2.png)

Badge 2

## The C# source

The example below shows the document API and layout used for this report. Follow the PDF guide for package setup in your own project.

```csharp
using OfficeIMO.Drawing;
using OfficeIMO.Pdf;

namespace OfficeIMO.Examples.Showcase.Workflows {
    /// <summary>Creates two small-format event badges as separate PDF pages suitable for individual printing.</summary>
    internal static class EventBadges {
        internal static void Create(string folder) {
            OfficeTheme theme = OfficeTheme.Default;
            OfficeColor accent = theme.Palette.Accent1;
            OfficeColor muted = theme.Palette.TextMuted;
            // Each badge is trimmed from a slightly larger sheet: 3 pt of bleed and crop marks in an 18 pt slug.
            const double width = 340, height = 255, slug = 18, bleed = 3, markLength = 12, markGap = 3;
            double sheetWidth = width + slug * 2, sheetHeight = height + slug * 2;
            var cropMarks = new List<PdfPageBackgroundShape>();
            foreach (double trimX in new[] { slug, slug + width }) {
                foreach (double trimY in new[] { slug, slug + height }) {
                    double outwardX = trimX == slug ? -1 : 1, outwardY = trimY == slug ? -1 : 1;
                    cropMarks.Add(CropMark(OfficeShape.Line(0, 0, markLength, 0),
                        outwardX < 0 ? trimX - markGap - markLength : trimX + markGap, trimY));
                    cropMarks.Add(CropMark(OfficeShape.Line(0, 0, 0, markLength),
                        trimX, outwardY < 0 ? trimY - markGap - markLength : trimY + markGap));
                }
            }
            PdfDocument.Create(pdf => pdf.Content(content => {
                Badge("Maya Ellis", "Facilitator", "Service design");
                content.PageBreak();
                Badge("Leon Brooks", "Participant", "Operations");
                void Badge(string name, string role, string team) {
                    content.AddParagraph(p => p.AddText("Northwind · Community workshop").SetFontSize(OfficeLength.Points(8.5)), color: muted)
                        .HR(OfficeLength.Points(2), accent, OfficeLength.Points(8), OfficeLength.Points(14))
                        .Title(name)
                        .AddParagraph(p => p.AddText(role).SetBold().SetColor(accent).SetFontSize(OfficeLength.Points(13)))
                        .AddParagraph(p => p.AddText(team), color: muted)
                        .AddPanelParagraph(p => p.AddText("14 October 2026 · Copenhagen"));
                }
            }), new PdfCreateOptions {
                PageSetup = {
                    Size = new PdfPageSize(OfficeLength.Points(sheetWidth), OfficeLength.Points(sheetHeight)),
                    Margins = { Left = OfficeLength.Points(slug + 24), Right = OfficeLength.Points(slug + 24), Top = OfficeLength.Points(slug + 24), Bottom = OfficeLength.Points(slug + 24) }
                }, DefaultFontSize = OfficeLength.Points(10),
                PrintProductionPageBoxes = new PdfPrintProductionPageBoxes(PdfPageMargins.Uniform(OfficeLength.Points(slug)), PdfPageMargins.Uniform(OfficeLength.Points(slug - bleed))),
                PageBackgroundShapes = cropMarks
            })
                .Meta(title: "Workshop event badges", author: "OfficeIMO").Save(Path.Combine(folder, "example.pdf"));
        }

        private static PdfPageBackgroundShape CropMark(OfficeShape line, double x, double y) {
            line.StrokeColor = OfficeColor.Black;
            line.StrokeWidth = 0.25;
            return new PdfPageBackgroundShape(line, OfficeLength.Points(x), OfficeLength.Points(y));
        }
    }
}
```

[Open the C# source file](/downloads/showcase/workflows/pdf-event-badges/EventBadges.cs.txt)

## API used in this example

- [`OfficeLength`](/api/core/officeimo-officelength/)
- [`OfficeColor`](/api/core/officeimo-officecolor/)
- [`OfficeShape`](/api/core/officeimo-drawing-officeshape/)
- [`PdfPageBackgroundShape`](/api/pdf/officeimo-pdf-pdfpagebackgroundshape/)
- [`OfficeTheme`](/api/core/officeimo-officetheme/)
- [`PdfPageMargins`](/api/pdf/officeimo-pdf-pdfpagemargins/)
- [`PdfCreateOptions`](/api/pdf/officeimo-pdf-pdfcreateoptions/)
- [`PdfDocument`](/api/pdf/officeimo-pdf-pdfdocument/)
- [`PdfPageSize`](/api/pdf/officeimo-pdf-pdfpagesize/)
- [`PdfPrintProductionPageBoxes`](/api/pdf/officeimo-pdf-pdfprintproductionpageboxes/)

## Use this in your project

Set the page size to the intended stock and check a physical print before producing a batch.

The [PDF guide](/docs/pdf/authoring/) explains package setup and related document APIs.

## Documents and scope

### What the preview shows

The C# source generates the downloadable file. The runner checks PDF text and pages; Poppler renders the page previews.

### What to keep in mind

Set the page size to the intended stock and check a physical print before producing a batch.

[PDF API reference](/api/pdf/) · [Artifact hashes and provenance](/downloads/showcase/manifest.json)

## Continue with another example

- [PDF**A two-page workshop pack**](/showcase/pdf-workshop-pack/)
- [PDF**A branded invoice with embedded CII**](/showcase/pdf-branded-invoice/)

<!-- PowerForge markdown artifact sha256:B5B1FBD66A06262EA3576B16BA1A964ADDD2400F0B7FDE94018A825A37AC94F8 -->
