using OfficeIMO.Pdf; namespace OfficeIMO.Examples.Showcase.Workflows; /// Creates a dispatch note with shipment details, item rows, and delivery instructions. internal static class DispatchNote { internal static void Create(string folder) { OfficeColor muted = OfficeTheme.Default.Palette.TextMuted; string[][] items = { new[] { "Item", "Reference", "Quantity", "Package" }, new[] { "Laptop workstation", "NW-LT-14", "8", "Cartons 1–4" }, new[] { "USB-C docking station", "NW-DK-02", "8", "Carton 5" }, new[] { "27-inch monitor", "NW-MN-27", "8", "Cartons 6–13" } }; PdfDocument.Create(pdf => pdf.Content(content => content .Title("Dispatch note") .AddParagraph(p => { p.AddText("DN-2026-0418").SetBold(); p.AddText(" · Northwind equipment services"); }) .H2("Deliver to") .AddParagraph(p => p.AddText("Northwind Delivery Centre\nReceiving desk, Building B\nScheduled delivery: 18 September 2026")) .AddTable(items) .AddPanelParagraph(p => { p.AddText("Receiving instructions\n").SetBold(); p.AddText( "Check all 13 cartons against this note. Record visible damage before accepting the shipment."); }) .H2("Receipt") .Row(row => row.Gap(OfficeLength.Points(24)) .RelativeColumn(column => column.Spacer(OfficeLength.Points(28)).HR(OfficeLength.Points(0.75), muted, OfficeLength.Points(0), OfficeLength.Points(3)).AddParagraph(p => p.AddText("Received by"), color: muted), 2) .RelativeColumn(column => column.Spacer(OfficeLength.Points(28)).HR(OfficeLength.Points(0.75), muted, OfficeLength.Points(0), OfficeLength.Points(3)).AddParagraph(p => p.AddText("Date"), color: muted), 1)) .AddParagraph(p => p.AddText("Sample logistics document. Quantities and references are demonstration data.").SetFontSize(OfficeLength.Points(9)), color: muted)), new PdfCreateOptions { PageSetup = { Footer = { Show = true } } }) .Meta(title: "Dispatch note DN-2026-0418", author: "OfficeIMO") .Save(Path.Combine(folder, "example.pdf")); } }