Skip to content

Commit

Permalink
Update pdf.js
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenjoezhang committed Dec 3, 2023
1 parent 584e42e commit 278012a
Show file tree
Hide file tree
Showing 11 changed files with 1,252 additions and 602 deletions.
893 changes: 713 additions & 180 deletions build/pdf.mjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/pdf.mjs.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions build/pdf.sandbox.mjs

Large diffs are not rendered by default.

22 changes: 16 additions & 6 deletions build/pdf.worker.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ const AnnotationEditorParamsType = {
FREETEXT_OPACITY: 13,
INK_COLOR: 21,
INK_THICKNESS: 22,
INK_OPACITY: 23
INK_OPACITY: 23,
HIGHLIGHT_COLOR: 31,
HIGHLIGHT_OPACITY: 32
};
const PermissionFlag = {
PRINT: 0x04,
Expand Down Expand Up @@ -3996,6 +3998,10 @@ class FlateStream extends DecodeStream {
}
return [codes, maxLen];
}
#endsStreamOnError(err) {
info(err);
this.eof = true;
}
readBlock() {
let buffer, len;
const str = this.str;
Expand All @@ -4007,19 +4013,23 @@ class FlateStream extends DecodeStream {
if (hdr === 0) {
let b;
if ((b = str.getByte()) === -1) {
throw new FormatError("Bad block header in flate stream");
this.#endsStreamOnError("Bad block header in flate stream");
return;
}
let blockLen = b;
if ((b = str.getByte()) === -1) {
throw new FormatError("Bad block header in flate stream");
this.#endsStreamOnError("Bad block header in flate stream");
return;
}
blockLen |= b << 8;
if ((b = str.getByte()) === -1) {
throw new FormatError("Bad block header in flate stream");
this.#endsStreamOnError("Bad block header in flate stream");
return;
}
let check = b;
if ((b = str.getByte()) === -1) {
throw new FormatError("Bad block header in flate stream");
this.#endsStreamOnError("Bad block header in flate stream");
return;
}
check |= b << 8;
if (check !== (~blockLen & 0xffff) && (blockLen !== 0 || check !== 0)) {
Expand Down Expand Up @@ -57116,7 +57126,7 @@ if (typeof window === "undefined" && !isNodeJS && typeof self !== "undefined" &&
;// CONCATENATED MODULE: ./src/pdf.worker.js

const pdfjsVersion = '4.0.0';
const pdfjsBuild = 'f4b396f';
const pdfjsBuild = '6b3ae44';

var __webpack_exports__WorkerMessageHandler = __webpack_exports__.WorkerMessageHandler;
export { __webpack_exports__WorkerMessageHandler as WorkerMessageHandler };
Expand Down
2 changes: 1 addition & 1 deletion build/pdf.worker.mjs.map

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions web/images/toolbarButton-editorHighlight.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 11 additions & 2 deletions web/locale/en-US/viewer.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,17 @@ pdfjs-editor-ink-button-label = Draw
pdfjs-editor-stamp-button =
.title = Add or edit images
pdfjs-editor-stamp-button-label = Add or edit images
pdfjs-editor-remove-button =
.title = Remove
## Remove button for the various kind of editor.

pdfjs-editor-remove-ink-button =
.title = Remove drawing
pdfjs-editor-remove-freetext-button =
.title = Remove text
pdfjs-editor-remove-stamp-button =
.title = Remove image
##

# Editor Parameters
pdfjs-editor-free-text-color-input = Color
Expand Down
Loading

0 comments on commit 278012a

Please sign in to comment.