Generated reference for the iPrintessApi methods tagged #ai-api:photobook in printess-editor.d.ts. Custom types referenced below (parameter and return shapes) are documented on the Types reference.
addSpreads(): Promise<boolean>
Photo-Book only feature:
Add new spreads / pages to the current document before the back cover
The amount depends on the settings in the template. Template needs to be marked as book
Returns: Promise<boolean>
adjustBook(spine: iExternalBookSettings): Promise<void>
Sets the all spine related values.
| Parameter | Type | Description |
|---|---|---|
spine |
iExternalBookSettings |
Returns: Promise<void>
analyzePhotos(callback: (percent: number, step: iExternalImageAnalysisStep, msg: string) => void, options: iExternalImageAnalysisOptions): Promise<void>
Analyzes uploaded images to retrieve the information needed for photobook creation.
| Parameter | Type | Description |
|---|---|---|
callback |
(percent: number, step: iExternalImageAnalysisStep, msg: string) => void |
Callback to report the current progress |
options |
iExternalImageAnalysisOptions |
Options for the analysis process |
Returns: Promise<void>
canAddSpreads(spreadSize?: number): 0 | 1 | 2
Returns how many spreads would be added before the back cover if addSpreads() is called.
The amount depends on the settings in the template. Template needs to be marked as book
| Parameter | Type | Description |
|---|---|---|
spreadSize? |
number |
Optional: number of current spreads (used in arrange pages dialog where actual number of spreads is not yet applied) |
Returns: 0 | 1 | 2
canReArrangeSpreads(spread?: iExternalSpreadInfo): boolean
Return if buyer can change the spread order
| Parameter | Type | Description |
|---|---|---|
spread? |
iExternalSpreadInfo |
Returns: boolean
canRemoveSpreads(spraedSize?: number): 0 | 1 | 2
Returns how many spreads would be removed before the back cover if removeSpreads() is called.
The amount depends on the settings in the template. Template needs to be marked as book
| Parameter | Type | Description |
|---|---|---|
spraedSize? |
number |
Optional: number of current spreads (used in arrange pages dialog where actual number of spreads is not yet applied) |
Returns: 0 | 1 | 2
debossedCoverImageCount(): number
Number of images (0-4) distributed onto a debossed cover
Returns: number
distributeImagesOnCover(images?: iExternalImage[]): Promise<Array<string>>
automatically distribute images to frames on the cover document. Returns a list of all applied image-ids.
| Parameter | Type | Description |
|---|---|---|
images? |
iExternalImage[] |
Returns: Promise<Array<string>>
getDocInfoForPhotobook(): iExternalPhotobookDocInfo | null
Returns all important informations to create a dynamic photobook
Returns: iExternalPhotobookDocInfo | null
getImagesBySpread(docId: string): { spreadId: string; images: { imageId: string; thumbUrl: string; }[] }[] | null
Returns image cluster for all spreads of a document with image Id and thumbUrl
| Parameter | Type | Description |
|---|---|---|
docId |
string |
The Id of the document for which to get the images per spread |
Returns: { spreadId: string; images: { imageId: string; thumbUrl: string; }[] }[] | null
getInsertSpreadSnippets(): Promise<Array<iExternalSnippet>>
Load a list of layout snippets which can be used during photo-book spread insertion
Returns: Promise<Array<iExternalSnippet>>
getPhotobookDistributionMode(): PhotobookDistribution
Returns current photo distribution mode
Returns: PhotobookDistribution
getPhotobookDuplicateCount(): number
Returns: number — The amount of duplicates among all uploaded images.
getPhotobookFilteredCount(): number
Returns: number — The amount of “bad” images among all uploaded images that can be filtered out,
getPhotobookScreenshotCount(): number
Returns: number — The amount of screenshots among all uploaded images.
getPhotobookThemeMenuId(): string
Retrieves id of current photobook theme keyword menu
Returns: string
getRenderClustersCoverImages(amount: number): Promise<{ imageId: string; thumbUrl: string; }[]>
Gets the image cluster for the cover the way it would be distributed in a photobook when created with the provided options.
| Parameter | Type | Description |
|---|---|---|
amount |
number |
number of images for the cover layout |
Returns: Promise<{ imageId: string; thumbUrl: string; }[]>
getRenderClustersEstimation(options: iExternalPhotobookOptions): iPhotobookEstimation
Gets a preview of how images would be distributed in a photobook when created with the provided options.
| Parameter | Type | Description |
|---|---|---|
options |
iExternalPhotobookOptions |
Options for the photobook creation |
Returns: iPhotobookEstimation — Preview of the image distribution
getRenderClustersImages(options: iExternalPhotobookOptions): Promise<{ imageId: string; thumbUrl: string; }[][]>
Gets a collection of image clusters the way they would be distributed in a photobook when created with the provided options.
| Parameter | Type | Description |
|---|---|---|
options |
iExternalPhotobookOptions |
Options for the photobook creation |
Returns: Promise<{ imageId: string; thumbUrl: string; }[][]>
getSelectedPhotobookTheme(): Promise<iPhotobookTheme>
Retrieves current photobook theme object
Returns: Promise<iPhotobookTheme>
getSelectedPhotobookThemeName(): string
Retrieves name of current photobook theme
Returns: string
getSpine(): null | { formular: string, spine: { value: number, unit: string }, hinge: { value: number, unit: string } }
Returns spine values for the first cover of a book Return null if no cover can be found.
Returns: null | { formular: string, spine: { value: number, unit: string }, hinge: { value: number, unit: string } }
goToImageInBook(imageId: string): void
Goes to the spread where the selected image is placed
| Parameter | Type | Description |
|---|---|---|
imageId |
string |
Returns: void
hasCurPhotobookData(): boolean
Returns: boolean — True if any analyzed images are available for photobook creation, false otherwise.
insertCustomCoverImagesToCoverLayout(coverCluster?: { imageId: string; thumbUrl: string; }[]): Promise<void>
Selects the cover layout snippet for all cover images and inserts it to the cover.
| Parameter | Type | Description |
|---|---|---|
coverCluster? |
{ imageId: string; thumbUrl: string; }[] |
Returns: Promise<void>
insertPhotobookPages(callback: (percent: number, step: iExternalPhotobookStep, msg: string) => void, options: iExternalPhotobookOptions, freeStyle: boolean, coverCluster?: { imageId: string; thumbUrl: string; }[], customizedImageSpreads?: { imageId: string; thumbUrl: string; }[][]): Promise<void>
Creates a new photobook from scratch from previously analysized photos (via {@link analyzePhotos}). An already existing photobook will be overwritten.
| Parameter | Type | Description |
|---|---|---|
callback |
(percent: number, step: iExternalPhotobookStep, msg: string) => void |
Callback to report the current progress |
options |
iExternalPhotobookOptions |
Options to determine the photobook properties |
freeStyle |
boolean |
If true, creates a freestyle photobook instead of a magic photobook |
coverCluster? |
{ imageId: string; thumbUrl: string; }[] |
Optional: pre-selected cover images (as customized in the simplified pages view) |
customizedImageSpreads? |
{ imageId: string; thumbUrl: string; }[][] |
Optional: per-spread image clusters (as customized in the simplified pages view) |
Returns: Promise<void>
isMagicPhotobook(): boolean
Returns true if the magic photobook wizzard flag is enabled
Returns: boolean
isNoOfPagesValid(spreadSize: number): boolean
Returns if the number of spreads fits the requirements set in the template
| Parameter | Type | Description |
|---|---|---|
spreadSize |
number |
current number of spreads |
Returns: boolean
loadPhotobookThemeList(keywords?: string[], reload?: boolean): Promise<iPhotobookThemeListEntryDto[]>
Load all available photobook themes
| Parameter | Type | Description |
|---|---|---|
keywords? |
string[] |
Optional: only return themes matching the given keywords |
reload? |
boolean |
Optional: forces a fresh reload of the theme list |
Returns: Promise<iPhotobookThemeListEntryDto[]>
lockCoverInside(): boolean
Gets the state of the “lockCoverInside” user setting in “book” mode If set to true the first and last page is hidden from the buyer and no photo is distributed on that pages Helpful for certain layflat photobooks
Returns: boolean
reArrangeSpreads(newSpreadIds: Array<{ id: string | "newSpread", snippetUrl?: string }>, updateBackground?: boolean): Promise<boolean>
Book-Inside-Pages only feature: re arranges all spreads by a given array of ids or “newSpread”
id: either current spread id or “newSpread”
snippetUrl (optional): Layout Snippet, which is inserted on the new spread
example:
``` await api.reArrangeSpreads([ { id: “PZE4tKlZmD9Mx9gZ0OIfx” // existing spread }, { id: “newSpread”, snippetUrl: “https://printess-prod.s3.eu-central-1.amazonaws.com/uploads/snippet/fc8b773be98ee6d58ffebd9d955a55252ddc9a0a/json/764f973bb7d9a0ae9691c3d62cf941baac6cd13e/91b02c876e345bdc8efe5d4582519a85dfc3726d.json?DOC=PCepmgRyO8E3vz0f7rXlh&ID=40be80b32d36fd85d3127f7258ead6b1dbcb8458” }, { id: “PRE4tKlZmD4jj9gZ0OIfx” // existing spread } ]) ```
Handle with care, this can destroy your Book-Inside-Pages document
| Parameter | Type | Description |
|---|---|---|
newSpreadIds |
Array<{ id: string | “newSpread”, snippetUrl?: string }> |
Array of spread id or “newSpread” and optional snippetUrls for all “newSpreads” in correct order |
updateBackground? |
boolean |
Returns: Promise<boolean>
removeCurrentSpread(): Promise<void>
Photo-Book only feature: Remove just the single current selected spread from photo-book doc.
Returns: Promise<void>
removeSpreads(): Promise<boolean>
Photo-Book only feature:
Remove spreads / pages from the current document before the back cover
The amount depends on the settings in the template. Template needs to be marked as book
Returns: Promise<boolean>
selectBookDocument(createThumbnailBeforeSwitch: boolean): Promise<boolean>
If available, selects the first page of the book-inside document
| Parameter | Type | Description |
|---|---|---|
createThumbnailBeforeSwitch |
boolean |
helpfull when triggered on FF change to ensure that the current spread thumbnail gets updated before switching to the inside pages |
Returns: Promise<boolean>
selectPhotobookTheme(name: string): Promise<iPhotobookTheme>
Select new photobook theme
| Parameter | Type | Description |
|---|---|---|
name |
string |
Name of photobook theme |
Returns: Promise<iPhotobookTheme>
setBookInsidePages(bookInsidePages: number): Promise<void>
Sets the number of inside pages of a book
| Parameter | Type | Description |
|---|---|---|
bookInsidePages |
number |
the number of pages the book should have. Must be >= 4. |
Returns: Promise<void>
setSpineFormular(formular: string): Promise<void>
Sets the spine width, could be any Length value, like an equation or a fixed value with unit.
| Parameter | Type | Description |
|---|---|---|
formular |
string |
like =spine.pages * 0.3mm or just 2cm |
Returns: Promise<void>
useDebossedCover(): boolean
Returns true if the photobook uses a debossed cover
Returns: boolean
useExclusiveCoverImages(): boolean
Returns true if the cover images should not appear again on the inside of the photobook
Returns: boolean