Generated reference for the iPrintessApi methods tagged #ai-api:text-editing in printess-editor.d.ts. Custom types referenced below (parameter and return shapes) are documented on the Types reference.
getColorByColorScheme(schemeName: string): string | null
Return primary display color from a color scheme (if available) as hex color
| Parameter | Type | Description |
|---|---|---|
schemeName |
string |
Returns: string | null
getColors(propertyId: string, bgColorIndex?: number): Array<{
name: string;
color: string;
}>
Returns a list of available colors for a certain selected property (frame).
| Parameter | Type | Description |
|---|---|---|
propertyId |
string |
Id of property to filter available color per frame |
bgColorIndex? |
number |
if passed a number here, it returns the background color properties without a selection. |
Returns: Array<{ name: string; color: string; }>
getColorSchemes(): iExternalProperty | null
Return color schemes if available as external property
Returns: iExternalProperty | null
getFonts(propertyId: string): Array<{
name: string;
thumbUrl: string;
displayName: string;
familyName: string;
weight: number;
isItalic: boolean;
}>
Returns a list of available fonts for a certain selected property (frame).
| Parameter | Type | Description |
|---|---|---|
propertyId |
string |
Id of property to filter available fonts per frame |
Returns: Array<{ name: string; thumbUrl: string; displayName: string; familyName: string; weight: number; isItalic: boolean; }>
getFontSizesInPercent(): Array<number>
Retrieves a list of available font-sizes in point
Returns: Array<number>
getFontSizesInPt(): Array<number>
Retrieves a list of available font-sizes in point
Returns: Array<number>
getHexColor(color: string): string
Returns hex color from rgb value
| Parameter | Type | Description |
|---|---|---|
color |
string |
rgb color value |
Returns: string
getParagraphStyles(propertyId: string): Array<{
class: string,
css: string
}>
Returns a list of available paragraph-style for a certain selected property (frame).
| Parameter | Type | Description |
|---|---|---|
propertyId |
string |
Id of property to filter available styles per frame |
Returns: Array<{ class: string, css: string }>
invertColor(hex: string, bw: boolean): string
Returns black or white hex depending on color value
| Parameter | Type | Description |
|---|---|---|
hex |
string |
|
bw |
boolean |
Returns: string
loadFont(fontName: string): Promise<boolean>
Loads a font of the current template into the editor and caches it, so it can be rendered
and measured immediately. Fonts are normally loaded on demand, so call this before you set a
font on a text (e.g. via setTextStyleProperty) to avoid a short unstyled flash.
Returns instantly if the font is already cached.
| Parameter | Type | Description |
|---|---|---|
fontName |
string |
Name of the font as returned by getFonts() (the name property) |
Returns: Promise<boolean> — true if the font is available (loaded now or already cached), false if no font with
setStoryParagraphs(propertyId: string, paragraphs: Array<{ index: number, newValue: string }>): Promise<void>
Sets a list of paragraph texts at once.
| Parameter | Type | Description |
|---|---|---|
propertyId |
string |
|
paragraphs |
Array<{ index: number, newValue: string }> |
list of paragraph values |
Returns: Promise<void>