Migrate to V11 of WebViewer
There are a few breaking changes and other deprecated APIs when migrating to v11 from older versions.
Modular UI
WebViewer is now using the new Modular UI by default. The Modular UI is very flexible and allows for more customization as well as the ability to import and export UI configs. More details can be found in the Migrating to Modular UI guide.
The previous UI is still available and can be used by setting the ui option to legacy in the WebViewer constructor.
WebViewerConstructor(
{
path: '/path/to/your/webviewer',
initialDoc: '/path/to/your/document.pdf',
ui: 'legacy',
},
document.getElementById('viewer')
).then(instance => {
});Web Component
Starting in version 11 WebViewer will be instantiated in a Web Component by default instead of an iframe. This change will affect how you interact with the WebViewer DOM and apply CSS styles.
While Web Component is now the default way to instantiate WebViewer, you can still use an iframe by replacing the WebViewer function with WebViewer.Iframe and it will work as it did before.
For more information on these changes, please refer to the following guide: Running WebViewer as a Web Component.
Form Builder
There are a few breaking changes to the Form Builder experience when migrating to v11 from older versions. More details can be found in the Migrating to v11 Form Builder guide.
APIs removed
Previously deprecated APIs that have been removed:
FormFieldCreationManager
FormFieldCreationManager.setFieldFlaghas been removed, please use WidgetAnnotation.setFieldFlagFormFieldCreationManager.setFieldValuehas been removed, please use WidgetAnnotation.setValueFormFieldCreationManager.setFieldOptionshas been removed, please use WidgetAnnotation.setFieldOptionsFormFieldCreationManager.getFieldFlaghas been removed, please use WidgetAnnotation.getFieldFlagsFormFieldCreationManager.getFieldNamehas been removed, please use WidgetAnnotation.getFieldNameFormFieldCreationManager.getFieldValuehas been removed, please use WidgetAnnotation.getValueFormFieldCreationManager.getFieldOptionshas been removed, please use WidgetAnnotation.getFieldOptionsFormFieldCreationManager.getWidgetFromPlaceholderhas been removed, placeholders are no longer utilized.FormFieldCreationManager.applyFormFieldshas been removed, fields no longer need to be applied.FormFieldCreationManager.getWidgetFromPlaceholderhas been removed, placeholders are no longer utilized.
Annotations
Core.Annotations.Annotation.isFormFieldPlaceholderhas been removed, placeholders are no longer utilized.Core.Annotations.Annotation.getFormFieldPlaceholderTypehas been removed, placeholders are no longer utilized.Core.Annotations.Annotation.getFormFieldPlaceHolderTypehas been removed, placeholders are no longer utilized.The
ImageDataproperty onCore.Annotations.StampAnnotationhas been removed. Please use thegetImageDataandsetImageDatafunctions instead.The
annotproperty onCore.Annotations.SignatureWidgetAnnotationhas been removed. Please use thegetAssociatedSignatureAnnotationandsetAssociatedSignatureAnnotationfunctions instead.
Document
Document.getLinksAPI has been removed, and no longer supported in any document type. Please use AnnotationManager.getAnnotationsList and filter annotations of type Annotations.Link
setStyles parameter change
The Core.Tools.Tool function setStyles previously accepted either an object or a function as a parameter. It now only accepts an object with the properties to be set; it no longer accepts a function.
MultiViewerMode / SideBySideView
Feature.SideBySideViewhas been removed use instance.UI.enterMultiViewerMode and instance.UI.exitMultiViewerMode() instead.Feature.MultiViewerModehas been changed to only enable the button in the view controls flyout rather than enter MultiViewerMode right away. To enter/exit the mode use instance.UI.enterMultiViewerMode and instance.UI.exitMultiViewerMode() instead.
SignatureCreateTool
By default the SignatureCreateTool will now sign all widgets using appearances. Signing with an annotation will still be supported. For more information on these two methods of signing and how to switch between them, please refer to the following guide: Signing with Appearances.
The
annotproperty has been removed. Please use getFullSignatureAnnotation or getInitialsAnnotation instead to get the annotation associated with the full signature and initials respectively.The
ctxproperty has been removed. Please use thesignatureDrawingCanvasesproperty instead.
AnnotationManager.addAnnotation autoFocus option
Previously, if the autoFocus option for the addAnnotation API was not specified, the annotation would automatically focus for editing after being added. In version 11, the autoFocus option will default to false. To retain the previous behavior, developers will now need to explicitly set autoFocus: true when calling addAnnotation.
Core
Core.SetCachingLevelhas been removed. Please useCore.setCachingLevelinstead.Core.SetPreRenderLevelhas been removed. Please useCore.setPreRenderLevelinstead.
UI
On the instance.UI namespace the following functions were removed:
setActiveHeaderGroupinstead use new UI customization guidedisableAnnotations,disableDownload,disableFilePicker,disableLocalStorage,disableMeasurement,disableNotesPanel,disablePrint,disableRedaction,disableTextSelection,disableTouchScrollLock(as well as theenableversions)Instead use
instance.UI.disableFeaturesorinstance.UI.enableFeatureswith the correspondinginstance.UI.Featureconstant.
getAnnotationUser, instead useCore.annotationManager.getCurrentUsergetCurrentPageNumber, instead useCore.documentViewer.getCurrentPagegetPageCount, instead useCore.documentViewer.getPageCountgetShowSideWindowandgetSideWindowVisibility, instead useUI.isElementOpen('leftPanel')goToFirstPage, instead useCore.documentViewer.setCurrentPage(1)goToLastPage, instead useCore.documentViewer.setCurrentPage(Core.documentViewer.getPageCount())goToNextPage, instead useCore.documentViewer.setCurrentPage(Core.documentViewer.getCurrentPage() + 1)goToPrevPage, instead useCore.documentViewer.setCurrentPage(Core.documentViewer.getCurrentPage() - 1)
Last updated
Was this helpful?