Product: Web viewer
Product Version:10.12.0
Please give a brief summary of your issue:
I want to show error pop-up and block user interaction and loading document.
Please describe your issue and provide steps to reproduce it:
I want to show error pop-up and block user interaction and loading document.
Here is my code:
const AttachedDocsItems = ;
let Annotationsmark = ;
let fileList = ;
let core = ‘’;
const rotationChanges = ;
let isComparePopupOpen = false;
let userID = ‘’;
let isLayover = false;
let isSideBySide = false;
let isRotatingPages = false;
let isDocumentLoading = false;
let currentSettings = {
offComments: false,
offStamps: false,
offAnnotations: false,
offPictures: false,
};
let url = ‘’;
let defaultComparaLayout = ‘’;
const Apryse = {
viewerId: ‘’,
pdffilepath: ‘’,
licenseKey: ‘’,
userId: ‘’,
annotationList: ‘’,
userName: ‘’,
annotationsData: ‘’,
stampData: ‘’,
rotationPage: ‘’,
rotationAngle: ‘’,
saveIcon: ‘’,
viewSettingIcon: ‘’,
compareIcon: ‘’,
turnOffComments: false,
turnOffStamps: false,
turnOffAnnotations: false,
turnOffPictures: false,
turnOffForm: true,
isFrontEndDoc: false,
isAdmin: true,
signatureUrl: ‘’,
permissions: ,
files: ,
compareDefaultLayout: ‘’,
initilize: function () {
$(‘.activityloader’).show();
WebViewer.WebComponent({
path: ‘/GovBuilt.PlanReview/webviewer’,
licenseKey: Apryse.licenseKey,
initialDoc: Apryse.pdffilepath,
loadSpinner: false,
annotationUser: this.userId,
compareDefaultLayout: Apryse.compareDefaultLayout,
permissions: Apryse.permissions,
fullAPI: true,
css: ‘/GovBuilt.PlanReview/css/viewer.min.css’,
}, document.getElementById(Apryse.viewerId))
.then((instance) => {
window.webViewerInstance = instance;
core = instance.Core;
const { documentViewer, annotationManager, Annotations } = instance.Core;
const { Feature } = instance.UI;
const { Color } = Annotations;
const { PDFNet, Tools } = instance.Core;
if (this.isFrontEndDoc) {
instance.UI.disableElement([‘leftPanelButton’]);
instance.UI.disableElement([‘viewControlsButton’]);
instance.UI.disableElement([‘menuButton’]);
instance.UI.disableElement([‘toolbarGroup-Forms’]);
instance.UI.disableElement([‘toolbarGroup-Annotate’]);
instance.UI.disableElement([‘toolbarGroup-Shapes’]);
instance.UI.disableElement([‘toolbarGroup-Edit’]);
instance.UI.disableElement([‘toolbarGroup-Insert’]);
instance.UI.disableElement([‘toolbarGroup-FillAndSign’]);
}
instance.UI.disableFeatures([Feature.FilePicker]);
instance.UI.disableTools([Tools.ToolNames.FILE_ATTACHMENT]);
instance.UI.disableTools([Tools.ToolNames.ADD_IMAGE_CONTENT]);
if (!this.isFrontEndDoc) {
instance.UI.enableFeatures([Feature.Measurement]);
instance.UI.openElements([‘notesPanel’]);
instance.UI.setHeaderItems(header => {
const renderDropdown = () => {
if (this.files == undefined || this.files.length === 0) {
return;
}
const select = document.createElement('select');
select.style.padding = '5px';
this.files.forEach(optionText => {
const option = document.createElement('option');
option.value = optionText.contentItmeId;
option.textContent = `Version ${optionText.versionNumber} - ${optionText.documentName}`;
select.appendChild(option);
});
if (this.files.length === 1)
select.addEventListener('click', (e) => {
isDocumentLoading = true;
Apryse.GetAnnotation(e.target.value, annotationManager, instance);
});
else {
select.addEventListener('change', (e) => {
isDocumentLoading = true;
Apryse.GetAnnotation(e.target.value, annotationManager, instance);
});
}
return select;
};
header.push({
type: 'customElement',
render: renderDropdown,
});
});
}
instance.UI.disableElement('deleteCustomStampButton');
instance.UI.enableElements(['thumbRotateClockwise', 'pageRotationHeader', 'rotatePageClockwise', 'rotatePageCounterClockwise']);
instance.UI.enableElements(['thumbnailsControlRotateClockwise', 'thumbnailsControlRotateCounterClockwise']);
instance.UI.disableElements(['toolbarGroup-Annotate', 'multiSelectModeButton']);
userID = this.userId;
if (this.signatureUrl && this.signatureUrl.length > 0) {
ValidateAndImportSignatures(this.signatureUrl, documentViewer.getTool('AnnotationCreateSignature'));
}
if (this.turnOffPictures === 'True') {
instance.UI.disableElements(['stampToolGroupButton', 'fileAttachmentToolGroupButton']);
}
$(document).on('fullscreenchange', () => {
const $navbar = $('.ta-navbar-top');
if (instance.UI.isFullscreen()) {
$navbar.hide();
}
else {
$navbar.show();
}
});
if (this.turnOffStamps.toString().toLowerCase() === 'true') {
instance.UI.disableElements([
'rubberStampToolGroupButton',
]);
}
if (this.turnOffAnnotations.toString().toLowerCase() === 'true') {
instance.UI.disableElements([
'toolbarGroup-Annotate',
]);
}
if (this.turnOffForm.toString().toLowerCase() === 'true') {
instance.UI.disableElements([
'toolbarGroup-Forms',
]);
}
if (this.turnOffComments.toString().toLowerCase() === 'true') {
instance.UI.disableElements([
'stickyToolGroupButton',
]);
instance.UI.disableReplyForAnnotations(() => true);
}
if (!this.isFrontEndDoc) {
ValidatePermission(this.permissions, instance, annotationManager);
}
Please provide a link to a minimal sample where the issue is reproducible: