FloatingBox
Overview
FloatingBox is a class in Aspose.PDF FOSS for TypeScript.
A padded/bordered/filled box of paragraphs and/or an image, floated into a {@link Flow} column by flow.AddFloatBox.
This class declares 7 methods for FloatingBox objects in TypeScript programs.
Available methods include: AddImage, AddParagraph, constructor, contentWidth, layoutItems, measure, paintAt.
All public members are accessible to any TypeScript application after installing the Aspose.PDF FOSS for TypeScript package.
Properties: alt, background, border, borderWidth, color, heights, and 5 more.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
width | : number | Read | Gets the width. |
spacing | : number | Read | Gets the spacing. |
padding | : Padding | Read | @internal |
borderWidth | : number | Read | @internal |
border | : { width: number; color: [number, number, number]; sides?: BorderSides } | Read | @internal |
width | : number | Read | Gets the width. |
color | : [number, number, number] | Read | Gets the color. |
sides | : BorderSides | Read | Gets the sides. |
background | : [number, number, number] | Read | @internal |
alt | : string | Read | @internal |
heights | : number[] | Read | Gets the heights. |
total | : number | Read | Gets the total. |
Methods
| Signature | Description |
|---|---|
constructor(doc: Document, options: FloatBoxOptions) | Calls constructor(doc, options) on this FloatingBox instance. |
contentWidth() → number | Content width: outer width minus horizontal padding and both borders. |
AddParagraph(text: string, options: FlowParagraphOptions) → this | Append a word-wrapped paragraph inside the box. |
AddImage(data: Uint8Array, options: FloatBoxImageOptions) → this | Append an image inside the box. |
layoutItems() → { heights: number[]; total: number } | Per-item heights and their total (content only, no padding/border). |
measure() → number | Total box height: content + inter-element spacing + padding + borders. |
paintAt(page: Page, x: number, topY: number, structParent: StructElement) → number | Paint the box with its top-left corner at (x, topY) (PDF user space, y up). |