Skip to content

Quick start

This page walks through your first render — from key to PDF — without touching the dashboard.

Export your key into the environment your application runs in:

Terminal window
export POLI_PAGE_API_KEY=pp_test_...
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.

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);