mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-07-29 02:17:22 +02:00
Compare commits
6 Commits
8f4c0169a0
...
11e89b74d9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
11e89b74d9 | ||
|
|
9023395550 | ||
|
|
7f70835830 | ||
|
|
fe19d9666f | ||
|
|
f90732e4c3 | ||
|
|
028e4f7ea8 |
@ -91,12 +91,6 @@ function findUnequal(arr, start, value) {
|
||||
return j;
|
||||
}
|
||||
|
||||
function setValues(arr, start, end, value) {
|
||||
for (let j = start; j < end; ++j) {
|
||||
arr[j] = value;
|
||||
}
|
||||
}
|
||||
|
||||
function reverseValues(arr, start, end) {
|
||||
for (let i = start, j = end - 1; i < j; ++i, --j) {
|
||||
const temp = arr[i];
|
||||
@ -323,7 +317,7 @@ function bidi(str, startLevel = -1, vertical = false) {
|
||||
after = "R";
|
||||
}
|
||||
if (before === after) {
|
||||
setValues(types, i, end, before);
|
||||
types.fill(before, i, end);
|
||||
}
|
||||
i = end - 1; // reset to end (-1 so next iteration is ok)
|
||||
}
|
||||
|
||||
@ -906,6 +906,7 @@ const getSupplementalGlyphMapForCalibri = getLookupTableFactory(function (t) {
|
||||
t[896] = 91;
|
||||
t[897] = 93;
|
||||
t[923] = 64;
|
||||
t[940] = 163;
|
||||
t[1004] = 48;
|
||||
t[1005] = 49;
|
||||
t[1006] = 50;
|
||||
|
||||
@ -1172,6 +1172,37 @@ if (
|
||||
};
|
||||
}
|
||||
|
||||
if (
|
||||
typeof PDFJSDev !== "undefined" &&
|
||||
!PDFJSDev.test("SKIP_BABEL") &&
|
||||
typeof AbortSignal.any !== "function"
|
||||
) {
|
||||
AbortSignal.any = function (iterable) {
|
||||
const ac = new AbortController();
|
||||
const { signal } = ac;
|
||||
|
||||
// Return immediately if any of the signals are already aborted.
|
||||
for (const s of iterable) {
|
||||
if (s.aborted) {
|
||||
ac.abort(s.reason);
|
||||
return signal;
|
||||
}
|
||||
}
|
||||
// Register "abort" listeners for all signals.
|
||||
for (const s of iterable) {
|
||||
s.addEventListener(
|
||||
"abort",
|
||||
() => {
|
||||
ac.abort(s.reason);
|
||||
},
|
||||
{ signal } // Automatically remove the listener.
|
||||
);
|
||||
}
|
||||
|
||||
return signal;
|
||||
};
|
||||
}
|
||||
|
||||
export {
|
||||
_isValidExplicitDest,
|
||||
AbortException,
|
||||
|
||||
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
@ -260,6 +260,7 @@
|
||||
!bug860632.pdf
|
||||
!bug894572.pdf
|
||||
!bug911034.pdf
|
||||
!issue19695.pdf
|
||||
!bug1108301.pdf
|
||||
!issue10301.pdf
|
||||
!bug1157493.pdf
|
||||
|
||||
102
test/pdfs/issue19695.pdf
Normal file
102
test/pdfs/issue19695.pdf
Normal file
@ -0,0 +1,102 @@
|
||||
%PDF-1.7
|
||||
34 0 obj
|
||||
<<
|
||||
/Type /Catalog
|
||||
/Pages 35 0 R
|
||||
>>
|
||||
endobj
|
||||
35 0 obj
|
||||
<<
|
||||
/Type /Pages
|
||||
/MediaBox [ 0 0 200 50 ]
|
||||
/Count 1
|
||||
/Kids [ 36 0 R ]
|
||||
>>
|
||||
endobj
|
||||
36 0 obj
|
||||
<<
|
||||
/Type /Page
|
||||
/Parent 35 0 R
|
||||
/Resources <<
|
||||
/Font <<
|
||||
/F1 37 0 R
|
||||
>>
|
||||
>>
|
||||
/Contents 38 0 R
|
||||
>>
|
||||
endobj
|
||||
37 0 obj
|
||||
<<
|
||||
/BaseFont /Calibri
|
||||
/DescendantFonts [ 12 0 R ]
|
||||
/Encoding /Identity-H
|
||||
/Subtype /Type0
|
||||
/Type /Font
|
||||
>>
|
||||
endobj
|
||||
38 0 obj
|
||||
<<
|
||||
/Length 54
|
||||
>>
|
||||
stream
|
||||
BT
|
||||
10 20 TD
|
||||
/F1 20 Tf
|
||||
<03AC03ED03F0035803EC03EC>Tj
|
||||
ET
|
||||
|
||||
endstream
|
||||
|
||||
endobj
|
||||
12 0 obj
|
||||
<<
|
||||
/BaseFont /Calibri
|
||||
/CIDSystemInfo <<
|
||||
/Ordering (Identity)
|
||||
/Registry (Adobe)
|
||||
/Supplement 0
|
||||
>>
|
||||
/FontDescriptor 13 0 R
|
||||
/Subtype /CIDFontType2
|
||||
/Type /Font
|
||||
/W [ 3 [ 226.074 ] 47 [ 251.953 ] 87 [ 516.602 ] 258 [ 479.004 ] 288 [ 497.559 ] 349 [ 229.492 ] 374 [ 525.391 ] 396 [ 348.633 ] 400 [ 391.113 ] 853 [ 249.512 ] 856 [ 252.441 ] 859 [ 249.512 ] 940 [ 506.836 ] 1004 [ 506.836 ] 1005 [ 506.836 ] 1007 [ 506.836 ] 1008 [ 506.836 ] 1009 [ 506.836 ] 1010 [ 506.836 ] 1011 [ 506.836 ] 1012 [ 506.836 ] 1013 [ 506.836 ] 1085 [ 498.047 ] 3423 [ 500 ] ]
|
||||
>>
|
||||
endobj
|
||||
13 0 obj
|
||||
<<
|
||||
/Ascent 750
|
||||
/CapHeight 0
|
||||
/Descent -250
|
||||
/Flags 32
|
||||
/FontBBox [ -503 -312 1240 1026 ]
|
||||
/FontName /Calibri
|
||||
/ItalicAngle 0
|
||||
/StemV 0
|
||||
/Type /FontDescriptor
|
||||
>>
|
||||
endobj
|
||||
xref
|
||||
0 1
|
||||
0000000000 65535 f
|
||||
12 1
|
||||
0000000477 00000 n
|
||||
13 1
|
||||
0000001044 00000 n
|
||||
34 1
|
||||
0000000009 00000 n
|
||||
35 1
|
||||
0000000060 00000 n
|
||||
36 1
|
||||
0000000146 00000 n
|
||||
37 1
|
||||
0000000252 00000 n
|
||||
38 1
|
||||
0000000371 00000 n
|
||||
trailer
|
||||
<<
|
||||
/Size 7
|
||||
/Root 34 0 R
|
||||
>>
|
||||
startxref
|
||||
1214
|
||||
%%EOF
|
||||
@ -706,6 +706,13 @@
|
||||
"rounds": 1,
|
||||
"type": "load"
|
||||
},
|
||||
{
|
||||
"id": "issue19695",
|
||||
"file": "pdfs/issue19695.pdf",
|
||||
"md5": "963474b8847afc9eeda4ff4635f7a523",
|
||||
"rounds": 1,
|
||||
"type": "eq"
|
||||
},
|
||||
{
|
||||
"id": "openofficearabiccidtruetype-pdf",
|
||||
"file": "pdfs/arial_unicode_ab_cidfont.pdf",
|
||||
|
||||
27
web/app.js
27
web/app.js
@ -559,11 +559,7 @@ const PDFViewerApplication = {
|
||||
}
|
||||
|
||||
if (appConfig.annotationEditorParams) {
|
||||
if (
|
||||
((typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) ||
|
||||
typeof AbortSignal.any === "function") &&
|
||||
annotationEditorMode !== AnnotationEditorType.DISABLE
|
||||
) {
|
||||
if (annotationEditorMode !== AnnotationEditorType.DISABLE) {
|
||||
const editorSignatureButton = appConfig.toolbar?.editorSignatureButton;
|
||||
if (editorSignatureButton && AppOptions.get("enableSignatureEditor")) {
|
||||
editorSignatureButton.parentElement.hidden = false;
|
||||
@ -2075,19 +2071,14 @@ const PDFViewerApplication = {
|
||||
_windowAbortController: { signal },
|
||||
} = this;
|
||||
|
||||
if (
|
||||
(typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) ||
|
||||
typeof AbortSignal.any === "function"
|
||||
) {
|
||||
this._touchManager = new TouchManager({
|
||||
container: window,
|
||||
isPinchingDisabled: () => pdfViewer.isInPresentationMode,
|
||||
isPinchingStopped: () => this.overlayManager?.active,
|
||||
onPinching: this.touchPinchCallback.bind(this),
|
||||
onPinchEnd: this.touchPinchEndCallback.bind(this),
|
||||
signal,
|
||||
});
|
||||
}
|
||||
this._touchManager = new TouchManager({
|
||||
container: window,
|
||||
isPinchingDisabled: () => pdfViewer.isInPresentationMode,
|
||||
isPinchingStopped: () => this.overlayManager?.active,
|
||||
onPinching: this.touchPinchCallback.bind(this),
|
||||
onPinchEnd: this.touchPinchEndCallback.bind(this),
|
||||
signal,
|
||||
});
|
||||
|
||||
function addWindowResolutionChange(evt = null) {
|
||||
if (evt) {
|
||||
|
||||
@ -711,13 +711,7 @@ class PDFViewer {
|
||||
hiddenCapability.resolve();
|
||||
}
|
||||
},
|
||||
{
|
||||
signal:
|
||||
(typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) ||
|
||||
typeof AbortSignal.any === "function"
|
||||
? AbortSignal.any([signal, ac.signal])
|
||||
: signal,
|
||||
}
|
||||
{ signal: AbortSignal.any([signal, ac.signal]) }
|
||||
);
|
||||
|
||||
await Promise.race([
|
||||
@ -914,11 +908,7 @@ class PDFViewer {
|
||||
viewer.before(element);
|
||||
}
|
||||
|
||||
if (
|
||||
((typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) ||
|
||||
typeof AbortSignal.any === "function") &&
|
||||
annotationEditorMode !== AnnotationEditorType.DISABLE
|
||||
) {
|
||||
if (annotationEditorMode !== AnnotationEditorType.DISABLE) {
|
||||
const mode = annotationEditorMode;
|
||||
|
||||
if (pdfDocument.isPureXfa) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user