Quick start
This guide follows the current README.md example in the Flow repository. It creates a one-page PDF with a header, footer, and a line of text.
1. Set up a .NET project
Install the DynamicPDF.Flow package from NuGet:
dotnet add package DynamicPDF.Flow
Check the Flow repository for supported frameworks and release-specific setup details.
2. Create and save a document
using DynamicPDF.Flow;
Licensing.Community();
DocumentBuilder.Create()
.DefaultUnit(LengthUnit.Point)
.Title("DynamicPDF Flow sample")
.Author("Example application")
.Pages(page => page
.Size(PageSize.A4)
.Margins(48)
.Header(header => header.Center("DynamicPDF Flow sample"))
.Footer(footer => footer.Center("Page @{page} of @{total}"))
.Text("Hello from DynamicPDF Flow!"))
.Save("output.pdf");
The example uses Licensing.Community() as shown in the repository README. Choose the licensing setup that matches your use and the current terms in the repository's LICENSE.md before shipping an application.
The output path is relative to the process's current working directory. Create the output directory first if you use a path that includes one.
3. Understand the chain
DocumentBuilder.Create()starts a document after licensing has been configured.DefaultUnit(LengthUnit.Point)sets the default measurement unit for builder values that do not specify a unit.Title(...)andAuthor(...)set document metadata.Pages(...)creates a page and configures it in the callback.Save(...)writes the generated PDF to a file.
Next steps
- Learn how the document and page builders fit together in Core concepts.
- See Create a PDF for a smaller example and Add headers and footers for page furniture.
- Look up document and page methods in the API reference.
For current setup details, check the repository README and published releases.