Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface iPrintessApi

iPrintessApi is returned by the attachPrintess() call and provides you access to the Printess editor. You can retrieve informations, set properties, add snippets and much more.

Hierarchy

  • iPrintessApi

Index

Methods

Methods

addSerializedImage

  • addSerializedImage(imageJson: string, assignToFrameOrNewFrame?: boolean): Promise<iExternalImage>

addSpreads

  • 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>

allowImageDistribution

  • allowImageDistribution(): boolean
  • check number of distributable image boxes if greater than 1 return true

    Returns boolean

allowPdfUpload

  • allowPdfUpload(): boolean

allowZoomOptions

  • allowZoomOptions(): boolean

applyImageFilterSnippet

  • applyImageFilterSnippet(filterSnippetUrl: string): Promise<void>

assignImageToNextPossibleFrame

  • assignImageToNextPossibleFrame(imgId: string): Promise<boolean>
  • If no selection is present this call finds the first unassigned image and assigns it If all images are already assigned it takes the first image and re-assigns it

    Parameters

    • imgId: string

    Returns Promise<boolean>

autoScaleDetails

  • autoScaleDetails(): { enabled: boolean; height: number; width: number }
  • Retrieves information if the auto-scale option was enabled on attachPrintess() Also returns the calculated pixel-dimension of printess container on desktop

    Returns { enabled: boolean; height: number; width: number }

    • enabled: boolean
    • height: number
    • width: number

autoScaleEnabled

  • autoScaleEnabled(): boolean

bringErrorIntoView

buyerCanHaveEmptySelection

  • buyerCanHaveEmptySelection(): boolean
  • Return true if buyer can deselect an item on the current spread. Which means that either there are non-step frames to select or the spread can add new group-snippets/stickers Important to keep buyer in the step-logic

    Returns boolean

canAddSpreads

  • 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

    Parameters

    • Optional 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

canMoveSelectedFrames

  • canMoveSelectedFrames(): boolean

canRemoveSpreads

  • canRemoveSpreads(spraedSize?: number): 0 | 1 | 2
  • Returns how many spreads would be removed before cover removeSpreads()is called. The amount depends on the settings in the template. Template needs to be marked as book

    Parameters

    • Optional spraedSize: number

    Returns 0 | 1 | 2

canScale

  • canScale(propertyId: string): boolean

centerSelection

  • centerSelection(focusFormFieldId?: string): Promise<void>

clearSelection

  • clearSelection(): Promise<void>
  • Clears current printess frames selection and shows document-wide properties like form fields.

    Returns Promise<void>

createAwsUploaderProvider

  • createAwsUploaderProvider(uploadEndpoint: string, serveEndpoint?: string, keyGenerator?: (fileName: string, fileHash: string) => string): AwsUploadProvider
  • Parameters

    • uploadEndpoint: string

      The target address to send the upload form data to. E.g. https://your-bucket.s3.eu-central-1.amazonaws.com/

    • Optional serveEndpoint: string

      The url the files are served from. This can differ from the upload endpoint to make CDN distribution possible. E.g. https://mycloudfrontid.amazonaws.com/

    • Optional keyGenerator: (fileName: string, fileHash: string) => string

      The method to generate the S3 key. The built-in one just makes sure that the file name is unique per session.

        • (fileName: string, fileHash: string): string
        • Parameters

          • fileName: string
          • fileHash: string

          Returns string

    Returns AwsUploadProvider

createCropUi

  • createCropUi(propertyId: string, forDesktopDialog: boolean): null | { container: HTMLDivElement; setScale: (s: number) => void; getCropBox: any }
  • Returns a simple ui to change the postion of an image

    Parameters

    • propertyId: string
    • forDesktopDialog: boolean

      give more space if for desktop dialog

    Returns null | { container: HTMLDivElement; setScale: (s: number) => void; getCropBox: any }

cropImage

  • cropImage(propertyId: string, box: { height: number; left: number; top: number; width: number }): Promise<null | iExternalImage>
  • Creates a new cropped image and assigns it to the passed form-field. Takes the currently assigned image as master

    Parameters

    • propertyId: string

      id of a form-field-property (type of image-id) pointing to a valid image

    • box: { height: number; left: number; top: number; width: number }

      all box coordinates are expected to be in the range of 0 to 1

      • height: number
      • left: number
      • top: number
      • width: number

    Returns Promise<null | iExternalImage>

