PdfFlowContainer Class
A sequence of blocks of a flow document: headings, paragraphs, lists, images, tables, rules and spaces, laid out from top to bottom. PdfFlowDocument is the container of the pages; the cells of a table are containers too.
public class PdfFlowContainerMethods
| Name | Description |
|---|---|
| Heading(int, string) | Adds a heading (H1 to H6), in the heading font, larger for the higher levels. It is kept on the page of the block that follows it, and added to the outline and the table of contents. |
| Image(PdfImage, string, double?) | Adds an image (Figure), with its alternate description, which screen readers read. |
| List(IEnumerable<Action<PdfFlowContainer>>, bool) | Adds a list (L) whose items hold blocks, such as paragraphs and nested lists. |
| List(IEnumerable<string>, bool) | Adds a list (L) of items of text: each item (LI) has a label (Lbl), a bullet or its number, and a body (LBody). |
| Paragraph(Action<PdfInlineBuilder>, PdfParagraphStyle?) | Adds a paragraph (P) of runs of text, each with its style, and links. |
| Paragraph(string, PdfParagraphStyle?) | Adds a paragraph (P) of text in the style of the document. |
| Rule(PdfColor?, double) | Adds a horizontal rule, an artifact. |
| Spacer(double) | Adds an empty space. |
| Table(Action<PdfFlowTableBuilder>) | Adds a table (Table): header rows (THead, TH), rows (TBody, TR, TD) and cells that hold blocks and span columns and rows. |
Heading(int, string)
PdfFlowContainer.csAdds a heading (H1 to H6), in the heading font, larger for the higher levels. It is kept on the page of the block that follows it, and added to the outline and the table of contents.
public PdfFlowContainer Heading(int level, string text)Parameters
Returns
PdfFlowContainer The container.
Exceptions
ArgumentOutOfRangeExceptionlevelis not between 1 and 6.
Image(PdfImage, string, double?)
PdfFlowContainer.csAdds an image (Figure), with its alternate description, which screen readers read.
public PdfFlowContainer Image(PdfImage image, string alternateDescription, double? width = null)Parameters
imagePdfImage- The image.
alternateDescriptionstring- The description of the image.
widthdouble?- The width of the image, in points, or
nullfor the width of the container (smaller images keep their size of 1 point per pixel). The height keeps the ratio of the image, and the image is scaled down to fit a page.
Returns
PdfFlowContainer The container.
List overloads
List(IEnumerable<Action<PdfFlowContainer>>, bool)
PdfFlowContainer.csAdds a list (L) whose items hold blocks, such as paragraphs and nested lists.
public PdfFlowContainer List(IEnumerable<Action<PdfFlowContainer>> items, bool ordered = false)Parameters
itemsIEnumerable<Action<PdfFlowContainer>>- The functions that add the blocks of each item.
orderedbool- Whether the items are numbered (1., 2., 3.) instead of bulleted.
Returns
PdfFlowContainer The container.
List(IEnumerable<string>, bool)
PdfFlowContainer.csAdds a list (L) of items of text: each item (LI) has a label (Lbl), a bullet or its number, and a body (LBody).
public PdfFlowContainer List(IEnumerable<string> items, bool ordered = false)Parameters
itemsIEnumerable<string>- The texts of the items.
orderedbool- Whether the items are numbered (1., 2., 3.) instead of bulleted.
Returns
PdfFlowContainer The container.
Paragraph overloads
Paragraph(Action<PdfInlineBuilder>, PdfParagraphStyle?)
PdfFlowContainer.csAdds a paragraph (P) of runs of text, each with its style, and links.
public PdfFlowContainer Paragraph(Action<PdfInlineBuilder> build, PdfParagraphStyle? style = null)Parameters
buildAction<PdfInlineBuilder>- The function that adds the runs.
stylePdfParagraphStyle?- The style of the paragraph, or
nullfor the default.
Returns
PdfFlowContainer The container.
Paragraph(string, PdfParagraphStyle?)
PdfFlowContainer.csAdds a paragraph (P) of text in the style of the document.
public PdfFlowContainer Paragraph(string text, PdfParagraphStyle? style = null)Parameters
textstring- The text. A line feed breaks the line.
stylePdfParagraphStyle?- The style of the paragraph, or
nullfor the default.
Returns
PdfFlowContainer The container.
Rule(PdfColor?, double)
PdfFlowContainer.csAdds a horizontal rule, an artifact.
public PdfFlowContainer Rule(PdfColor? color = null, double width = 0.5d)Parameters
colorPdfColor?- The color of the rule, or
nullfor gray. widthdouble- The width of the line, in points.
Returns
PdfFlowContainer The container.
Spacer(double)
PdfFlowContainer.csAdds an empty space.
public PdfFlowContainer Spacer(double height)Table(Action<PdfFlowTableBuilder>)
PdfFlowContainer.csAdds a table (Table): header rows (THead, TH), rows (TBody, TR, TD) and cells that hold blocks and span columns and rows.
public PdfFlowContainer Table(Action<PdfFlowTableBuilder> build)Parameters
buildAction<PdfFlowTableBuilder>- The function that adds the columns and the rows.
Returns
PdfFlowContainer The container.
Exceptions
ArgumentException- The table has no row, or its cells do not fit its columns.