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

NameTypeAccessDescription
width: numberReadGets the width.
spacing: numberReadGets the spacing.
padding: PaddingRead@internal
borderWidth: numberRead@internal
border: { width: number; color: [number, number, number]; sides?: BorderSides }Read@internal
width: numberReadGets the width.
color: [number, number, number]ReadGets the color.
sides: BorderSidesReadGets the sides.
background: [number, number, number]Read@internal
alt: stringRead@internal
heights: number[]ReadGets the heights.
total: numberReadGets the total.

Methods

SignatureDescription
constructor(doc: Document, options: FloatBoxOptions)Calls constructor(doc, options) on this FloatingBox instance.
contentWidth()numberContent width: outer width minus horizontal padding and both borders.
AddParagraph(text: string, options: FlowParagraphOptions)thisAppend a word-wrapped paragraph inside the box.
AddImage(data: Uint8Array, options: FloatBoxImageOptions)thisAppend an image inside the box.
layoutItems(){ heights: number[]; total: number }Per-item heights and their total (content only, no padding/border).
measure()numberTotal box height: content + inter-element spacing + padding + borders.
paintAt(page: Page, x: number, topY: number, structParent: StructElement)numberPaint the box with its top-left corner at (x, topY) (PDF user space, y up).