deleteImages

  • delete buyer uploaded images that are not in use Returns the number of successfully deleted images.

    Parameters

    Returns number

deleteSelectedFrames

  • deleteSelectedFrames(): Promise<boolean>
  • Deletes all selected frames which are allowed to be removed by the buyer

    Returns Promise<boolean>

displayStepNumbers

  • displayStepNumbers(display: boolean): Promise<void>
  • Turns the display of step numbers on or off

    Parameters

    • display: boolean

    Returns Promise<void>

distributeImages

  • distributeImages(): Promise<string[]>
  • automatically distribute all non used uploaded images to frames which have not been assigned yet. Returns a list of all applied image-ids.

    Returns Promise<string[]>

enableCustomColors

  • enableCustomColors(): boolean
  • Returns if buyer ui should display option for custom colors in color dropdown

    Returns boolean

enterExpertMode

  • enterExpertMode(): void
  • Enter the buyer Expert-Mode to allow position, remove and rotation for every frame which is not locked

    Returns void

getAddToBasketCallback

  • getAddToBasketCallback(): null | ((saveToken: string, url: string) => void)
  • Returns the add to basket callback you have set in attachPrintess()

    Returns null | ((saveToken: string, url: string) => void)

getAllDocsAndSpreads

getAllImages

getAllPriceRelevantFormFields

  • getAllPriceRelevantFormFields(): {}
  • Retrieves all price relevant form-field names and values

    Returns {}

    • [key: string]: string

getAllProperties

getAllPropertiesBySpreadId

getAllRequiredProperties

getAllRequiredPropertiesBySpreadId

  • getAllRequiredPropertiesBySpreadId(spreadId: string): Promise<iExternalProperty[][]>

getAllRequiredPropertiesBySpreadIdSync

getAllRequiredPropertiesSync

getAllSpreads

getBackButtonCallback

  • getBackButtonCallback(): null | ((saveToken: string) => void)
  • Returns the back button callback you have set in attachPrintess()

    Returns null | ((saveToken: string) => void)

getBasketButtonBehaviour

  • getBasketButtonBehaviour(): "add-to-basket" | "go-to-preview"
  • returns desired behaviour of basket button In steps-mode basket button always points to the basket. If no steps are present basket button should lead to the preview

    Returns "add-to-basket" | "go-to-preview"

getButtonCircleModel

  • Mobile UI helper method to get model to draw a circle button including icons, gauge, etc. uiHelper.js contains a method to create an SVG from this circle model

    Parameters

    • m: iMobileUIButton

      The mobile button to create a circle for

    • isSelected: boolean

      If the button is selected

    Returns iButtonCircle

getBuyerFrameCountAndClasses

  • deprecated

    This call is no longer supported, use getBuyerFrameCountAndMarkers() instead. This call will no longer return iFrameCountAndClasses intead it returns iFrameCountAndMarkers

    Returns iFrameCountAndMarkers[]

getBuyerFrameCountAndMarkers

  • Returns an array of buyer-editable documents and a list of frames for each spread including their frame markers. You can easily use them fro statistically purposes or to charge extra prices fro certain used layouts. Or just use the frame-count to determine if the user had made changes at all.

    Returns iFrameCountAndMarkers[]

getColors

  • getColors(propertyId: string): { color: string; name: string }[]
  • Returns a list of available colors for a certain selected property (frame).

    Parameters

    • propertyId: string

      Id of property to filter available color per frame

    Returns { color: string; name: string }[]

getContentEditables

getFontSizesInPt

  • getFontSizesInPt(): number[]

getFonts

  • getFonts(propertyId: string): { displayName: string; familyName: string; isItalic: boolean; name: string; thumbUrl: string; weight: number }[]
  • Returns a list of available fonts for a certain selected property (frame).

    Parameters

    • propertyId: string

      Id of property to filter available fonts per frame

    Returns { displayName: string; familyName: string; isItalic: boolean; name: string; thumbUrl: string; weight: number }[]

