Generated reference for the iPrintessApi methods tagged #ai-api:layouts-snippets in printess-editor.d.ts. Custom types referenced below (parameter and return shapes) are documented on the Types reference.
addGapAround(): Promise<boolean>
If splitter frames are present on current spread this method adds
a gap between all splitter-frames and the page border
Returns true if successful
Returns: Promise<boolean>
alignSplitterClustersToDocMargin(): Promise<void>
Aligns all splitter clusters on current spread to document margins
Returns: Promise<void>
applyPhotoFrameSnippet(snippetUrl: string): Promise<void>
Applies the given photo-frame snippet to the currently selected frame
| Parameter | Type | Description |
|---|---|---|
snippetUrl |
string |
The Url of the snippet |
Returns: Promise<void>
applySplitterCellSnippet(splitterSnippetUrl: string): Promise<void>
Replaces current splitter-cell with splitter-snippet content
| Parameter | Type | Description |
|---|---|---|
splitterSnippetUrl |
string |
Returns: Promise<void>
canSplitSelectedFrames(): boolean
Tells if the current selection is part of a collage and accordingly influences the size of other images and own size when changing
Returns: boolean
convertSplitterCellToImage(): Promise<void>
Change a text snippet frame to an image frame in a photo collage
Returns: Promise<void>
convertSplitterCellToText(): Promise<void>
Change an image frame to a text snippet frame in a photo collage
Returns: Promise<void>
currentSpreadSplitVariantId(): string | null
Returns the last applied collage split-variant id for the current spread
Returns: string | null
getAppliedLayouts(): Record<string, Record<string, appliedLayoutInfo>>
Returns information about the applied layout snippets per document per spread. The first level contains a mapping of document name to spread info. The second level (spreads) contains the mapping of spread name or id (in case the spread does not have a name set) to the layout info.
Returns: Record<string, Record<string, appliedLayoutInfo>>
getBackgroundColorProperties(): iExternalProperty[]
Returns all background Frame Color Properties
Returns: iExternalProperty[]
getDiscardedContentOnLayoutAppliation(): Promise<Array<string>>
Checks whether the user has made any edits (only checks for added text frames for now) to the current spread that would be discarded by applying a new layout.
Returns: Promise<Array<string>> — An array of all content types that would be discarded on layout application.
getInitialLayoutCategoryName(categories?: iSnippetMenuCategory[] | null): string
Returns selected Layout Category Name that will initially be selected in the Buyer Side for Layout Snippets Can be empty string (and should be ignored) if not set via attach parameters
| Parameter | Type | Description |
|---|---|---|
categories? |
iSnippetMenuCategory[] | null |
default value null |
Returns: string
getLastAppliedLayoutInfo(): { snippetTemplateName: string, snippetDocName: string, snippetDocId: string, splitVariantId?: string | null } | null
Returns the layout snippet template and doc name for the current spread
Returns: { snippetTemplateName: string, snippetDocName: string, snippetDocId: string, splitVariantId?: string | null } | null
This method is deprecated.
getLayoutSnippetFilterMenu(): Promise<iSnippetMenuCategory[] | null>
Returns the filter menu for layout snippets.
Returns: Promise<iSnippetMenuCategory[] | null>
getLayoutSnippetKeywords(): Promise<Array<string>>
Retrieves available keywords for layout snippet search
Returns: Promise<Array<string>>
getLayoutSnippetProductTypes(): Promise<Array<string>>
Retrieves available product types for layout snippet search
Returns: Promise<Array<string>>
getMatchingCollageLayouts(images: iExternalImage[]): Promise<iExternalCollageLayout[]>
Returns a selection of all matching collage layouts
| Parameter | Type | Description |
|---|---|---|
images |
iExternalImage[] |
images to distribute |
Returns: Promise<iExternalCollageLayout[]>
getMaxCollageImages(): number
Returns the maximum number of images in a single collage
Returns: number
getPhotoFrameSnippets(): Promise<{ topics: Array<iSnippetMenuTopic>, snippets: Array<iExternalSnippet> }>
Get a list of all photo-frame-snippets
Returns: Promise<{ topics: Array<iSnippetMenuTopic>, snippets: Array<iExternalSnippet> }>
getSelectedLayoutTopicId(category?: iSnippetMenuCategory | null): string
Returns selected Layout Topic Id that will initially be selected in the Buyer Side for Layout Snippets
| Parameter | Type | Description |
|---|---|---|
category? |
iSnippetMenuCategory | null |
default value null |
Returns: string
getSnippetFilterMenu(menuId: "layout" | "background" | "photobook-themes" | string): Promise<iSnippetMenuCategory[] | null>
Returns Filter Menu for Layout Snippets (“layout”) or for a menu-id passed in “menuId”
| Parameter | Type | Description |
|---|---|---|
menuId |
“layout” | “background” | “photobook-themes” | string |
Returns: Promise<iSnippetMenuCategory[] | null>
getSplitterSnippets(): Promise<Array<iExternalSnippet>>
Get a list of all splitter-content-snippets
Returns: Promise<Array<iExternalSnippet>>
getTextFrameSnippets(): Promise<{ topics: Array<iSnippetMenuTopic>, snippets: Array<iExternalSnippet> }>
Get a list of all text-frame-snippets
Returns: Promise<{ topics: Array<iSnippetMenuTopic>, snippets: Array<iExternalSnippet> }>
This method is deprecated.
hasBackground(): boolean
Indicates if the current spread has editable background frames.
Returns: boolean
hasBackgroundLayoutsTab(): boolean
Indicates if the current spread has background layouts (background-tab feature)
Returns: boolean
hasLayoutSnippetImageCountFilter(): boolean
Returns if ui should show image count filter for layout snippets Only active if filter menu is displayed
Returns: boolean
hasLayoutSnippets(): boolean
Returns if LayoutSnippets are available
Returns: boolean
hasPhotoFrameSnippets(): boolean
If the current selection should show photo-frame-styles (PanelUI only)
Returns: boolean
hasScissorMenu(): "never" | "horizontical" | "vertical" | "both"
Indicates if a selected image frame can be splitted in certain directions
Returns: “never” | “horizontical” | “vertical” | “both”
hasSnippetMenu(which: "layout" | "sticker" | "background"): boolean
Returns if the snippet menu of the given type (“layout” | “sticker” | “background”) should be rendered
| Parameter | Type | Description |
|---|---|---|
which |
“layout” | “sticker” | “background” |
Returns: boolean
hasSplitterMenu(): boolean
Indicates if a splitter cell is selected
Returns: boolean
hasSplitters(): boolean
Returns if current spread has splitter frames
Returns: boolean
hasSplitterTextSnippets(): boolean
Indicates if splitter text snippets are available
Returns: boolean
hasTextFrameSnippets(): boolean
If the current selection should show text-frame-styles (PanelUI only)
Returns: boolean
insertGroupSnippet(snippetUrl: string, targetSplitterBoxId?: string, autoAssignToSelectionIfPossible?: boolean): Promise<void>
Insert a Sticker (Group-Snippet) on the current spread of the current document
| Parameter | Type | Description |
|---|---|---|
snippetUrl |
string |
The Url of the snippet |
targetSplitterBoxId? |
string |
|
autoAssignToSelectionIfPossible? |
boolean |
The default value is false |
Returns: Promise<void>
insertLayoutAndAssignImages(images: iExternalImage[], splitVariantId?: string | null, spreadId?: string): Promise<void>
Selects the best layout snippet for the passed images, inserts it and assigns the images to its frames.
| Parameter | Type | Description |
|---|---|---|
images |
iExternalImage[] |
|
splitVariantId? |
string | null |
optional split-variant id of the collage layout to apply (see getMatchingCollageLayouts) |
spreadId? |
string |
optional id of the target spread |
Returns: Promise<void>
insertLayoutSnippet(snippetUrl: string, targetPage?: "left" | "right" | "entire", spread?: any, colorScheme?: string, hideRemoveBorderOption?: boolean, splitVariant?: number, forceRepeat?: ForceSnippetPlacement, layoutImageSelection?: "apply" | "skip", removeBoxesOnBackgroundLayer?: boolean, addingBackgroundLayout?: boolean): Promise<void>
Insert a Layout-Snippet on the current spread of the current document
| Parameter | Type | Description |
|---|---|---|
snippetUrl |
string |
The Url of the snippet |
targetPage? |
“left” | “right” | “entire” |
optional, forces layout-snippets to left or right side if aspect ratio of snippet matches dimensions a single page of a double page spread |
spread? |
any |
|
colorScheme? |
string |
|
hideRemoveBorderOption? |
boolean |
optional, Default value is false |
splitVariant? |
number |
|
forceRepeat? |
ForceSnippetPlacement |
|
layoutImageSelection? |
“apply” | “skip” |
|
removeBoxesOnBackgroundLayer? |
boolean |
|
addingBackgroundLayout? |
boolean |
Returns: Promise<void>
insertTemplateAsLayoutSnippet(templateName: string, templateVersion: "draft" | "published", documentName: string, mode: "layout" | "group"): Promise<void>
Insert a document from any template like a layout-snippet or group-snippet (sticker) to the current document/spread This method comes in handy if you have your own snippet-management in place. Any template can be inserted (Does not have to be published as snippet), but if the template/document is a snippet the placement-settings will be used
| Parameter | Type | Description |
|---|---|---|
templateName |
string |
|
templateVersion |
“draft” | “published” |
|
documentName |
string |
|
mode |
“layout” | “group” |
Returns: Promise<void>
isBackgroundSelected(): boolean
Indicates if background frames are selected
Returns: boolean
isLastAppliedLayout(snippetUrl: string): boolean
Returns true if the snippet has been lastly applied on the current document
| Parameter | Type | Description |
|---|---|---|
snippetUrl |
string |
Returns: boolean
loadBackgroundLayouts(): Promise<iExternalSnippet[]>
Loads all background layout snippets for the background-layouts tab (see hasBackgroundLayoutsTab)
Returns: Promise<iExternalSnippet[]>
loadBackgroundLayoutsByKeywords(keywords: string[], topicId?: string): Promise<Array<iExternalSnippet>>
Retrieves all background-layout snippets matching the given keywords
| Parameter | Type | Description |
|---|---|---|
keywords |
string[] |
|
topicId? |
string |
Returns: Promise<Array<iExternalSnippet>>
loadLayoutSnippetsByKeywords(keywords: string[], topicId?: string): Promise<Array<iExternalSnippet>>
Retrieves all layout snippets matching the given keywords, current language and current aspect ratio
| Parameter | Type | Description |
|---|---|---|
keywords |
string[] |
|
topicId? |
string |
Returns: Promise<Array<iExternalSnippet>>
loadStickerSnippetsByKeywords(tags: string[] | ReadonlyArray<string>, keywords: string[]): Promise<Array<iExternalSnippet>>
Retrieves all sticker snippets matching the given tags & keywords and the current language
| Parameter | Type | Description |
|---|---|---|
tags |
string[] | ReadonlyArray<string> |
|
keywords |
string[] |
Returns: Promise<Array<iExternalSnippet>>
nextGapAction(): { gapAround: null | "add" | "remove", gap: number, setGap: null | "all" | "only>0" }
Returns the next possible gap actions for the splitter layout on the current spread:
whether a gap around the splitter frames can be added or removed (gapAround),
the current gap value (gap) and which gap sizes may be set via setSplitterGaps (setGap: “all” includes a zero gap, “only>0” only positive sizes)
Returns: { gapAround: null | “add” | “remove”, gap: number, setGap: null | “all” | “only>0” }
removeGapAround(): Promise<boolean>
If splitter frames are present on current spread this method removes
the gap between all splitter-frames and the page border
Returns true if successful
Returns: Promise<boolean>
selectBackground(): Promise<void>
Selects all frames which are marked as background
Returns: Promise<void>
setBackgroundColor(colorIndex: number, propertyValue: string, mode: "page" | "all"): Promise<void>
Sets a background color property by index
| Parameter | Type | Description |
|---|---|---|
colorIndex |
number |
|
propertyValue |
string |
|
mode |
“page” | “all” |
apply the color to the current page (“page”) or to all pages (“all”) |
Returns: Promise<void>
setSplitterGaps(n: number): Promise<void>
Set the gap size of the photo grid
| Parameter | Type | Description |
|---|---|---|
n |
number |
gap size of the photo grid |
Returns: Promise<void>
showLayoutSnippetColorSchemes(): boolean
Whether UI should show color schemes for layout snippets
Returns: boolean
splitFrame(direction: "horizontal" | "vertical"): Promise<void>
Split an image frame that has splitter option turned on
| Parameter | Type | Description |
|---|---|---|
direction |
“horizontal” | “vertical” |
is either horizontal or vertical depending on how an image should be splitted |
Returns: Promise<void>
splitterEdgesCount(): number
number of active splitter edges
Returns: number
stickerCanReplaceFrame(): boolean
returns if a selected sticker could replace the current selection
Returns: boolean
templateHasSnippets(): boolean
returns if snippets are present on any spread in the template
Returns: boolean