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
| Signature | Description |
|---|---|
AddParagraph(text: string, style: TextStyle) → *FloatingBox | AddParagraph appends a paragraph to the box. |
AddHeading(level: int, text: string, style: TextStyle) → *FloatingBox | AddHeading appends a heading (level 1–6) to the box. |
AddImage(path: string, width: float64) → *FloatingBox | AddImage appends an image (height ≤ 0 preserves aspect) to the box. |
AddImageAlt(path: string, width: float64, alt: string) → *FloatingBox | AddImageAlt appends an image with alternate text to the box. |
AddList(items: []string, ordered: bool, style: TextStyle) → *FloatingBox | AddList appends a bulleted/numbered list to the box. |
AddSpacer(height: float64) → *FloatingBox | AddSpacer appends vertical space to the box. |
SetBorder(border: BorderInfo) → *FloatingBox | SetBorder sets the box border. |
SetBackground(c: *Color) → *FloatingBox | SetBackground sets the box fill colour (nil = none). |
SetPadding(m: MarginInfo) → *FloatingBox | SetPadding sets the inner padding between the border and the content. |
SetSpacing(gap: float64) → *FloatingBox | SetSpacing sets the vertical gap between the box’s elements (default 6pt). |