Opens the preview mode. Would not do anything if the editor is already in preview mode or if there is no preview available.
This sub interface will allow to interact with the preview mode of the editor. All communication calls to the preview go through a message queue and are executed asynchronously.
Get the page currently displayed within the preview. Note that this will only work for previews which support the page information. Installed previews:
The callback will be triggered once the page information is available. The callback will receive the page index as parameter.
Registers a script command. This allows to trigger actions in the editor from the preview.
The command name to register.
The callback will be triggered if the preview triggers the command. The callback will receive the parameter passed from the preview.
Runs a command in the preview. The list of supported commands depends on the preview implementation. This allows to trigger actions in the preview from the editor.
Installed previews:
The command name to trigger.
The parameter to pass to the command.
Sets the page currently displayed within the preview. Note that this will only work for previews which support the page information. Installed previews:
The page index to display.
Changes the current page.
The page to change to. Can be either the page index, the page id or the page object.
Flag indicating if the page was changed.
Get the current view port information. Can be used to save and restore the view port later or to manipulate the view port based on the current context.
The current view port information.
Refreshes the current page. This will reload the entire page and re-render all objects. This is useful to ensure any update on the fields is being reflected in the editor. The viewport will be reset to the default view and it has a noticable impact on the user experience.
Causes text and image fields to be redrawn. Based on the flag, the redraw will be forced to be asap or it can be queued up. This will also ensure for image fields that the positioning for auto fit is being recalculated.
Flag to control if the redraw should be forced to be asap or if it can be queued up.
Updates the current view port to the specified values. All parameters are optional. If a parameter is not specified, the current value will be used.
Optional
zoom: numberThe new zoom value.
Optional
x: numberThe new horizontal translation value.
Optional
y: numberThe new vertical translation value.
Adjust the zoom by adding the given amount to the current zoom factor. Note that the min/max zoom levels are being maintained. This can be used to increase or decrease the zoom by a given quantity.
Positive or negative number to adjust the zoom level by adding/substracting the given amount to the current zoom scale.
Zooms to a specific area on the page. This will adjust the scale factor and translate the view port to the center of the given area.
The x coordinate of the area (top left corner) to zoom to.
The y coordinate of the area (top left corner) to zoom to.
The width of the area to zoom to.
The height of the area to zoom to.
The padding to add to the zoomed area. Use 0 to zoom to the exact size of the area.
Adjusts the view by zooming to the given field. This will adjust the scale factor and translate the view port to the center of the field. Note: the method will not change the page. If the field is not on the current page, the method will still zoom to the area where the field would be.
The field object to zoom to.
The mandatory padding parameter adds the given amount of points on all 4 sides of the field to the zoomed area. Use 0 to zoom to the exact size of the field.
Generated using TypeDoc
Interfact with the current view of the editor.