Skip to main content

Licensing and DocumentBuilder

Licensing and DocumentBuilder

DocumentBuilder is the root builder for a Flow document. Configure licensing before calling Create(); the current implementation throws FlowLicensingException if no licensing method has been called.

Licensing​

The source exposes these methods:

MethodNotes
Licensing.Community()Configures the community option; used by the repository README example.
Licensing.Subscription()Configures the subscription option.
Licensing.Subscription(int year, int month, int date)Configures the date-taking subscription overload.

These calls satisfy Flow's configured-state check. Read the repository's current LICENSE.md for actual eligibility and licensing terms; this API summary does not define them.

Create and configure a document​

Licensing.Community();

var document = DocumentBuilder.Create()
.DefaultUnit(LengthUnit.Point)
.Title("Quarterly report")
.Author("Finance team")
.Subject("Quarterly results")
.Keywords("quarterly, report");

document.Pages(page => page
.Size(PageSize.A4)
.Margins(48)
.Text("Quarterly report"));

document.Save("report.pdf");

Members​

MemberPurpose
Create()Creates a document builder after licensing is configured.
DefaultUnit(LengthUnit)Sets the default measurement unit for subsequent builder operations.
Style(string) / Style(Action<StyleSheetBuilder>)Adds document-level style rules.
Title(string), Author(string), Subject(string), Keywords(string)Sets document metadata.
Pages(Action<PageBuilder>)Creates and configures one page.
Pages(int, Action<PageBuilder, int>)Creates a specified number of pages; the callback receives a zero-based page index.
Pdf(PdfSource, ...)Appends a PDF source, optionally selecting a page range and configuring merge options.
PrependPdf(PdfSource, ...)Inserts an imported PDF before the current entries.
Security(Action<SecurityBuilder>)Configures output security.
Outlines(Action<OutlineBuilder>)Adds outline entries.
Save(string)Writes the PDF to a file path.
SaveToStream(Stream)Writes the PDF to a stream.
SaveToByteArray()Returns the generated PDF bytes.

The document must contain at least one page or imported PDF before it is built. See PageBuilder, page content and elements, and the merge example.