Generated reference for the iPrintessApi methods tagged #ai-api:viewport-zoom in printess-editor.d.ts. Custom types referenced below (parameter and return shapes) are documented on the Types reference.
allowZoomOptions(): boolean
return if zoom options should be displayed
Returns: boolean
autoScaleDetails(): { enabled: boolean, width: number, height: 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, width: number, height: number }
This method is deprecated.
autoScaleEnabled(): boolean
Returns true if autoScale was set in attachPrintess call
Returns: boolean
centerSelection(focusFormFieldId?: string, forceZoom?: "spread" | "frame"): Promise<number>
Auto Zooms to current selection or spread
| Parameter | Type | Description |
|---|---|---|
focusFormFieldId? |
string |
FF id to zoom to |
forceZoom? |
“spread” | “frame” |
overwrites natural behaviour |
Returns: Promise<number>
centerSpreadInView(part?: "entire" | "left-page" | "right-page"): void
Centers the current spread in the printess view container
| Parameter | Type | Description |
|---|---|---|
part? |
“entire” | “left-page” | “right-page” |
Returns: void
forceZoomToSinglePageOnMobile(): boolean
Ignore entire page click, and always zoom to single page
Returns: boolean
getZoomMode(): "spread" | "frame"
Retrieves the current zoomMode (see setZoomMode())
Returns: “spread” | “frame”
globalScaleFactor(): number
Returns current global scale factor, should be !== 1 only on iOS devices to avoid safari-crashes
Returns: number
hasAnimation(): boolean
Tells if current template has an animation-timeline
Returns: boolean
hasZoomToSelectionButton(focusFormFieldId?: string): boolean
Tells if ui should display a zoom-to-selection button Only returns true if a significant zoom would happen
| Parameter | Type | Description |
|---|---|---|
focusFormFieldId? |
string |
FF id to zoom to |
Returns: boolean
isAnimationPlaying(): boolean
Tells if animation-timeline is playing
Returns: boolean
isIPhone(): boolean
Tells if the current device is an iPhone or iPod.
Returns: boolean
isMobile(): boolean
Tells if printess detects the current device as a mobile device.
Returns: boolean
isSoftwareKeyBoardExpanded(): boolean
On IOS returns if iphone has its keyboard expanded. This can never be 100% accurate.
Returns: boolean
isSpreadInView(part?: "entire" | "left-page" | "right-page"): "entire" | "left-page" | "right-page" | "none"
Tells which part of the current spread is in view: entire, left-page, right-page or none.
| Parameter | Type | Description |
|---|---|---|
part? |
“entire” | “left-page” | “right-page” |
Optional: the specific part to check for. |
Returns: “entire” | “left-page” | “right-page” | “none”
playAnimation(): Promise<void>
Plays animation
Returns: Promise<void>
redo(): void
Executes a redo step if available.
Returns: void
redoCount(): number
Returns number of available redo steps
Returns: number
reRender(): Promise<void>
Forces re-rendering of current document
Returns: Promise<void>
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.
| Parameter | Type | Description |
|---|---|---|
immediate? |
boolean |
Optional: Determines if resize should wait for a second or happens immediately |
focusSelection? |
boolean |
Optional: Will zoom to current selection |
width? |
number |
Optional: Overrides the retrieved offsetWidth of the printess container - helpful when animations are longer running |
height? |
number |
Optional: Overrides the retrieved offsetHeight of the printess container - helpful when animations are longer running |
focusFormFieldId? |
string |
Optional: Form field id to zoom to |
Returns: void
resizePrintessExact(immediate: boolean, focusSelection: boolean, size: iRect, focusFormFieldId?: string, alwaysCenterSpread?: boolean): Promise<void>
Trigger a resize and fit of the current page to an exact target rectangle instead of the measured container size.
immediate and focusSelection behave like in resizePrintess().
| Parameter | Type | Description |
|---|---|---|
immediate |
boolean |
|
focusSelection |
boolean |
|
size |
iRect |
|
focusFormFieldId? |
string |
|
alwaysCenterSpread? |
boolean |
The default value is false |
Returns: Promise<void>
setExternalTopOffset(value: number): void
Shifts the entire printess view up and down in pixels.
| Parameter | Type | Description |
|---|---|---|
value |
number |
Returns: void
setZoomMode(m: "spread" | "frame"): void
Tells printess the zoom mode to use for the next resize operation
spread zooms to the entire page
frame zooms to the selected frame(s)
| Parameter | Type | Description |
|---|---|---|
m |
“spread” | “frame” |
Returns: void
showGridButton(): "on" | "off" | "hide"
Returns if UI should display a button to show and hide the alignment grid
Returns: “on” | “off” | “hide”
showKeyboardShortcuts(): boolean
Returns whether UI should show button to display Keyboard Shortcuts
Returns: boolean
showUndoRedo(): boolean
Returns if buyer ui should display undo and redo buttons
Returns: boolean
stopAnimation(): Promise<void>
Stops animation
Returns: Promise<void>
toggleGrid(): void
Toggles alignment grid
Returns: void
undo(): void
Executes an undo step if available.
Returns: void
undoCount(): number
Returns number of available undo steps
Returns: number
zoomIn(): void
Zoom in on spread visible
Returns: void
zoomOut(): void
Zoom out of spread visible
Returns: void
zoomToFrames(isMobile?: boolean): boolean
Retrieves information if the device is mobile or the screen is so small that zoom to frames is needed
| Parameter | Type | Description |
|---|---|---|
isMobile? |
boolean |
Returns: boolean