getFormField

  • getFormField(fieldName: string): Promise<undefined | { list?: { description?: string; imageId?: string; key: string; label?: string }[]; value: null | string | number | Record<string, any>[] }>
  • Returns the current form field value and its possible list values if available

    Parameters

    • fieldName: string

      Name of the Form-Field or Form-Field Property-ID

    Returns Promise<undefined | { list?: { description?: string; imageId?: string; key: string; label?: string }[]; value: null | string | number | Record<string, any>[] }>

getFrameUiHintPosition

getHexColor

  • getHexColor(color: string): string
  • Returns hex color from rgb value

    Parameters

    • color: string

      rgb color value

    Returns string

getIcon

getImageFilterSnippets

  • getImageFilterSnippets(tags: string[] | readonly string[]): Promise<iExternalSnippet[]>

getImageGroups

  • getImageGroups(propertyId?: string): string[]
  • Returns all available image groups

    Parameters

    • Optional propertyId: string

      id of property which shows the image list

    Returns string[]

getImages

  • If property is empty it returns the list of buyer uploaded images.

    Parameters

    • Optional propertyId: string

      id of property which shows the image list

    Returns iExternalImage[]

getInitialTabId

  • getInitialTabId(): string

getJson

  • getJson(): string

getMobileUiBackgroundButton

getMobileUiButtons

  • Mobile UI helper method to convert a list of properties to a list of mobile buttons to show to the buyer

    Parameters

    • properties: iExternalProperty[]

      list of properties to get buttons from

    • propertyIdFilter: string

      can be the id of a specific property to get only property related buttons (for images and multi-line text) "all" returns only top level buttons (no sub/meta property buttons) "root" returns only top-level properties but sets the hasCollapsedMetaProperties flag if applicable

    Returns iMobileUIButton[]

getNumberUi

  • Returns the number UI model for any numeric property iExternalNumberUi and value will be returned and has min, max and step info Important: Number models can have different value ranges than the values stored in printess for better user experience uiHelper.js conatins a method to create a slider control from this model

    Parameters

    Returns undefined | { meta: iExternalNumberUi; value: number }

getSerializedImage

  • getSerializedImage(imageId: string): null | string

getStep

getStepByIndex

  • getStepByIndex(index: number): null | iBuyerStep

getTemplateTitle

  • getTemplateTitle(): string

getTranslations

  • getTranslations(): Record<string, string | number | Record<string, string | number>>
  • Returns all default english translations or if language property is set / browser language is detected (if set to auto) the respective translation if available

    Returns Record<string, string | number | Record<string, string | number>>

getUploadedImagesCount

  • getUploadedImagesCount(): number

getZoomMode

  • getZoomMode(): "frame" | "spread"

gl

  • gl(translationKey: string, ...params: (string | number)[]): string
  • Returns a translation as string to display the ui in different languages

    Parameters

    • translationKey: string

      String containing the keys for the translation table separated by period

    • Rest ...params: (string | number)[]

      String or number parameters that substitute $1, ..., $9 properties in a translation

    Returns string

gotoFirstStep

  • gotoFirstStep(zoom?: "frame" | "spread"): Promise<void>
  • Returns to the first step, helpful if you want to exit the preview step.

    Parameters

    • Optional zoom: "frame" | "spread"

      overrides the frames zoom settings for all devices

    Returns Promise<void>

gotoLastStep

  • gotoLastStep(zoom?: "frame" | "spread"): Promise<void>
  • Returns to the last step, helpful if you want to skip steps.

    Parameters

    • Optional zoom: "frame" | "spread"

      overrides the frames zoom settings for all devices

    Returns Promise<void>

gotoNextPreviewDocument

  • gotoNextPreviewDocument(zoomDuration?: number): Promise<void>
  • Jumps to the next available preview document if there is one.

    Parameters

    • Optional zoomDuration: number

    Returns Promise<void>

gotoPreviewStep

  • gotoPreviewStep(previewIndex?: number, zoom?: "frame" | "spread"): Promise<void>
  • Goes directly to the preview-step-index

    Parameters

    • Optional previewIndex: number

      Zero based index of the preview steps. See also: previewStepsCount()

    • Optional zoom: "frame" | "spread"

      overrides the frames zoom settings for all devices

    Returns Promise<void>

