Quick start
This page walks through your first render — from key to PDF — without touching the dashboard.
Set your API key
Section titled “Set your API key”Export your key into the environment your application runs in:
export POLI_PAGE_API_KEY=pp_test_...Render a PDF
Section titled “Render a PDF”using PoliPage;
var client = new PoliPageClient(new PoliPageClientOptions{ ApiKey = Environment.GetEnvironmentVariable("POLI_PAGE_API_KEY")!,});
byte[] pdf = await client.Render.PdfAsync(new ProjectModeInput{ Project = "billing", Template = "invoice", Version = "1.0.0", Data = new Dictionary<string, object> { { "invoiceNumber", "INV-001" }, { "total", 1280 }, },});pdf is a byte[]. Write it to disk, upload to S3, or return it directly from an HTTP handler.
Example
Section titled “Example”using PoliPage;
var client = new PoliPageClient(new PoliPageClientOptions{ ApiKey = Environment.GetEnvironmentVariable("POLI_PAGE_API_KEY")!,});
byte[] pdf = await client.Render.PdfAsync(new ProjectModeInput{ Project = "billing", Template = "invoice", Version = "1.0.0", Data = new Dictionary<string, object> { { "invoiceNumber", "INV-001" }, { "total", 1280 }, },});
await File.WriteAllBytesAsync("./invoices/INV-001.pdf", pdf);