[api-minor] Remove the default-factories from the viewer components (PR 15811 follow-up)

The changes in PR 15811 have now been included in no less than six official releases, hence it should hopefully be OK to remove this now.
This commit is contained in:
Jonas Jenwald 2023-06-23 11:52:43 +02:00
parent e9ccbd2856
commit c5e4a22ee0
2 changed files with 0 additions and 66 deletions

View File

@ -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);

View File

@ -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,