Some test text!
Web / Guides / Overview
There are a few breaking changes and other deprecated APIs when migrating to v11 from older versions.
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 => {
});
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.
import WebViewer from '@pdftron/webviewer'
WebViewer.Iframe({
path: '/public/webviewer',
licenseKey: 'YOUR_LICENSE_KEY',
}, document.getElementById('viewer'))
.then(instance => {
})
For more information on these changes, please refer to the following guide: Running WebViewer as a Web Component .
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 .
Previously deprecated APIs that have been removed:
FormFieldCreationManager.setFieldFlag
has been removed, please use WidgetAnnotation.setFieldFlagFormFieldCreationManager.setFieldValue
has been removed, please use WidgetAnnotation.setFieldValueFormFieldCreationManager.setFieldOptions
has been removed, please use WidgetAnnotation.setFieldOptionsFormFieldCreationManager.getFieldFlag
has been removed, please use WidgetAnnotation.getFieldFlagFormFieldCreationManager.getFieldName
has been removed, please use WidgetAnnotation.getFieldNameFormFieldCreationManager.getFieldValue
has been removed, please use Field.getValueFormFieldCreationManager.getFieldOptions
has been removed, please use WidgetAnnotation.getFieldOptionsFormFieldCreationManager.getWidgetFromPlaceholder
has been removed, placeholders are no longer utilized.FormFieldCreationManager.applyFormFields
has been removed, fields no longer need to be applied.FormFieldCreationManager.getWidgetFromPlaceholder
has been removed, placeholders are no longer utilized.Core.Annotations.Annotation.isFormFieldPlaceholder
has been removed, placeholders are no longer utilized.Core.Annotations.Annotation.getFormFieldPlaceholderType
has been removed, placeholders are no longer utilized.Core.Annotations.Annotation.getFormFieldPlaceHolderType
has been removed, placeholders are no longer utilized.ImageData
property on Core.Annotations.StampAnnotation
has been removed. Please use the getImageData
and setImageData
functions instead.annot
property on Core.Annotations.SignatureWidgetAnnotation
has been removed. Please use the getAssociatedSignatureAnnotation
and setAssociatedSignatureAnnotation
functions instead.UI.setActiveHeaderGroup
has been removed, please use new UI customization guideDocument.getLinks
API has been removed, and no longer supported in any document type. Please use AnnotationManager.getAnnotationsList and filter annotations of type Annotations.LinkThe 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.
Feature.SideBySideView
has been removed use instance.UI.enterMultiViewerMode and instance.UI.exitMultiViewerMode() instead.Feature.MultiViewerMode
has 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.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 .
annot
property has been removed. Please use getFullSignatureAnnotation or getInitialsAnnotation instead to get the annotation associated with the full signature and initials respectively.ctx
property has been removed. Please use the signatureDrawingCanvases
property instead.autoFocus
optionPreviously, 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
.
annotationManager.addAnnotation(myFreeText); // autoFocus is now false by default
annotationManager.addAnnotation(myFreeText, { autoFocus: true }); // enables autoFocus
Core.SetCachingLevel
has been removed. Please use Core.setCachingLevel
instead.Core.SetPreRenderLevel
has been removed. Please use Core.setPreRenderLevel
instead.On the instance.UI
namespace the following functions were removed:
disableAnnotations
, disableDownload
, disableFilePicker
, disableLocalStorage
, disableMeasurement
, disableNotesPanel
, disablePrint
, disableRedaction
, disableTextSelection
, disableTouchScrollLock
(as well as the enable
versions)
instance.UI.disableFeatures
or instance.UI.enableFeatures
with the corresponding instance.UI.Feature
constant.getAnnotationUser
, instead use Core.annotationManager.getCurrentUser
getCurrentPageNumber
, instead use Core.documentViewer.getCurrentPage
getPageCount
, instead use Core.documentViewer.getPageCount
getShowSideWindow
and getSideWindowVisibility
, instead use UI.isElementOpen('leftPanel')
goToFirstPage
, instead use Core.documentViewer.setCurrentPage(1)
goToLastPage
, instead use Core.documentViewer.setCurrentPage(Core.documentViewer.getPageCount())
goToNextPage
, instead use Core.documentViewer.setCurrentPage(Core.documentViewer.getCurrentPage() + 1)
goToPrevPage
, instead use Core.documentViewer.setCurrentPage(Core.documentViewer.getCurrentPage() - 1)
Trial setup questions? Ask experts on Discord
Need other help? Contact Support
Pricing or product questions? Contact Sales