Text
Defined in: components/text.ts:15
Implements
Constructor components/text.ts:24
new Text(
text,options?):Text
Parameters
| Parameter | Type |
|---|---|
text | string |
options? | TextOptions |
Returns
Text
Properties
| Property | Modifier | Type |
|---|---|---|
align?text.ts:22 | public | "left" | "center" | "right" |
charSpacing?text.ts:21 | public | number |
color?text.ts:20 | public | string | Color |
font?text.ts:17 | public | string | PDFType0FontObject |
fontSize?text.ts:18 | public | number |
lineHeight?text.ts:19 | public | number |
texttext.ts:16 | public | string |
Methods
draw() components/text.ts:61
draw(
writer,x,y,width,availableHeight,context):Component|null
Draws the component (or a part of it) on the page.
Parameters
| Parameter | Type | Description |
|---|---|---|
writer | PDFPageWriter | The page writer to issue commands to. |
x | number | The current relative X coordinate from the left margin. |
y | number | The current relative Y coordinate from the bottom margin (top boundary of the element). |
width | number | The width constraint allocated to this element. |
availableHeight | number | The height constraint representing remaining space on the current page. |
context | LayoutContext | The layout configuration context. |
Returns
Component | null
A new Component representing the remainder of this component if it could not finish rendering, or null if it rendered completely.
Implementation of
measure() components/text.ts:43
measure(
width,context):object
Returns the width and height required by this component when rendered within a given width constraint.
Parameters
| Parameter | Type |
|---|---|
width | number |
context | LayoutContext |
Returns
object
| Name | Type |
|---|---|
heighttext.ts:43 | number |
widthtext.ts:43 | number |