mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 17:30:09 +02:00
[api-minor] Limit the PDFDocumentLoadingTask.onUnsupportedFeature
functionality to GENERIC builds (PR 15758 follow-up)
This was deprecated in PR 15758 but it's unfortunately quite difficult to tell if third-party users are depending on this, e.g. to implement custom error reporting, and if so to what extent. However, thanks to the pre-processor we can limit *most* of this code to GENERIC builds which still seem like a worthwhile change. These changes reduce the bundle size of the Firefox PDF Viewer by 3.8 kB in total.
This commit is contained in:
parent
0c1fb4e740
commit
1a69d537c1
6 changed files with 159 additions and 105 deletions
|
@ -346,28 +346,31 @@ const OPS = {
|
|||
constructPath: 91,
|
||||
};
|
||||
|
||||
const UNSUPPORTED_FEATURES = {
|
||||
forms: "forms",
|
||||
javaScript: "javaScript",
|
||||
signatures: "signatures",
|
||||
smask: "smask",
|
||||
shadingPattern: "shadingPattern",
|
||||
errorTilingPattern: "errorTilingPattern",
|
||||
errorExtGState: "errorExtGState",
|
||||
errorXObject: "errorXObject",
|
||||
errorFontLoadType3: "errorFontLoadType3",
|
||||
errorFontState: "errorFontState",
|
||||
errorFontMissing: "errorFontMissing",
|
||||
errorFontTranslate: "errorFontTranslate",
|
||||
errorColorSpace: "errorColorSpace",
|
||||
errorOperatorList: "errorOperatorList",
|
||||
errorFontToUnicode: "errorFontToUnicode",
|
||||
errorFontLoadNative: "errorFontLoadNative",
|
||||
errorFontBuildPath: "errorFontBuildPath",
|
||||
errorFontGetPath: "errorFontGetPath",
|
||||
errorMarkedContent: "errorMarkedContent",
|
||||
errorContentSubStream: "errorContentSubStream",
|
||||
};
|
||||
const UNSUPPORTED_FEATURES =
|
||||
typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")
|
||||
? {
|
||||
forms: "forms",
|
||||
javaScript: "javaScript",
|
||||
signatures: "signatures",
|
||||
smask: "smask",
|
||||
shadingPattern: "shadingPattern",
|
||||
errorTilingPattern: "errorTilingPattern",
|
||||
errorExtGState: "errorExtGState",
|
||||
errorXObject: "errorXObject",
|
||||
errorFontLoadType3: "errorFontLoadType3",
|
||||
errorFontState: "errorFontState",
|
||||
errorFontMissing: "errorFontMissing",
|
||||
errorFontTranslate: "errorFontTranslate",
|
||||
errorColorSpace: "errorColorSpace",
|
||||
errorOperatorList: "errorOperatorList",
|
||||
errorFontToUnicode: "errorFontToUnicode",
|
||||
errorFontLoadNative: "errorFontLoadNative",
|
||||
errorFontBuildPath: "errorFontBuildPath",
|
||||
errorFontGetPath: "errorFontGetPath",
|
||||
errorMarkedContent: "errorMarkedContent",
|
||||
errorContentSubStream: "errorContentSubStream",
|
||||
}
|
||||
: null;
|
||||
|
||||
const PasswordResponses = {
|
||||
NEED_PASSWORD: 1,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue