Skip to main content

Quick start

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​

  1. DocumentBuilder.Create() starts a document after licensing has been configured.
  2. DefaultUnit(LengthUnit.Point) sets the default measurement unit for builder values that do not specify a unit.
  3. Title(...) and Author(...) set document metadata.
  4. Pages(...) creates a page and configures it in the callback.
  5. Save(...) writes the generated PDF to a file.

Next steps​

For current setup details, check the repository README and published releases.