Optionalprops: Partial<ReadonlyallowControl whether or not the export PDF button in the toolbar should be disabled. If the user has insufficient permissions, the feature will automatically be disabled.
This feature requires the download permission in the JWT.
It is possible to remove the export PDF button with the Toolbar API.
ReadonlyallowControl whether or not the printing button in the toolbar should be disabled. If the user has insufficient permissions, the feature will automatically be disabled.
This feature requires the download permission in the JWT, because on some browsers we have to
fall back to downloading the PDF in order to allow performant printing.
It is possible to remove the print button with the Toolbar API.
ReadonlycanThis flag controls whether to enable/disable finger scrolling during Ink Drawing using a pen (safari only)
false, (default), scrolling with the finger in drawing mode
is disabled.true, once a pen input has been detected, finger input will result in scrolling
the document.ReadonlycommentControls how comments are displayed in the viewer in desktop and tablet modes. In mobile devices, comments are always displayed in a drawer a the bottom of the viewport:
ReadonlycurrentThe page index of the page that's currently visible. If there is more than one page visible
this will return the page that is using the most space in the viewport. The pageIndex is
zero-based and has a maximum value of totalPageCount - 1.
ReadonlydisableSnapping to the nearest point is enabled by default in ur SDK for measurement tools. It can be disabled by this API.
ReadonlyenableSet this to false if you want NutrientViewer to disable the annotation toolbar when an annotation is being created or modified.
ReadonlyformThis flag controls what kind of UI interaction is active for widget annotations.
false, (default), clicking on a widget annotation will allow
to modify its value.true, clicking on a widget annotation will select it and
allow moving, resizing and deleting it using the annotation toolbar.This flag can only be set to true if the Form Creator component is included
in the license and the current backend supports it.
ReadonlyinstanceReadonlyinteractionControls the current interaction mode in the viewer. When this value is changed, we will make sure that the state is properly transformed.
If, for example, the user is currently creating an ink annotation and you change this value to
InteractionMode.TEXT, we will delete the current in-memory ink annotation.
For a list of all available mode, please refer to InteractionMode.
If this value is null, no interaction mode will be enabled. This corresponds to the default mode that allows text selection and scrolling using the mouse wheel or scrollbars (and panning on mobile devices).
ReadonlykeepWhen this is enabled, the first spread will always show a single page, even when LayoutMode.DOUBLE is enabled. This is useful for magazines that want to show a cover page before the regular content starts.
A spread is a container for either one or two pages, based on the configured ViewState#layoutMode.
ReadonlykeepThis flag controls whether a selected tool should maintain its selected state after an annotation is created
false, (default), after an annotation has been created the tool is not
selected anymore.true, the tool used to create the annotation will still be selected
and so it'll be possible to keep adding annotations.This feature is available for Note Annotation, Text Annotation, Redaction Annotation, Shape Annotation and Comments. Ink Annotation behaves like this by default, the ink tool stays selected until its deselected either programmatically or via the UI.
ReadonlylayoutControls how pages inside a view are displayed.
ReadonlypageThe spacing between pages in pixels. This value will adjust to the current zoom level, so when you zoom in, it does not appear fixed to the viewport. This spacing only applies for LayoutMode.DOUBLE.
ReadonlypagesThe current rotation of all pages. The value is in degrees and describes a clockwise rotation.
Can either be 0°, 90°, 180°, or 270°. Negative values and values above 270 are normalized to one of the valid rotations.
When a page rotation is set, the values are not persisted in the PDF. This setting only affects how the PDF is viewed in the application.
ReadonlyprerenderedNumber of page spreads to prerender.
Apart from the current page, Nutrient Web SDK prerenders a specific number of page spreads before and after the current page to improve the user experience when scrolling through the document.
A page spread is a container for either one or two pages, based on the configured layout mode. The number of prerendered page spreads is set to 5 by default, which means that Nutrient Web SDK will prerender 5 page spreads before and after the current page.
If set to null, all the page spreads in the document will be prerendered. This setting is not recommended for large documents, as it may
lead to performance issues.
ReadonlypreviewThis flag controls whether to show the marked state or redacted state for redaction annotations.
false, (default), the marked state of redaction annotations
will be shown.true, the redacted state of redaction annotations will be used.This flag can only be set to true if the Redactions component is included
in the license.
ReadonlyreadWhen the read only mode is activated, the UI for creating, updating and deleting annotations will be completely hidden. In addition, the user will also no longer be able to select annotations or modify form field values.
However, it is still possible to add annotations programmatically.
If a read only mode is specified within the JWT itself or in the PDF document permissions, and NutrientViewer.Options.IGNORE_DOCUMENT_PERMISSIONS is not set, this option cannot be unset.
ReadonlyresolvedWhen in LayoutMode.AUTO mode, this property is set to the actual rendered layout mode, which can either be LayoutMode.SINGLE or LayoutMode.DOUBLE. It can be used to be notified when the layout mode changes while still being in LayoutMode.AUTO mode: if the rendered layout mode changes while in NutrientViewer.LayoutMode.AUTO (because of user UI interactions, for example), the viewState.change event will be dispatched, and this property will hold the updated value.
ReadonlyscrollControls how pages can be scrolled.
ReadonlyshowWhen this is enabled, the AI Assistant chat dialog will be shown. If this is disabled, the chat dialog will not be shown.
ReadonlyshowWhen this is set to false, annotation notes will no longer be rendered.
ReadonlyshowWhen this is set to false, annotations will no longer be rendered.
This option can also be set to false, when NutrientViewer.ViewState#readOnly mode is enabled.
ReadonlyshowWhen this is set to false, comments will no longer be rendered.
NutrientViewer ignores this value when you haven't purchased the comments component.
ReadonlyshowControls when the digital signature validation UI will be shown.
ReadonlyshowSet this to true if you want a toolbar for navigation and annotation controls or false
if you don't.
ReadonlysidebarControls the current sidebar mode in the viewer.
For a list of all available mode, please refer to SidebarMode. This can also be set to a custom sidebar ID corresponding to a sidebar passed in ui.sidebar.
If this value is null, the sidebar is hidden. This corresponds to the default mode.
ReadonlysidebarDefines specific options that affect each individual sidebar.
For a list of all available options, please refer to SidebarOptions.
ReadonlysidebarControls the current sidebar placement in the viewer.
ReadonlysidebarControls the width of the sidebar in client, pixel units. Changing the ViewState.sidebarMode does not affect this value.
The default value depends on the current viewport width: if the viewport width is less than 768px, the sidebar will take 100% of the viewport width by default. If the viewport width is greater, the sidebar will take 300px by default.
ReadonlyspreadThe spacing between spreads in pixels. This value will adjust to the current zoom level, so when you zoom in, it does not appear fixed to the viewport. This spacing only applies for ScrollMode.CONTINUOUS.
A spread is a container for either one or two pages, based on the configured ViewState#layoutMode.
ReadonlyviewportThe padding between the viewport and the document in pixels. This value will not increase, when you zoom in.
The horizontal value will be used as padding-left and padding-right and the vertical
value for padding-top and padding-bottom. The same value for both sides will be used, this
means that horizontal: 20 is equal to padding-left: 20px; padding-right: 20px;.
When you set those values to zero, there will be no space between the viewport and the document.
Readonlyhorizontal: numberThe horizontal padding for left and right in pixel.
Readonlyvertical: numberThe vertical padding for top and bottom in pixel.
Returns a new instance of this Record type with all values set to their default values.
Returns a new instance of this Record type with the value for the specific key set to its default value.
Returns the value associated with the provided key, which may be the default value defined when creating the Record factory function.
If the requested key is not defined by this Record type, then notSetValue will be returned if provided. Note that this scenario would produce an error when using Flow or TypeScript.
OptionalnotSetValue: anyDeeply converts this Record to equivalent native JavaScript Object.
Note: This method may not be overridden. Objects with custom serialization to plain JS may override toJSON() instead.
The horizontal padding for left and right in pixel.
The vertical padding for top and bottom in pixel.
Shallowly converts this Record to equivalent native JavaScript Object.
The horizontal padding for left and right in pixel.
The vertical padding for top and bottom in pixel.
Shallowly converts this Record to equivalent JavaScript Object.
The horizontal padding for left and right in pixel.
The vertical padding for top and bottom in pixel.
ReadonlyzoomControls the current zoom factor. This could either be a number multiplier or a ZoomConfiguration or a ZoomMode.
If a number value is used, it must be between Instance#minimumZoomLevel and Instance#maximumZoomLevel.
Note: Using a ZoomMode} will override the padding set using ViewState#viewportPadding
ReadonlyzoomControls the zoom step when zooming in or out using the toolbar buttons.
Returns a new instance of this Record type with all values set to their default values.
Returns a new instance of this Record type with the value for the specific key set to its default value.
Returns the value associated with the provided key, which may be the default value defined when creating the Record factory function.
If the requested key is not defined by this Record type, then notSetValue will be returned if provided. Note that this scenario would produce an error when using Flow or TypeScript.
OptionalnotSetValue: anyCreates a new ViewState with a currentPageIndex increased by one.
This method cannot be called on an instance of ViewState without an Instance assigned. You can use this method on all view states returned by Instance#viewState and Instance#setViewState.
When you hit {@link Instance#totalPageCount} - 1, it will not update the state.
New ViewState with an updated zoom property.
When this method is called on a self-constructed instance of ViewState.
Creates a new ViewState with a currentPageIndex decreased by one.
When you hit 0, it will not update the state.
New ViewState with an updated zoom property.
When this method is called on a self-constructed instance of ViewState.
Creates a new ViewState where all pages are rotated by 90° counterclockwise.
New ViewState with an updated pagesRotation property.
Creates a new ViewState where all pages are rotated by 90° clockwise.
New ViewState with an updated pagesRotation property.
Deeply converts this Record to equivalent native JavaScript Object.
Note: This method may not be overridden. Objects with custom serialization to plain JS may override toJSON() instead.
Control whether or not the export PDF button in the toolbar should be disabled. If the user has insufficient permissions, the feature will automatically be disabled.
This feature requires the download permission in the JWT.
It is possible to remove the export PDF button with the Toolbar API.
Control whether or not the printing button in the toolbar should be disabled. If the user has insufficient permissions, the feature will automatically be disabled.
This feature requires the download permission in the JWT, because on some browsers we have to
fall back to downloading the PDF in order to allow performant printing.
It is possible to remove the print button with the Toolbar API.
This flag controls whether to enable/disable finger scrolling during Ink Drawing using a pen (safari only)
false, (default), scrolling with the finger in drawing mode
is disabled.true, once a pen input has been detected, finger input will result in scrolling
the document.Controls how comments are displayed in the viewer in desktop and tablet modes. In mobile devices, comments are always displayed in a drawer a the bottom of the viewport:
The page index of the page that's currently visible. If there is more than one page visible
this will return the page that is using the most space in the viewport. The pageIndex is
zero-based and has a maximum value of totalPageCount - 1.
Snapping to the nearest point is enabled by default in ur SDK for measurement tools. It can be disabled by this API.
Set this to false if you want NutrientViewer to disable the annotation toolbar when an annotation is being created or modified.
This flag controls what kind of UI interaction is active for widget annotations.
false, (default), clicking on a widget annotation will allow
to modify its value.true, clicking on a widget annotation will select it and
allow moving, resizing and deleting it using the annotation toolbar.This flag can only be set to true if the Form Creator component is included
in the license and the current backend supports it.
Controls the current interaction mode in the viewer. When this value is changed, we will make sure that the state is properly transformed.
If, for example, the user is currently creating an ink annotation and you change this value to
InteractionMode.TEXT, we will delete the current in-memory ink annotation.
For a list of all available mode, please refer to InteractionMode.
If this value is null, no interaction mode will be enabled. This corresponds to the default mode that allows text selection and scrolling using the mouse wheel or scrollbars (and panning on mobile devices).
When this is enabled, the first spread will always show a single page, even when LayoutMode.DOUBLE is enabled. This is useful for magazines that want to show a cover page before the regular content starts.
A spread is a container for either one or two pages, based on the configured ViewState#layoutMode.
This flag controls whether a selected tool should maintain its selected state after an annotation is created
false, (default), after an annotation has been created the tool is not
selected anymore.true, the tool used to create the annotation will still be selected
and so it'll be possible to keep adding annotations.This feature is available for Note Annotation, Text Annotation, Redaction Annotation, Shape Annotation and Comments. Ink Annotation behaves like this by default, the ink tool stays selected until its deselected either programmatically or via the UI.
Controls how pages inside a view are displayed.
The spacing between pages in pixels. This value will adjust to the current zoom level, so when you zoom in, it does not appear fixed to the viewport. This spacing only applies for LayoutMode.DOUBLE.
The current rotation of all pages. The value is in degrees and describes a clockwise rotation.
Can either be 0°, 90°, 180°, or 270°. Negative values and values above 270 are normalized to one of the valid rotations.
When a page rotation is set, the values are not persisted in the PDF. This setting only affects how the PDF is viewed in the application.
Number of page spreads to prerender.
Apart from the current page, Nutrient Web SDK prerenders a specific number of page spreads before and after the current page to improve the user experience when scrolling through the document.
A page spread is a container for either one or two pages, based on the configured layout mode. The number of prerendered page spreads is set to 5 by default, which means that Nutrient Web SDK will prerender 5 page spreads before and after the current page.
If set to null, all the page spreads in the document will be prerendered. This setting is not recommended for large documents, as it may
lead to performance issues.
This flag controls whether to show the marked state or redacted state for redaction annotations.
false, (default), the marked state of redaction annotations
will be shown.true, the redacted state of redaction annotations will be used.This flag can only be set to true if the Redactions component is included
in the license.
When the read only mode is activated, the UI for creating, updating and deleting annotations will be completely hidden. In addition, the user will also no longer be able to select annotations or modify form field values.
However, it is still possible to add annotations programmatically.
If a read only mode is specified within the JWT itself or in the PDF document permissions, and NutrientViewer.Options.IGNORE_DOCUMENT_PERMISSIONS is not set, this option cannot be unset.
When in LayoutMode.AUTO mode, this property is set to the actual rendered layout mode, which can either be LayoutMode.SINGLE or LayoutMode.DOUBLE. It can be used to be notified when the layout mode changes while still being in LayoutMode.AUTO mode: if the rendered layout mode changes while in NutrientViewer.LayoutMode.AUTO (because of user UI interactions, for example), the viewState.change event will be dispatched, and this property will hold the updated value.
Controls how pages can be scrolled.
When this is enabled, the AI Assistant chat dialog will be shown. If this is disabled, the chat dialog will not be shown.
When this is set to false, annotation notes will no longer be rendered.
When this is set to false, annotations will no longer be rendered.
This option can also be set to false, when NutrientViewer.ViewState#readOnly mode is enabled.
When this is set to false, comments will no longer be rendered.
NutrientViewer ignores this value when you haven't purchased the comments component.
Controls when the digital signature validation UI will be shown.
Set this to true if you want a toolbar for navigation and annotation controls or false
if you don't.
Controls the current sidebar mode in the viewer.
For a list of all available mode, please refer to SidebarMode. This can also be set to a custom sidebar ID corresponding to a sidebar passed in ui.sidebar.
If this value is null, the sidebar is hidden. This corresponds to the default mode.
Defines specific options that affect each individual sidebar.
For a list of all available options, please refer to SidebarOptions.
Controls the current sidebar placement in the viewer.
Controls the width of the sidebar in client, pixel units. Changing the ViewState.sidebarMode does not affect this value.
The default value depends on the current viewport width: if the viewport width is less than 768px, the sidebar will take 100% of the viewport width by default. If the viewport width is greater, the sidebar will take 300px by default.
The spacing between spreads in pixels. This value will adjust to the current zoom level, so when you zoom in, it does not appear fixed to the viewport. This spacing only applies for ScrollMode.CONTINUOUS.
A spread is a container for either one or two pages, based on the configured ViewState#layoutMode.
The padding between the viewport and the document in pixels. This value will not increase, when you zoom in.
The horizontal value will be used as padding-left and padding-right and the vertical
value for padding-top and padding-bottom. The same value for both sides will be used, this
means that horizontal: 20 is equal to padding-left: 20px; padding-right: 20px;.
When you set those values to zero, there will be no space between the viewport and the document.
Controls the current zoom factor. This could either be a number multiplier or a ZoomConfiguration or a ZoomMode.
If a number value is used, it must be between Instance#minimumZoomLevel and Instance#maximumZoomLevel.
Note: Using a ZoomMode} will override the padding set using ViewState#viewportPadding
Controls the zoom step when zooming in or out using the toolbar buttons.
Shallowly converts this Record to equivalent native JavaScript Object.
Control whether or not the export PDF button in the toolbar should be disabled. If the user has insufficient permissions, the feature will automatically be disabled.
This feature requires the download permission in the JWT.
It is possible to remove the export PDF button with the Toolbar API.
Control whether or not the printing button in the toolbar should be disabled. If the user has insufficient permissions, the feature will automatically be disabled.
This feature requires the download permission in the JWT, because on some browsers we have to
fall back to downloading the PDF in order to allow performant printing.
It is possible to remove the print button with the Toolbar API.
This flag controls whether to enable/disable finger scrolling during Ink Drawing using a pen (safari only)
false, (default), scrolling with the finger in drawing mode
is disabled.true, once a pen input has been detected, finger input will result in scrolling
the document.Controls how comments are displayed in the viewer in desktop and tablet modes. In mobile devices, comments are always displayed in a drawer a the bottom of the viewport:
The page index of the page that's currently visible. If there is more than one page visible
this will return the page that is using the most space in the viewport. The pageIndex is
zero-based and has a maximum value of totalPageCount - 1.
Snapping to the nearest point is enabled by default in ur SDK for measurement tools. It can be disabled by this API.
Set this to false if you want NutrientViewer to disable the annotation toolbar when an annotation is being created or modified.
This flag controls what kind of UI interaction is active for widget annotations.
false, (default), clicking on a widget annotation will allow
to modify its value.true, clicking on a widget annotation will select it and
allow moving, resizing and deleting it using the annotation toolbar.This flag can only be set to true if the Form Creator component is included
in the license and the current backend supports it.
Controls the current interaction mode in the viewer. When this value is changed, we will make sure that the state is properly transformed.
If, for example, the user is currently creating an ink annotation and you change this value to
InteractionMode.TEXT, we will delete the current in-memory ink annotation.
For a list of all available mode, please refer to InteractionMode.
If this value is null, no interaction mode will be enabled. This corresponds to the default mode that allows text selection and scrolling using the mouse wheel or scrollbars (and panning on mobile devices).
When this is enabled, the first spread will always show a single page, even when LayoutMode.DOUBLE is enabled. This is useful for magazines that want to show a cover page before the regular content starts.
A spread is a container for either one or two pages, based on the configured ViewState#layoutMode.
This flag controls whether a selected tool should maintain its selected state after an annotation is created
false, (default), after an annotation has been created the tool is not
selected anymore.true, the tool used to create the annotation will still be selected
and so it'll be possible to keep adding annotations.This feature is available for Note Annotation, Text Annotation, Redaction Annotation, Shape Annotation and Comments. Ink Annotation behaves like this by default, the ink tool stays selected until its deselected either programmatically or via the UI.
Controls how pages inside a view are displayed.
The spacing between pages in pixels. This value will adjust to the current zoom level, so when you zoom in, it does not appear fixed to the viewport. This spacing only applies for LayoutMode.DOUBLE.
The current rotation of all pages. The value is in degrees and describes a clockwise rotation.
Can either be 0°, 90°, 180°, or 270°. Negative values and values above 270 are normalized to one of the valid rotations.
When a page rotation is set, the values are not persisted in the PDF. This setting only affects how the PDF is viewed in the application.
Number of page spreads to prerender.
Apart from the current page, Nutrient Web SDK prerenders a specific number of page spreads before and after the current page to improve the user experience when scrolling through the document.
A page spread is a container for either one or two pages, based on the configured layout mode. The number of prerendered page spreads is set to 5 by default, which means that Nutrient Web SDK will prerender 5 page spreads before and after the current page.
If set to null, all the page spreads in the document will be prerendered. This setting is not recommended for large documents, as it may
lead to performance issues.
This flag controls whether to show the marked state or redacted state for redaction annotations.
false, (default), the marked state of redaction annotations
will be shown.true, the redacted state of redaction annotations will be used.This flag can only be set to true if the Redactions component is included
in the license.
When the read only mode is activated, the UI for creating, updating and deleting annotations will be completely hidden. In addition, the user will also no longer be able to select annotations or modify form field values.
However, it is still possible to add annotations programmatically.
If a read only mode is specified within the JWT itself or in the PDF document permissions, and NutrientViewer.Options.IGNORE_DOCUMENT_PERMISSIONS is not set, this option cannot be unset.
When in LayoutMode.AUTO mode, this property is set to the actual rendered layout mode, which can either be LayoutMode.SINGLE or LayoutMode.DOUBLE. It can be used to be notified when the layout mode changes while still being in LayoutMode.AUTO mode: if the rendered layout mode changes while in NutrientViewer.LayoutMode.AUTO (because of user UI interactions, for example), the viewState.change event will be dispatched, and this property will hold the updated value.
Controls how pages can be scrolled.
When this is enabled, the AI Assistant chat dialog will be shown. If this is disabled, the chat dialog will not be shown.
When this is set to false, annotation notes will no longer be rendered.
When this is set to false, annotations will no longer be rendered.
This option can also be set to false, when NutrientViewer.ViewState#readOnly mode is enabled.
When this is set to false, comments will no longer be rendered.
NutrientViewer ignores this value when you haven't purchased the comments component.
Controls when the digital signature validation UI will be shown.
Set this to true if you want a toolbar for navigation and annotation controls or false
if you don't.
Controls the current sidebar mode in the viewer.
For a list of all available mode, please refer to SidebarMode. This can also be set to a custom sidebar ID corresponding to a sidebar passed in ui.sidebar.
If this value is null, the sidebar is hidden. This corresponds to the default mode.
Defines specific options that affect each individual sidebar.
For a list of all available options, please refer to SidebarOptions.
Controls the current sidebar placement in the viewer.
Controls the width of the sidebar in client, pixel units. Changing the ViewState.sidebarMode does not affect this value.
The default value depends on the current viewport width: if the viewport width is less than 768px, the sidebar will take 100% of the viewport width by default. If the viewport width is greater, the sidebar will take 300px by default.
The spacing between spreads in pixels. This value will adjust to the current zoom level, so when you zoom in, it does not appear fixed to the viewport. This spacing only applies for ScrollMode.CONTINUOUS.
A spread is a container for either one or two pages, based on the configured ViewState#layoutMode.
The padding between the viewport and the document in pixels. This value will not increase, when you zoom in.
The horizontal value will be used as padding-left and padding-right and the vertical
value for padding-top and padding-bottom. The same value for both sides will be used, this
means that horizontal: 20 is equal to padding-left: 20px; padding-right: 20px;.
When you set those values to zero, there will be no space between the viewport and the document.
Readonlyhorizontal: numberThe horizontal padding for left and right in pixel.
Readonlyvertical: numberThe vertical padding for top and bottom in pixel.
Returns a new instance of this Record type with all values set to their default values.
Returns a new instance of this Record type with the value for the specific key set to its default value.
Returns the value associated with the provided key, which may be the default value defined when creating the Record factory function.
If the requested key is not defined by this Record type, then notSetValue will be returned if provided. Note that this scenario would produce an error when using Flow or TypeScript.
OptionalnotSetValue: anyDeeply converts this Record to equivalent native JavaScript Object.
Note: This method may not be overridden. Objects with custom serialization to plain JS may override toJSON() instead.
The horizontal padding for left and right in pixel.
The vertical padding for top and bottom in pixel.
Shallowly converts this Record to equivalent native JavaScript Object.
The horizontal padding for left and right in pixel.
The vertical padding for top and bottom in pixel.
Shallowly converts this Record to equivalent JavaScript Object.
The horizontal padding for left and right in pixel.
The vertical padding for top and bottom in pixel.
Controls the current zoom factor. This could either be a number multiplier or a ZoomConfiguration or a ZoomMode.
If a number value is used, it must be between Instance#minimumZoomLevel and Instance#maximumZoomLevel.
Note: Using a ZoomMode} will override the padding set using ViewState#viewportPadding
Controls the zoom step when zooming in or out using the toolbar buttons.
Shallowly converts this Record to equivalent JavaScript Object.
Control whether or not the export PDF button in the toolbar should be disabled. If the user has insufficient permissions, the feature will automatically be disabled.
This feature requires the download permission in the JWT.
It is possible to remove the export PDF button with the Toolbar API.
Control whether or not the printing button in the toolbar should be disabled. If the user has insufficient permissions, the feature will automatically be disabled.
This feature requires the download permission in the JWT, because on some browsers we have to
fall back to downloading the PDF in order to allow performant printing.
It is possible to remove the print button with the Toolbar API.
This flag controls whether to enable/disable finger scrolling during Ink Drawing using a pen (safari only)
false, (default), scrolling with the finger in drawing mode
is disabled.true, once a pen input has been detected, finger input will result in scrolling
the document.Controls how comments are displayed in the viewer in desktop and tablet modes. In mobile devices, comments are always displayed in a drawer a the bottom of the viewport:
The page index of the page that's currently visible. If there is more than one page visible
this will return the page that is using the most space in the viewport. The pageIndex is
zero-based and has a maximum value of totalPageCount - 1.
Snapping to the nearest point is enabled by default in ur SDK for measurement tools. It can be disabled by this API.
Set this to false if you want NutrientViewer to disable the annotation toolbar when an annotation is being created or modified.
This flag controls what kind of UI interaction is active for widget annotations.
false, (default), clicking on a widget annotation will allow
to modify its value.true, clicking on a widget annotation will select it and
allow moving, resizing and deleting it using the annotation toolbar.This flag can only be set to true if the Form Creator component is included
in the license and the current backend supports it.
Controls the current interaction mode in the viewer. When this value is changed, we will make sure that the state is properly transformed.
If, for example, the user is currently creating an ink annotation and you change this value to
InteractionMode.TEXT, we will delete the current in-memory ink annotation.
For a list of all available mode, please refer to InteractionMode.
If this value is null, no interaction mode will be enabled. This corresponds to the default mode that allows text selection and scrolling using the mouse wheel or scrollbars (and panning on mobile devices).
When this is enabled, the first spread will always show a single page, even when LayoutMode.DOUBLE is enabled. This is useful for magazines that want to show a cover page before the regular content starts.
A spread is a container for either one or two pages, based on the configured ViewState#layoutMode.
This flag controls whether a selected tool should maintain its selected state after an annotation is created
false, (default), after an annotation has been created the tool is not
selected anymore.true, the tool used to create the annotation will still be selected
and so it'll be possible to keep adding annotations.This feature is available for Note Annotation, Text Annotation, Redaction Annotation, Shape Annotation and Comments. Ink Annotation behaves like this by default, the ink tool stays selected until its deselected either programmatically or via the UI.
Controls how pages inside a view are displayed.
The spacing between pages in pixels. This value will adjust to the current zoom level, so when you zoom in, it does not appear fixed to the viewport. This spacing only applies for LayoutMode.DOUBLE.
The current rotation of all pages. The value is in degrees and describes a clockwise rotation.
Can either be 0°, 90°, 180°, or 270°. Negative values and values above 270 are normalized to one of the valid rotations.
When a page rotation is set, the values are not persisted in the PDF. This setting only affects how the PDF is viewed in the application.
Number of page spreads to prerender.
Apart from the current page, Nutrient Web SDK prerenders a specific number of page spreads before and after the current page to improve the user experience when scrolling through the document.
A page spread is a container for either one or two pages, based on the configured layout mode. The number of prerendered page spreads is set to 5 by default, which means that Nutrient Web SDK will prerender 5 page spreads before and after the current page.
If set to null, all the page spreads in the document will be prerendered. This setting is not recommended for large documents, as it may
lead to performance issues.
This flag controls whether to show the marked state or redacted state for redaction annotations.
false, (default), the marked state of redaction annotations
will be shown.true, the redacted state of redaction annotations will be used.This flag can only be set to true if the Redactions component is included
in the license.
When the read only mode is activated, the UI for creating, updating and deleting annotations will be completely hidden. In addition, the user will also no longer be able to select annotations or modify form field values.
However, it is still possible to add annotations programmatically.
If a read only mode is specified within the JWT itself or in the PDF document permissions, and NutrientViewer.Options.IGNORE_DOCUMENT_PERMISSIONS is not set, this option cannot be unset.
When in LayoutMode.AUTO mode, this property is set to the actual rendered layout mode, which can either be LayoutMode.SINGLE or LayoutMode.DOUBLE. It can be used to be notified when the layout mode changes while still being in LayoutMode.AUTO mode: if the rendered layout mode changes while in NutrientViewer.LayoutMode.AUTO (because of user UI interactions, for example), the viewState.change event will be dispatched, and this property will hold the updated value.
Controls how pages can be scrolled.
When this is enabled, the AI Assistant chat dialog will be shown. If this is disabled, the chat dialog will not be shown.
When this is set to false, annotation notes will no longer be rendered.
When this is set to false, annotations will no longer be rendered.
This option can also be set to false, when NutrientViewer.ViewState#readOnly mode is enabled.
When this is set to false, comments will no longer be rendered.
NutrientViewer ignores this value when you haven't purchased the comments component.
Controls when the digital signature validation UI will be shown.
Set this to true if you want a toolbar for navigation and annotation controls or false
if you don't.
Controls the current sidebar mode in the viewer.
For a list of all available mode, please refer to SidebarMode. This can also be set to a custom sidebar ID corresponding to a sidebar passed in ui.sidebar.
If this value is null, the sidebar is hidden. This corresponds to the default mode.
Defines specific options that affect each individual sidebar.
For a list of all available options, please refer to SidebarOptions.
Controls the current sidebar placement in the viewer.
Controls the width of the sidebar in client, pixel units. Changing the ViewState.sidebarMode does not affect this value.
The default value depends on the current viewport width: if the viewport width is less than 768px, the sidebar will take 100% of the viewport width by default. If the viewport width is greater, the sidebar will take 300px by default.
The spacing between spreads in pixels. This value will adjust to the current zoom level, so when you zoom in, it does not appear fixed to the viewport. This spacing only applies for ScrollMode.CONTINUOUS.
A spread is a container for either one or two pages, based on the configured ViewState#layoutMode.
The padding between the viewport and the document in pixels. This value will not increase, when you zoom in.
The horizontal value will be used as padding-left and padding-right and the vertical
value for padding-top and padding-bottom. The same value for both sides will be used, this
means that horizontal: 20 is equal to padding-left: 20px; padding-right: 20px;.
When you set those values to zero, there will be no space between the viewport and the document.
Readonlyhorizontal: numberThe horizontal padding for left and right in pixel.
Readonlyvertical: numberThe vertical padding for top and bottom in pixel.
Returns a new instance of this Record type with all values set to their default values.
Returns a new instance of this Record type with the value for the specific key set to its default value.
Returns the value associated with the provided key, which may be the default value defined when creating the Record factory function.
If the requested key is not defined by this Record type, then notSetValue will be returned if provided. Note that this scenario would produce an error when using Flow or TypeScript.
OptionalnotSetValue: anyDeeply converts this Record to equivalent native JavaScript Object.
Note: This method may not be overridden. Objects with custom serialization to plain JS may override toJSON() instead.
The horizontal padding for left and right in pixel.
The vertical padding for top and bottom in pixel.
Shallowly converts this Record to equivalent native JavaScript Object.
The horizontal padding for left and right in pixel.
The vertical padding for top and bottom in pixel.
Shallowly converts this Record to equivalent JavaScript Object.
The horizontal padding for left and right in pixel.
The vertical padding for top and bottom in pixel.
Controls the current zoom factor. This could either be a number multiplier or a ZoomConfiguration or a ZoomMode.
If a number value is used, it must be between Instance#minimumZoomLevel and Instance#maximumZoomLevel.
Note: Using a ZoomMode} will override the padding set using ViewState#viewportPadding
Controls the zoom step when zooming in or out using the toolbar buttons.
Creates a new ViewState with a specific zoom level that is 25% greater than the current zoom level.
If a ZoomMode is set, it will overwrite it with a number value (which will no longer adopt when you resize the window).
This method cannot be called on an instance of ViewState without an Instance assigned. You can use this method on all view states returned by Instance#viewState and Instance#setViewState.
When the new zoom level would exceed the maximum zoom level, it will be capped at the maximum value.
New ViewState with an updated zoom property.
When this method is called on a self-constructed instance of ViewState.
Creates a new ViewState with a specific zoom level that is 25% lower than the current zoom level.
If a ZoomMode is set, it will overwrite it with a number value (which will no longer adopt when you resize the window).
This method cannot be called on an instance of ViewState without an Instance assigned. You can use this method on all view states returned by Instance#viewState and Instance#setViewState.
When the new zoom level would undercut the minimum zoom level, it will be capped at the minimum value.
New ViewState with an updated zoom property.
When this method is called on a self-constructed instance of ViewState.
The
ViewStateholds information about the current UI representation of a specific document.It is an Immutable.Record and thus can be updated using
set(key, value), for example:viewState.set("showToolbar", false).An initial
ViewStatecan be set in Configuration.Because the
ViewStateis an immutable data type, you must use Instance#setViewState on the Instance to update it.To be notified when NutrientViewer updates the
ViewState, you can use the dedicated "viewState.change".The following examples show you how to update the
ViewStateand how to get notified aboutViewStatechanges:Example
Adding a listener for the "viewState.change" event
Example
Update values for the immutable state object using NutrientViewer.Instance#setViewState
See