window.addEventListener('webviewerloaded', () => {
    let urlParams = new URLSearchParams(window.location.search);
    let displayName = urlParams.get('displayName');
    let fileUrl = urlParams.get('fileUrl');
    PDFViewerApplication.initializedPromise.then(function () {
        PDFViewerApplication.open({
            url: fileUrl,
            originalUrl: displayName,
        });
        PDFViewerApplication.setTitleUsingUrl(displayName);
    })
});