FloatingBox

Overview

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

FloatingBox is a positioned content container (Tier 2 of the flow model): a box with an optional border, background and padding that lays its own content (paragraphs, headings, images, lists) inside its width.

This type provides 10 methods for working with FloatingBox objects in Go programs. Available methods include: AddHeading, AddImage, AddImageAlt, AddList, AddParagraph, AddSpacer, SetBackground, SetBorder, SetPadding, SetSpacing. 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)*FloatingBoxAddParagraph appends a paragraph to the box.
AddHeading(level: int, text: string, style: TextStyle)*FloatingBoxAddHeading appends a heading (level 1–6) to the box.
AddImage(path: string, width: float64)*FloatingBoxAddImage appends an image (height ≤ 0 preserves aspect) to the box.
AddImageAlt(path: string, width: float64, alt: string)*FloatingBoxAddImageAlt appends an image with alternate text to the box.
AddList(items: []string, ordered: bool, style: TextStyle)*FloatingBoxAddList appends a bulleted/numbered list to the box.
AddSpacer(height: float64)*FloatingBoxAddSpacer appends vertical space to the box.
SetBorder(border: BorderInfo)*FloatingBoxSetBorder sets the box border.
SetBackground(c: *Color)*FloatingBoxSetBackground sets the box fill colour (nil = none).
SetPadding(m: MarginInfo)*FloatingBoxSetPadding sets the inner padding between the border and the content.
SetSpacing(gap: float64)*FloatingBoxSetSpacing sets the vertical gap between the box’s elements (default 6pt).

See Also

 English