gotoPreviousPreviewDocument

  • gotoPreviousPreviewDocument(zoomDuration?: number): Promise<void>
  • Jumps to the previous available preview document if there is one.

    Parameters

    • Optional zoomDuration: number

    Returns Promise<void>

hasBackground

  • hasBackground(): boolean

hasBuyerContentEdits

  • hasBuyerContentEdits(spreadIdOrIndex?: string | number, documentName?: string): boolean
  • Returns true is the user has made edits on a spread.

    Parameters

    • Optional spreadIdOrIndex: string | number
    • Optional documentName: string

    Returns boolean

hasExpertButton

  • hasExpertButton(): boolean

hasFormFields

  • hasFormFields(): boolean

hasLayoutSnippets

  • hasLayoutSnippets(): boolean

hasMetaProperties

hasNextStep

  • hasNextStep(): boolean

hasPreviewBackButton

  • hasPreviewBackButton(): boolean
  • Tells the ui if it should a Back-Buttonfrom preview to edit. Its true if the current displayed document is a preview document

    Returns boolean

hasPreviousStep

  • hasPreviousStep(): boolean

hasSelection

  • hasSelection(): boolean

hasSteps

  • hasSteps(): boolean

hasTextOverflow

  • hasTextOverflow(propertyId: string): boolean
  • Returns true if the associated mutli-line text-frame has text which does not fit into the frame

    Parameters

    • propertyId: string

    Returns boolean

hideOverlay

  • hideOverlay(): void

importImageFromUrl

  • importImageFromUrl(url: string, assignToFrameOrNewFrame?: boolean, propertyId?: string): Promise<null | iExternalImage>
  • Imports a single image to Printess and can auto assign this image

    Parameters

    • url: string

      The url to the image you want to import to Printess.

    • Optional assignToFrameOrNewFrame: boolean

      Assign this image to the current frame, or create a new frame in case none is selected.

    • Optional propertyId: string

    Returns Promise<null | iExternalImage>

insertGroupSnippet

  • insertGroupSnippet(snippetUrl: string): Promise<void>

insertLayoutSnippet

  • insertLayoutSnippet(snippetUrl: string): Promise<void>

insertTemplateAsLayoutSnippet

  • insertTemplateAsLayoutSnippet(templateName: string, templateVersion: "draft" | "published", documentName: string, mode: "group" | "layout"): Promise<void>
  • Insert a docuement 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

    Parameters

    • templateName: string
    • templateVersion: "draft" | "published"
    • documentName: string
    • mode: "group" | "layout"

    Returns Promise<void>

isBackgroundSelected

  • isBackgroundSelected(): boolean

isCurrentStepActive

  • isCurrentStepActive(): boolean
  • Indicates if the current step has become inactive, because the user has selected other frames TRUE if the current step is part of the selection.

    Returns boolean

isDoublePageSpread

  • isDoublePageSpread(): boolean

isIPhone

  • isIPhone(): boolean

isImageInUse

  • isImageInUse(imageId: string): boolean
  • Returns if a specific image is used in buyer editable frame.

    Parameters

    • imageId: string

      Id of image to test

    Returns boolean

isInDesignerMode

  • isInDesignerMode(): boolean
  • Returns true if printess has full Designer edit rights and is not running in Shop-Mode

    Returns boolean

isInExpertMode

  • isInExpertMode(): boolean

isMobile

  • isMobile(): boolean

isNextStepPreview

  • isNextStepPreview(): boolean

isNoOfPagesValid

  • isNoOfPagesValid(spreadSize: number): boolean
  • Returns if the number of spreads fits the requirements set in the template

    Parameters

    • spreadSize: number

      current number of spreads

    Returns boolean

isPropertyVisible

  • isPropertyVisible(propertyId: string): boolean
  • Returns only false if property refers to a formfield which is not visible, because it doesn' match a specific condition.

    Parameters

    • propertyId: string

      ID of property to check

    Returns boolean

isSoftwareKeyBoardExpanded

  • isSoftwareKeyBoardExpanded(): boolean
  • On IOS returns if iphone has its keyboard expanded. This can never be 100% accurate.

    Returns boolean

