diff --git a/examples/components/pageviewer.js b/examples/components/pageviewer.js index 01a31161b..b8caf439a 100644 --- a/examples/components/pageviewer.js +++ b/examples/components/pageviewer.js @@ -52,20 +52,6 @@ const loadingTask = pdfjsLib.getDocument({ // Document loaded, retrieving the page. const pdfPage = await pdfDocument.getPage(PAGE_TO_VIEW); - const match = /^(\d+)\.(\d+)\.(\d+)$/.exec(pdfjsLib.version); - if (match && (match[1] | 0) >= 3 && (match[2] | 0) >= 2) { - // Creating the page view with default parameters. - const pdfPageView = new pdfjsViewer.PDFPageView({ - container, - id: PAGE_TO_VIEW, - scale: SCALE, - defaultViewport: pdfPage.getViewport({ scale: SCALE }), - eventBus, - }); - // Associate the actual page with the view, and draw it. - pdfPageView.setPdfPage(pdfPage); - return pdfPageView.draw(); - } // Creating the page view with default parameters. const pdfPageView = new pdfjsViewer.PDFPageView({ container, @@ -73,15 +59,6 @@ const loadingTask = pdfjsLib.getDocument({ scale: SCALE, defaultViewport: pdfPage.getViewport({ scale: SCALE }), eventBus, - // We can enable text/annotation/xfa/struct-layers, as needed. - textLayerFactory: !pdfDocument.isPureXfa - ? new pdfjsViewer.DefaultTextLayerFactory() - : null, - annotationLayerFactory: new pdfjsViewer.DefaultAnnotationLayerFactory(), - xfaLayerFactory: pdfDocument.isPureXfa - ? new pdfjsViewer.DefaultXfaLayerFactory() - : null, - structTreeLayerFactory: new pdfjsViewer.DefaultStructTreeLayerFactory(), }); // Associate the actual page with the view, and draw it. pdfPageView.setPdfPage(pdfPage); diff --git a/web/pdf_viewer.component.js b/web/pdf_viewer.component.js index eeb9272d5..330c76aa2 100644 --- a/web/pdf_viewer.component.js +++ b/web/pdf_viewer.component.js @@ -45,51 +45,8 @@ const pdfjsVersion = PDFJSDev.eval("BUNDLE_VERSION"); // eslint-disable-next-line no-unused-vars const pdfjsBuild = PDFJSDev.eval("BUNDLE_BUILD"); -class DefaultAnnotationLayerFactory { - constructor() { - throw new Error( - "The `DefaultAnnotationLayerFactory` has been removed, " + - "please use the `annotationMode` option when initializing " + - "the `PDFPageView`-instance to control AnnotationLayer rendering." - ); - } -} - -class DefaultStructTreeLayerFactory { - constructor() { - throw new Error( - "The `DefaultStructTreeLayerFactory` has been removed, " + - "this functionality is automatically enabled when the TextLayer is used." - ); - } -} - -class DefaultTextLayerFactory { - constructor() { - throw new Error( - "The `DefaultTextLayerFactory` has been removed, " + - "please use the `textLayerMode` option when initializing " + - "the `PDFPageView`-instance to control TextLayer rendering." - ); - } -} - -class DefaultXfaLayerFactory { - constructor() { - throw new Error( - "The `DefaultXfaLayerFactory` has been removed, " + - "please use the `enableXfa` option when calling " + - "the `getDocument`-function to control XfaLayer rendering." - ); - } -} - export { AnnotationLayerBuilder, - DefaultAnnotationLayerFactory, - DefaultStructTreeLayerFactory, - DefaultTextLayerFactory, - DefaultXfaLayerFactory, DownloadManager, EventBus, GenericL10n,