Migrating to V10 of WebViewer
There are a few breaking changes and other deprecated APIs when migrating to v10 from older versions.
Browser support
Starting with WebViewer 10, WebViewer will no longer support IE11. If you still need IE11 while transitioning to a modern browser, then please download WebViewer version 8.12 or below.
Apryse SDK Version Synchronization
Starting with WebViewer 10, the Apryse SDK version will be synchronized with the WebViewer version. This means that the Apryse SDK version will be the same as the WebViewer version. For example, WebViewer 10 will use Apryse SDK 10.
Namespace changes
The Core object is now the entrypoint for the Annotations, PDFNet, Actions, utils, and Tools namespace.
Example:
instance.Core.Annotations
instance.Core.Tools
instance.Core.PDFNet
instance.Core.utils
instance.Core.ActionsIf you are using a custom UI, these would be accessed via the window object: Example:
window.Core.Annotations
...To access the annotationManager and documentViewer objects from the instance you must also use the Core namespace. Note the name change as well for both:
So the following:
Should now be:
XfdfUtils has been renamed XFDFUtils in the Annotation namespace. Example of new usage:
Breaking changes
removeEventListener no longer allows removing an event listener globally. Instead, when calling this API you must specify the function that will be removed for the event listener. If a function is not passed, then you must specify a namespace with the event name. The namespace should match the one you used when adding the event listener. Examples:
APIs removed
Previously deprecated APIs that have been removed:
Document
Document.loadCanvasAsynchas been removed, please use Document.loadCanvasDocument.loadThumbnailAsynchas been removed, please use Document.loadThumbnailDocument.setOfflineModeEnabledhas been removed, please use Document.enableOfflineMode and Document.disableOfflineModeDocument.documentCompletePromisehas been removed, please use Document.getDocumentCompletePromise
DocumentViewer
DocumentViewer.loadAsynchas been removed please use DocumentViewer.loadDocumentDocumentViewer.setEnableAutomaticLinkinghas been removed, please use DocumentViewer.enableAutomaticLinking and DocumentViewer.disableAutomaticLinkingDoumentViewer.setLoadAnnotationsFromVisiblePageshas been removed, please use DocumentViewer.enableLoadingAnnotationsFromVisiblePages and DocumentViewer.disableLoadingAnnotationsFromVisiblePagesDocumentViewer.setOptionshas been removed, please use DocumentViewer.enableAnnotations and DocumentViewer.disableAnnotationsDocumentViewer.getZoomhas been removed, please use DocumentViewer.getZoomLevelDocumentViewer.setEnableStylusModehas been removed, please use DocumentViewer.enableStylusMode and DocumentViewer.disableStylusModeDocumentViewer.getRightToLeftPageshas been removed, please use DocumentViewer.isRightToLeftPageRenderingEnabledDocumentViewer.setRightToLeftPageshas been removed, please use DocumentViewer.enableRightToLeftPageRendering and DocumentViewer.disableRightToLeftPageRenderingDocumentViewer.setViewportRenderModehas been removed, please use DocumentViewer.enableViewportRenderMode and DocumentViewer.disableViewportRenderModeDocumentViewer.enableGrayscaleAnnotationshas been removed, please use DocumentViewer.enableGrayscaleAnnotationsModeDocumentViewer.disableGrayscaleAnnotationshas been removed, please use DocumentViewer.disableGrayscaleAnnotationsMode
Bookmark
Bookmark.getHposhas been removed, please use Bookmark.getHorizontalPositionBookmark.getVPoshas been removed, please use Bookmark.getVerticalPosition
Annotations
Annotation.setRotationControlEnabledhas been replaced with Annotation.setRotationControlEnabled.enableRotationControl and Annotation.setRotationControlEnabled.disableRotationControlAnnotations.Forms.Field.setVisiblehas been replaced with Annotations.Forms.Field.show and Annotations.Forms.Field.hideAnnotations.LineAnnotation.getCenterLeaderPointhas been replaced with Core.Annotations.LineAnnotation.getLeaderLineControlHandlePointAnnotations.PopupAnnotation.setOpenhas been replaced with Annotations.PopupAnnotation.open and Annotations.PopupAnnotation.close
XFDFUtils
XfdfUtils.toXmlDatehas been replaced with XFDFUtils.toXmlDateXfdfUtils.serializePointhas been replaced with XFDFUtils.serializePointXfdfUtils.deserializePointhas been replaced with XFDFUtils.deserializePointXfdfUtils.serializePointArrayhas been replaced with XFDFUtils.serializePointArrayXfdfUtils.deserializePointArrayhas been replaced with XFDFUtils.deserializePointArrayXfdfUtils.serializeRecthas been replaced with XFDFUtils.serializeRectXfdfUtils.deserializeRecthas been replaced with XFDFUtils.deserializeRectXfdfUtils.serializeFringeRecthas been replaced with XFDFUtils.serializeFringeRectXfdfUtils.deserializeFringeRecthas been replaced with XFDFUtils.deserializeFringeRectXfdfUtils.serializeMeasurehas been replaced with XFDFUtils.serializeMeasureXfdfUtils.deserializeMeasurehas been replaced with XFDFUtils.deserializeMeasureXfdfUtils.parseDefaultAppearancehas been replaced with XFDFUtils.parseDefaultAppearance
AnnotationManager
AnnotationManager.getIsAdminUserhas been replaced with AnnotationManager.isUserAdminAnnotationManager.setIsAdminUserhas been replaced with AnnotationManager.promoteUserToAdmin and AnnotationManager.demoteUserFromAdminAnnotationManager.getReadOnlyhas been replaced with AnnotationManager.isReadOnlyModeEnabledAnnotationManager.setReadOnlyhas been replaced with AnnotationManager.enableReadOnlyMode and AnnotationManager.disableReadOnlyModeAnnotationManager.isFreeformRotationEnabledhas been replaced with AnnotationManager.getRotationOptionsAnnotationManager.setFreeformRotationEnabledhas been replaced with AnnotationManager.setRotationOptionsAnnotationManager.enableFreeformRotationhas been replaced with AnnotationManager.setRotationOptionsAnnotationManager.disableFreeformRotationhas been replaced with AnnotationManager.setRotationOptionsAnnotationManager.useFreeTextEditinghas been replaced with AnnotationManager.isFreeTextEditingEnabledAnnotationManager.setRedrawThrottlehas been replaced with AnnotationManager.setRedrawThrottleRateAnnotationManager.exportAnnotCommandhas been replaced with AnnotationManager.exportAnnotationCommandAnnotationManager.importAnnotCommandhas been replaced with AnnotationManager.importAnnotationCommand
Tools
Tools.AnnotationSelectTool.setEnableImmediateActionOnAnnotationSelectionhas been replaced with AnnotationSelectTool.enableImmediateActionOnAnnotationSelection and AnnotationSelectTool.disableImmediateActionOnAnnotationSelectionTools.CalloutCreateTool.setEnableAutoSizedhas been replaced with CalloutCreateTool.enableAutoSizedTextBox and CalloutCreateTool.disableAutoSizedTextBoxTools.DistanceMeasurementCreateTool.setEnableLeaderLineshas been replaced with DistanceMeasurementCreateTool.setLeaderLineDefaultOptionsTools.DistanceMeasurementCreateTool.enableLeaderLineshas been replaced with DistanceMeasurementCreateTool.setLeaderLineDefaultOptionsTools.DistanceMeasurementCreateTool.disableLeaderLineshas been replaced with DistanceMeasurementCreateTool.setLeaderLineDefaultOptionsTools.PolylineCreateTool.setAllowCreationOverAnnotationhas been replaced with PolylineCreateTool.enableCreationOverAnnotation and PolylineCreateTool.disableCreationOverAnnotationTools.RedactionCreateTool.setEnableTextAutoSizehas been replaced with RedactionCreateTool.enableAutoSizedText and RedactionCreateTool.disableAutoSizedTextTools.StickyCreateTool.setAllowCreationOverAnnotationhas been replaced with StickyCreateTool.enableCreationOverAnnotation and StickyCreateTool.disableCreationOverAnnotationTools.StickyCreateTool.setSaveViewStatehas been replaced with StickyCreateTool.enableViewStateSaving and StickyCreateTool.disableViewStateSaving
Core
Core.office2PDFBufferhas been replaced with Core.officeToPDFBufferCore.EventHandler.onhas been replaced with Core.EventHandler.addEventListenerCore.EventHandler.offhas been replaced with Core.EventHandler.removeEventListenerCore.EventHandler.onehas been replaced with Core.EventHandler.addEventListener with{ once: true }Core.setIsWindowsApphas been replaced with Core.setAsWindowsApp and Core.unsetAsWindowsApp
Webviewer UI
UI.setCustomModalhas been replaced with UI.addCustomModalUI event
finishedSavingPDFhas been replaced with fileDownloadedUI.getIsHighContrastModehas been replaced with UI.isHighContrastModeEnabledinstance.isMobileDevicehas been removedUI.setHighContrastModehas been replaced with UI.enableHighContrastMode and UI.disableHighContrastModeUI.showErrorMessagehas been replaced with UI.displayErrorMessageUI.toggleElementhas been replaced with UI.toggleElementVisibilityUI.getSelectedThumbnailPageNumbershas been replaced with UI.ThumbnailsPanel.getSelectedPageNumbersUI.selectThumbnailPageshas been replaced with UI.ThumbnailsPanel.selectPagesUI.unselectThumbnailPageshas been replaced with UI.ThumbnailsPanel.unselectPagesUI.updateOutlineshas been replaced with UI.reloadOutlineUI.useNativeScrollhas been replaced with UI.enableNativeScrolling and UI.disableNativeScrollingUI.setSortNotesByhas been replaced with UI.setNotesPanelSortStrategy
Last updated
Was this helpful?