Class FlowDocument

Namespace
SoftZenPdf.Layout
Assembly
SoftZenPdf.dll

A document of flowing content (paragraphs, tables, lists, images) that SoftZenPdf breaks into lines and pages: text wraps, tables continue across pages with their header rows, and headers, footers and page numbers are added to every page.

public sealed class FlowDocument
Inheritance
FlowDocument
Inherited Members

Examples

var flow = new FlowDocument();
flow.Blocks.Add(new Paragraph("Quarterly report", new TextStyle { FontSize = 20, Bold = true }) { OutlineLevel = 1 });
flow.Blocks.Add(new Paragraph("Text that wraps onto as many lines and pages as it needs..."));
flow.ToPdf().Save("report.pdf");

Properties

Blocks

The content, top to bottom.

CollapseSpacing

Whether the spacing between two blocks is the larger of the first one's space after and the second one's space before (as margins collapse in HTML), rather than their sum (as in word processors). Defaults to false.

CreateBookmarks

Whether paragraphs with an OutlineLevel become bookmarks. Defaults to true.

DefaultTextStyle

The style of text that sets none. Defaults to 11 pt black in the font provider's default family.

Fonts

The fonts text can use. Defaults to a provider with only the 14 standard fonts.

PageSetup

Page size, margins, headers and footers of the first pages (until a SectionBreak).

Warnings

Problems found by the last RenderTo(PdfDocument), such as characters no font has or links to unknown ids.

Methods

Add(params Block[])

Adds blocks to the end of the content.

RenderTo(PdfDocument)

Lays out the content and appends the resulting pages to document.

ToPdf()

Lays out the content into a new document.