Flow

Overview

Flow is a type in Aspose.PDF FOSS for Go.

Flow is a document generator that lays content out top-to-bottom and paginates automatically — the “flow” counterpart to the Rectangle-based drawing API.

This type provides 13 methods for working with Flow objects in Go programs. Available methods include: AddColumnBreak, AddFloatBox, AddFloatingBox, AddHeading, AddImage, AddImageAlt, AddList, AddMarkdown, AddParagraph, AddSpacer, AddTable, Render, and 1 additional methods. All public members are accessible to any Go application after installing the Aspose.PDF FOSS for Go package.

Methods

SignatureDescription
AddParagraph(text: string, style: TextStyle)*FlowAddParagraph appends a paragraph of flowing text (wraps and splits across pages).
AddHeading(level: int, text: string, style: TextStyle)*FlowAddHeading appends a heading of the given level (1–6).
AddImage(path: string, width: float64)*FlowAddImage appends an image scaled to width×height points.
AddImageAlt(path: string, width: float64, alt: string)*FlowAddImageAlt is AddImage with alternate text (used when the flow is tagged).
AddTable(t: *Table)*FlowAddTable appends a table (paginated when taller than a page).
AddList(items: []string, ordered: bool, style: TextStyle)*FlowAddList appends a bulleted (ordered=false) or numbered list.
AddSpacer(height: float64)*FlowAddSpacer appends vertical space.
AddColumnBreak()*FlowAddColumnBreak forces the following content to start in the next column (or, from the last column, on the next page).
AddFloatingBox(box: *FloatingBox)*FlowAddFloatingBox appends a floating box, which takes its measured height in the flow (moving to a new page if it does not fit).
Render()(int, error)Render lays out the queued elements into the document and returns the number of pages the flow occupies.
AddFloatBox(box: *FloatingBox, side: FloatSide, width: float64)*FlowAddFloatBox appends a floated box pinned to the given side at width points; the paragraphs that follow wrap around it until the text passes its bottom.
SetMarkdownOptions(o: MarkdownOptions)*FlowSetMarkdownOptions sets the theme/options used by subsequent AddMarkdown calls on this flow (fonts, base size, image base path).
AddMarkdown(md: string)*FlowAddMarkdown appends a Markdown fragment to the flow: its blocks become flow elements (headings, paragraphs, lists, tables, images, …) rendered with the flow’s Markdown options.

See Also

 English