isTextButton

isTextEditorOpen

  • isTextEditorOpen(): boolean
  • Returns true if either rich- or simple-text-editor is currently active

    Returns boolean

lastStep

leaveExpertMode

  • leaveExpertMode(): void
  • Leave the buyer Expert-Mode to allow position, remove and rotation for every frame which is not locked

    Returns void

load

  • load(templateNameOrSaveToken: string, mode?: "auto" | "loadAlwaysFromServer"): Promise<void>
  • Loads template or previously saved buyer artwork (saveToken)

    Parameters

    • templateNameOrSaveToken: string

      a templateName or a saveToken you have received from basket- or back-callback or from save() call

    • Optional mode: "auto" | "loadAlwaysFromServer"

    Returns Promise<void>

loadJson

  • loadJson(saveToken: string): Promise<void>

loadTemplate

  • loadTemplate(templateNameOrToken: string, mergeTemplates?: [iMergeTemplate]): Promise<void>
  • Load a template to the Printess editor.

    Parameters

    • templateNameOrToken: string

      can be either the name of a template (case sensitive) or the save-token received as a result of a user design save.

    • Optional mergeTemplates: [iMergeTemplate]

      optional parameter to pass other templates to merge

    Returns Promise<void>

lockCoverInside

  • lockCoverInside(): boolean
  • Gets the state of the "lockCoverInside" user setting in "book" mode If set to true the cover extends to two spreads when adding or removing spreads

    Returns boolean

neverHideMobileToolbar

  • neverHideMobileToolbar(): boolean
  • Returns status of config-flag neverHideMobileToolbar, default is false.

    Returns boolean

nextPage

  • nextPage(): Promise<void>
  • Moves Printess focus to next page if available. Focus on single pages not spreads.

    Returns Promise<void>

nextStep

  • nextStep(zoom?: "frame" | "spread"): Promise<void>
  • Goes to the next available step (if any)

    Parameters

    • Optional zoom: "frame" | "spread"

      overrides the frames zoom settings for all devices

    Returns Promise<void>

noBasketThumbnail

  • noBasketThumbnail(): boolean

numberOfColumns

  • numberOfColumns(): number
  • Returns how many columns a Change Layout overview should have to display layout snippets more properly

    Returns number

pageInfo

  • pageInfo(): Promise<{ current: number; isFirst: boolean; isLast: boolean; max: number; spreadId: string }>
  • Retrieves information about the currently selected page. Returns natural page-number (current) staring from 1 (not spread-index), page-count (max) and flags if the current page isFirst or isLast page of the current document First and last pages are identical to the spread in facing page documents. Async version waits for Printess to be fully loaded.

    Returns Promise<{ current: number; isFirst: boolean; isLast: boolean; max: number; spreadId: string }>

pageInfoSync

  • pageInfoSync(): { current: number; isFirst: boolean; isLast: boolean; max: number; spreadId: string }
  • Retrieves information about the currently selected page. Returns natural page-number (current) staring from 1 (not spread-index), page-count (max) and flags if the current page isFirst or isLast page of the current document First and last pages are identical to the spread in facing page documents. Sync version returns dummy data if Printess is not fully loaded.

    Returns { current: number; isFirst: boolean; isLast: boolean; max: number; spreadId: string }

    • current: number
    • isFirst: boolean
    • isLast: boolean
    • max: number
    • spreadId: string

pageNavigationDisplay

  • pageNavigationDisplay(): "hide" | "numbers" | "icons"
  • Returns if buyer ui should display the page navigation as icons for all docs or just numbers for current doc

    Returns "hide" | "numbers" | "icons"

previewStepsCount

  • previewStepsCount(): number
  • Returns the total amount of available preview-steps. 0 indicates no preview

    Returns number

previousPage

  • previousPage(): Promise<void>
  • Moves Printess focus to previous page if available. Focus on single pages not spreads.

    Returns Promise<void>

previousStep

  • previousStep(zoom?: "frame" | "spread"): Promise<void>
  • Goes to the previous step (if any)

    Parameters

    • Optional zoom: "frame" | "spread"

      overrides the frames zoom settings for all devices

    Returns Promise<void>

