Flow

Overview

Flow is a class in Aspose.PDF FOSS for TypeScript.

A flow layout container.

This class declares 14 methods for Flow objects in TypeScript programs. Available methods include: AddCodeBlock, AddColumnBreak, AddFloatBox, AddFloatingBox, AddHeading, AddImage, AddList, AddMarkdown, AddParagraph, AddQuote, AddRule, AddTable, and 2 additional methods. All public members are accessible to any TypeScript application after installing the Aspose.PDF FOSS for TypeScript package.

Methods

SignatureDescription
constructor(doc: Document, options: FlowOptions)Calls constructor(doc, options) on this Flow instance.
AddParagraph(text: FlowText, options: FlowParagraphOptions)thisAppend a word-wrapped paragraph.
AddHeading(level: number, text: FlowText, options: FlowHeadingOptions)thisAppend a word-wrapped heading.
AddList(items: FlowListNode[], options: FlowListOptions)thisAppend a bullet (default) or numbered ({ ordered: true }) list.
AddImage(data: Uint8Array, options: FlowImageOptions)thisAppend a raster image (JPEG/PNG) as its own flow block.
AddRule(options: FlowRuleOptions)thisAppend a horizontal rule — a section divider, and Markdown’s thematic break.
AddCodeBlock(text: string, options: FlowCodeOptions)thisAppend a preformatted code block.
AddQuote(blocks: FlowElement[], options: FlowQuoteOptions)thisAppend a block quote: the given elements, indented behind a gutter bar.
AddTable(t: TableBuilder, options: FlowTableOptions)thisAppend a table built with createTable, paginating by row across columns and pages.
AddMarkdown(src: string | MdDocument, options: MarkdownFlowOptions)MarkdownResultAppend a Markdown document: CommonMark 0.31.2, or GFM with { gfm: true }.
AddColumnBreak()thisForce the following content to start in the next column (next page if in the last column).
AddFloatBox(box: FloatingBox, side: 'left' | 'right')thisFloat box to the left or right of the column; following flow text wraps in the narrowed channel beside it and resumes full width below.
AddFloatingBox(box: FloatingBox, options: FlowBoxOptions)thisPlace box in the flow itself — a pull-quote, callout or formula card.
Render()Page[]Lay out the queued content, appending fresh pages at the end of the document, and return those pages in order.