Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Small-format workshop badges

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

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
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
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.

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) {
            var navy = PdfColor.FromRgb(23, 54, 93);
            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.Paragraph(p => p.Text("NORTHWIND / COMMUNITY WORKSHOP"))
                        .HR(2, navy, 12, 18)
                        .H1(name, PdfAlign.Left, navy)
                        .H2(role, PdfAlign.Left, navy)
                        .Paragraph(p => p.Text(team))
                        .PanelParagraph(p => p.Text("14 OCT 2026  |  COPENHAGEN"),
                            new PdfPanelStyle { Background = PdfColor.FromRgb(234, 241, 251), PaddingX = 10, PaddingY = 10 });
                }
            }), new PdfOptions { PageWidth = 340, PageHeight = 255, MarginLeft = 24, MarginRight = 24, MarginTop = 24, MarginBottom = 24, DefaultFontSize = 10 })
                .Meta(title: "Workshop event badges", author: "OfficeIMO").Save(Path.Combine(folder, "example.pdf"));
        }
    }
}
Open the C# source file

API used in this example

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 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 · Artifact hashes and provenance

Continue with another example

Example source

Download source