reArrangeSpreads

  • reArrangeSpreads(newSpreadIds: string[]): Promise<boolean>
  • Photo-Book only feature: re arranges all spreads by a given array of ids or newSpread Handle with care, this can destroy your photo-book document

    Parameters

    • newSpreadIds: string[]

      Array of spread ids in correct order

    Returns Promise<boolean>

redo

  • redo(): void

redoCount

  • redoCount(): number

removeHandwritingImage

  • removeHandwritingImage(): Promise<boolean>
  • removes image for rich-text-frames which have a handwriting image set Sets back to text

    Returns Promise<boolean>

removeSpreads

  • 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>

renderFirstPageImage

  • renderFirstPageImage(fileName: string, documentName?: string, maxWidth?: number, maxHeight?: number): Promise<string>
  • Parameters

    • fileName: string
    • Optional documentName: string
    • Optional maxWidth: number
    • Optional maxHeight: number

    Returns Promise<string>

renderPageImages

  • renderPageImages(fileNameSuffix: string, documentName?: string, maxWidth?: number, maxHeight?: number): Promise<string[]>
  • Renders all pages as images for the given document.

    Parameters

    • fileNameSuffix: string

      The file name suffix when uploading the image. All files will be prefixed with the page index + underscore character.

    • Optional documentName: string

      Optional: The name of the document you want to render the pages images for. If not provided the one marked as thumbnail will be taken, otherwise the preview document, or as last try the first/primary document.

    • Optional maxWidth: number

      Optional: Maximum render width. Defaults to 400.

    • Optional maxHeight: number

      Optional: Maximum render height. Defaults to 400.

    Returns Promise<string[]>

resetImageFilters

  • resetImageFilters(propertyId: string, imageMeta?: { brightness?: number; contrast?: number; hueRotate?: number; invert?: number; sepia?: number; vivid?: number }): Promise<void>
  • Resets all image filters (meta-values) of an image-property to default

    Parameters

    • propertyId: string
    • Optional imageMeta: { brightness?: number; contrast?: number; hueRotate?: number; invert?: number; sepia?: number; vivid?: number }

      optional parameter, can be used to set all image-filters to specific values.

      • Optional brightness?: number
      • Optional contrast?: number
      • Optional hueRotate?: number
      • Optional invert?: number
      • Optional sepia?: number
      • Optional vivid?: number

    Returns Promise<void>

resizePrintess

  • resizePrintess(immediate?: boolean, focusSelection?: boolean, width?: number, height?: number, focusFormFieldId?: string): void
  • Trigger a resize and fit of the current page, can focus the selection alternatively.

    Parameters

    • Optional immediate: boolean

      Optional: Determines if resize should wait for a second or happens immediatly

    • Optional focusSelection: boolean

      Optional: Will zoom to current selection

    • Optional width: number

      Optional: Overrides the retrieved offsetWidth of the printess container - helpfull when animation are longer running

    • Optional height: number

      Optional: Overrides the retrieved offsetHeight of the printess container - helpfull when animation are longer running

    • Optional focusFormFieldId: string

    Returns void

rotateImage

  • rotateImage(propertyId: string, angle: "0" | "90" | "180" | "270"): Promise<null | iExternalImage>
  • Rotates an image by 90deg and saves the result as new image and assigns rotated image to frame automatically.

    Parameters

    • propertyId: string
    • angle: "0" | "90" | "180" | "270"

    Returns Promise<null | iExternalImage>

save

  • save(): Promise<string>
  • Saves current artwork

    Returns Promise<string>

    saveToken which you can pass on attachPrintess() or load()

saveAndPublish

  • saveAndPublish(name: string): Promise<void>
  • Saves and publishes the template.

    Parameters

    • name: string

      The name you want to save the template under.

    Returns Promise<void>

saveJson

  • saveJson(): Promise<string>

selectBackground

  • selectBackground(): Promise<void>

selectDocumentAndSpread

  • selectDocumentAndSpread(docId: string, spreadIndex: number, part?: "entire" | "left-page" | "right-page"): Promise<void>
  • Selects a document and a spread and brings it into view. spread-index is zero based and even a facing page counts as a single spread. You can pass the focus area in the partparameter.

    Parameters

    • docId: string

      ID of document to select

    • spreadIndex: number

      zero-based

    • Optional part: "entire" | "left-page" | "right-page"

      "entire" | "left-page" | "right-page"

    Returns Promise<void>

