mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +02:00
Move the Default{...}LayerFactory
into a new web/default_factory.js
file
This patch, first of all, removes circular dependencies in the TypeScript definitions. Secondly, it also moves `RenderingStates` into `web/ui_utils.js` to break another type-dependency and directly use the `XfaLayerBuilder` during XFA-printing. Finally, note that this patch *slightly* reduces the size of the default viewer (e.g. in the `MOZCENTRAL` build) by not having to bundle code which is completely unused.
This commit is contained in:
parent
e0dba504d2
commit
e19020c028
21 changed files with 221 additions and 186 deletions
|
@ -17,9 +17,7 @@
|
|||
// eslint-disable-next-line max-len
|
||||
/** @typedef {import("../src/display/display_utils").PageViewport} PageViewport */
|
||||
/** @typedef {import("./interfaces").IPDFLinkService} IPDFLinkService */
|
||||
/** @typedef {import("./interfaces").IPDFXfaLayerFactory} IPDFXfaLayerFactory */
|
||||
|
||||
import { SimpleLinkService } from "./pdf_link_service.js";
|
||||
import { XfaLayer } from "pdfjs-lib";
|
||||
|
||||
/**
|
||||
|
@ -122,30 +120,4 @@ class XfaLayerBuilder {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @implements IPDFXfaLayerFactory
|
||||
*/
|
||||
class DefaultXfaLayerFactory {
|
||||
/**
|
||||
* @param {HTMLDivElement} pageDiv
|
||||
* @param {PDFPageProxy} pdfPage
|
||||
* @param {AnnotationStorage} [annotationStorage]
|
||||
* @param {Object} [xfaHtml]
|
||||
*/
|
||||
createXfaLayerBuilder(
|
||||
pageDiv,
|
||||
pdfPage,
|
||||
annotationStorage = null,
|
||||
xfaHtml = null
|
||||
) {
|
||||
return new XfaLayerBuilder({
|
||||
pageDiv,
|
||||
pdfPage,
|
||||
annotationStorage,
|
||||
linkService: new SimpleLinkService(),
|
||||
xfaHtml,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export { DefaultXfaLayerFactory, XfaLayerBuilder };
|
||||
export { XfaLayerBuilder };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue