Skip to content

Quick start

using Papyra.Core;
// 1. Build the document
var document = Document.Create(doc => doc
.Table(table => table
.Columns(3)
.Row(row => row.Cell("Name").Cell("Age").Cell("City"))
.Row(row => row.Cell("Alice").Cell("30").Cell("Vienna"))
.Row(row => row.Cell("Bob").Cell("25").Cell("Berlin"))
)
);
// 2. Render to the desired format
byte[] pdf = document.RenderAsPdf();
byte[] docx = document.RenderAsDocx();
byte[] xlsx = document.RenderAsXlsx();

Write the bytes wherever you need them:

File.WriteAllBytes("report.pdf", pdf);
var document = Document.Create(doc => doc
.PageSize(PageSize.A4)
.Margin(48f)
.DefaultTextStyle(new TextStyle(FontSize: 10f))
.Paragraph(p => p.Text("Quarterly report",
new TextStyle(FontSize: 24f, FontWeight: FontWeight.Bold)))
.Paragraph(p => p.Text("All figures in GBP."))
);

Styles set closer to the content win; anything unset falls back to DefaultTextStyle. See styling and colors.

A license key is required to build - Papyra checks it at build time, not runtime. Community licenses are free - see licensing.

<PropertyGroup>
<PapyraLicense>your-license-key</PapyraLicense>
</PropertyGroup>