selectFrames

  • selectFrames(propertyId: string): Promise<void>
  • Select frame by propertyId. Fires a subsequent selection changed callback.

    Parameters

    • propertyId: string

    Returns Promise<void>

selectSpread

  • selectSpread(spreadIndex: number, part?: "entire" | "left-page" | "right-page"): Promise<void>
  • Selects a spread and brings it into view. spread-index is zero based and even a facing page counts as a single spread. You can pass the focus area in the partparameter.

    Parameters

    • spreadIndex: number

      zero-based

    • Optional part: "entire" | "left-page" | "right-page"

      "entire" | "left-page" | "right-page"

    Returns Promise<void>

setDocumentSize

  • setDocumentSize(documentName: string, widthInDocUnit: number, heightInDocUnit: number): Promise<void>
  • Sets the size of a specific document

    Parameters

    • documentName: string

      Name of the document to change

    • widthInDocUnit: number

      12 equals e.g. "12cm"

    • heightInDocUnit: number

      12 equals e.g. "12cm"

    Returns Promise<void>

setEditorText

  • setEditorText(text: string): boolean
  • Replaces multi-line text only works with a current active multi-line-text-editor

    Parameters

    • text: string

      The text to insert in to the active multi-line editor

    Returns boolean

setFormFieldValue

  • setFormFieldValue(fieldName: string, newValue: string): Promise<void>
  • Sets the value of a form field

    Parameters

    • fieldName: string
    • newValue: string

      Must be string and will be converted if neccessary

    Returns Promise<void>

setIFrameViewPort

  • setIFrameViewPort(v: { height: number; offsetTop: number }): void
  • only for internal use, to transfer visual-viewport to iOs in iframe-mode

    Parameters

    • v: { height: number; offsetTop: number }
      • height: number
      • offsetTop: number

    Returns void

setImageMetaProperty

  • setImageMetaProperty(propertyId: string, name: "scale" | "sepia" | "brightness" | "saturate" | "invert" | "contrast" | "grayscale" | "vivid" | "hueRotate", value: string | number): Promise<void>
  • Method to set an image meta-property Set the image itself via setProperty()

    Parameters

    • propertyId: string
    • name: "scale" | "sepia" | "brightness" | "saturate" | "invert" | "contrast" | "grayscale" | "vivid" | "hueRotate"
    • value: string | number

    Returns Promise<void>

setImagePlacement

  • setImagePlacement(which: "fit" | "fill" | "face" | "group", propertyId?: string): Promise<void | (iExternalImageScaleHints & { scale: number })>
  • Sets image placement based on selection, can only handle a single selected image for now. TODO: Support for propertyId will follow

    Parameters

    • which: "fit" | "fill" | "face" | "group"
    • Optional propertyId: string

    Returns Promise<void | (iExternalImageScaleHints & { scale: number })>

setJson

  • setJson(jsonString: string): Promise<void>

setNumberUiProperty

  • Sets a numric values based on a retrieved number model. Number models can have different value ranges than the values stored in printess If a number value has been retrieved by getNumberUi its mandatory to set it via setNumberUiProperty

    Parameters

    Returns Promise<void>

setProperty

setStep

  • setStep(index: number, zoom?: "frame" | "spread"): Promise<void>
  • Parameters

    • index: number

      Sets step by index

    • Optional zoom: "frame" | "spread"

    Returns Promise<void>

setTextStyleProperty

  • setTextStyleProperty(propertyId: string, name: "font" | "color" | "size" | "hAlign" | "vAlign", value: string, textStyleMode?: textStyleModeEnum): Promise<void>
  • Method to set a text style meta-property

    Parameters

    • propertyId: string
    • name: "font" | "color" | "size" | "hAlign" | "vAlign"
    • value: string
    • Optional textStyleMode: textStyleModeEnum

    Returns Promise<void>

setZoomMode

  • setZoomMode(m: "frame" | "spread"): void
  • Tells printess the zoom mode to use for the next resize operation spread zooms to the entire page framezooms to the selected frame(s)

    Parameters

    • m: "frame" | "spread"

    Returns void

showAlertOnClose

  • showAlertOnClose(): boolean
  • Indicates if UI should show an alert prompt when user attempts to leave the buyer-side

    Returns boolean

showImageDistributionButton

  • showImageDistributionButton(): boolean

showLayoutsDialog

  • showLayoutsDialog(): boolean
  • Indicates if a Layouts Dialog should be displayed when initially opening the Buyer Side to choose a Layout Snippet

    Returns boolean

showOverlay

  • showOverlay(message: string): void
  • Displays a grey overlay on printess editor

    Parameters

    • message: string

      Message to show on overlay

    Returns void

showPageNavigation

  • showPageNavigation(): boolean

showPhotoTab

  • showPhotoTab(): boolean
  • If Tab-Navigation is enabled, this method tells if a "PHOTO" tab makes sense.

    Returns boolean

showSearchBar

  • showSearchBar(): boolean
  • Returns if buyer ui should display the search bar for searching through images

    Returns boolean

showTabNavigation

  • showTabNavigation(): boolean

showUndoRedo

  • showUndoRedo(): boolean

spreadCount

  • spreadCount(): number

stepHeaderDisplay

  • stepHeaderDisplay(): "never" | "only title" | "only badge" | "title and badge" | "badge list" | "tabs list"
  • Returns the template settings for display of steps header on desktop and mobile

    Returns "never" | "only title" | "only badge" | "title and badge" | "badge list" | "tabs list"

stepNumbersDisplayed

  • stepNumbersDisplayed(): boolean

uiHintsDisplay

  • uiHintsDisplay(): ("layoutSnippets" | "groupSnippets" | "editableFrames" | "expertMode")[]
  • returns an array of uiHints to be displayed on buyer side.

    Returns ("layoutSnippets" | "groupSnippets" | "editableFrames" | "expertMode")[]

undo

  • undo(): void

undoCount

  • undoCount(): number

unexpireJson

  • unexpireJson(saveToken: string): Promise<void>
  • Expects a apreviously saved buyer artwork identified by a saveToken and ensures that this work will never be deleted from DB

    Parameters

    • saveToken: string

    Returns Promise<void>

uploadImage

  • uploadImage(file: File, progressCallback?: (percent: number, state?: "upload" | "optimization") => void, assignToFrameOrNewFrame?: boolean, propertyId?: string): Promise<null | iExternalImage>
  • Uploads a single image to Printess and can auto assign this image

    Parameters

    • file: File
    • Optional progressCallback: (percent: number, state?: "upload" | "optimization") => void
        • (percent: number, state?: "upload" | "optimization"): void
        • Parameters

          • percent: number
          • Optional state: "upload" | "optimization"

          Returns void

    • Optional assignToFrameOrNewFrame: boolean
    • Optional propertyId: string

    Returns Promise<null | iExternalImage>

uploadImages

  • uploadImages(files: null | FileList, progressCallback?: (percent: number, state?: "upload" | "optimization") => void, assignToFrameOrNewFrame?: boolean, propertyId?: string): Promise<iExternalImage[]>
  • Uploads one or many images to Printess and can auto assign the first image

    Parameters

    • files: null | FileList
    • Optional progressCallback: (percent: number, state?: "upload" | "optimization") => void
        • (percent: number, state?: "upload" | "optimization"): void
        • Parameters

          • percent: number
          • Optional state: "upload" | "optimization"

          Returns void

    • Optional assignToFrameOrNewFrame: boolean

      Auto assigns the first image to the current slection or a specific frame

    • Optional propertyId: string

      Auto assigns the first image to a specific frame identified via property Id.

    Returns Promise<iExternalImage[]>

validate

  • validate(mode?: "all" | "until-current-step" | "selection"): iExternalError[]
  • Returns an array of external property errors that can be used to display errors like missing text to the customer

    Parameters

    • Optional mode: "all" | "until-current-step" | "selection"

      Specifies when and up to which point the validation should be done.

    Returns iExternalError[]

zoomIn

  • zoomIn(): void

zoomOut

  • zoomOut(): void

Generated using TypeDoc