Skip to content

Commit

Permalink
Update pdf.js
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenjoezhang committed Feb 11, 2024
1 parent 1539c54 commit ed7ff7a
Show file tree
Hide file tree
Showing 8 changed files with 341 additions and 110 deletions.
39 changes: 19 additions & 20 deletions build/pdf.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2841,14 +2841,10 @@ function getDocument(src) {
const networkStreamPromise = new Promise(function (resolve) {
let networkStream;
if (rangeTransport) {
networkStream = new _transport_stream_js__WEBPACK_IMPORTED_MODULE_10__.PDFDataTransportStream({
length,
initialData: rangeTransport.initialData,
progressiveDone: rangeTransport.progressiveDone,
contentDispositionFilename: rangeTransport.contentDispositionFilename,
networkStream = new _transport_stream_js__WEBPACK_IMPORTED_MODULE_10__.PDFDataTransportStream(rangeTransport, {
disableRange,
disableStream
}, rangeTransport);
});
} else if (!data) {
const createPDFNetworkStream = params => {
if (_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.isNodeJS) {
Expand Down Expand Up @@ -4544,7 +4540,7 @@ class InternalRenderTask {
}
}
const version = "4.1.0";
const build = "247af2e";
const build = "485e9ce";

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });
Expand Down Expand Up @@ -8296,6 +8292,7 @@ class DrawLayer {
use.setAttribute("stroke", "none");
use.setAttribute("fill", "black");
use.setAttribute("fill-rule", "nonzero");
use.classList.add("mask");
}
const use1 = DrawLayer._svgFactory.createElement("use");
root.append(use1);
Expand Down Expand Up @@ -9026,7 +9023,7 @@ class HighlightEditor extends editor_editor.AnnotationEditor {
const {
lastPoint
} = this.#focusOutlines.box;
this.#lastPoint = [(lastPoint[0] - this.x) / this.width, (lastPoint[1] - this.y) / this.height];
this.#lastPoint = [(lastPoint[0] - x) / width, (lastPoint[1] - y) / height];
}
static initialize(l10n, uiManager) {
editor_editor.AnnotationEditor.initialize(l10n, uiManager);
Expand Down Expand Up @@ -16729,15 +16726,17 @@ function updateTextLayer({


class PDFDataTransportStream {
constructor({
length,
initialData,
progressiveDone = false,
contentDispositionFilename = null,
constructor(pdfDataRangeTransport, {
disableRange = false,
disableStream = false
}, pdfDataRangeTransport) {
}) {
(0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.assert)(pdfDataRangeTransport, 'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');
const {
length,
initialData,
progressiveDone,
contentDispositionFilename
} = pdfDataRangeTransport;
this._queuedChunks = [];
this._progressiveDone = progressiveDone;
this._contentDispositionFilename = contentDispositionFilename;
Expand All @@ -16751,27 +16750,27 @@ class PDFDataTransportStream {
this._contentLength = length;
this._fullRequestReader = null;
this._rangeReaders = [];
this._pdfDataRangeTransport.addRangeListener((begin, chunk) => {
pdfDataRangeTransport.addRangeListener((begin, chunk) => {
this._onReceiveData({
begin,
chunk
});
});
this._pdfDataRangeTransport.addProgressListener((loaded, total) => {
pdfDataRangeTransport.addProgressListener((loaded, total) => {
this._onProgress({
loaded,
total
});
});
this._pdfDataRangeTransport.addProgressiveReadListener(chunk => {
pdfDataRangeTransport.addProgressiveReadListener(chunk => {
this._onReceiveData({
chunk
});
});
this._pdfDataRangeTransport.addProgressiveDoneListener(() => {
pdfDataRangeTransport.addProgressiveDoneListener(() => {
this._onProgressiveDone();
});
this._pdfDataRangeTransport.transportReady();
pdfDataRangeTransport.transportReady();
}
_onReceiveData({
begin,
Expand Down Expand Up @@ -17376,7 +17375,7 @@ _display_api_js__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.t


const pdfjsVersion = "4.1.0";
const pdfjsBuild = "247af2e";
const pdfjsBuild = "485e9ce";

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });
Expand Down
2 changes: 1 addition & 1 deletion build/pdf.mjs.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions build/pdf.sandbox.mjs

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/pdf.worker.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -57202,7 +57202,7 @@ if (typeof window === "undefined" && !isNodeJS && typeof self !== "undefined" &&
;// CONCATENATED MODULE: ./src/pdf.worker.js

const pdfjsVersion = "4.1.0";
const pdfjsBuild = "247af2e";
const pdfjsBuild = "485e9ce";

var __webpack_exports__WorkerMessageHandler = __webpack_exports__.WorkerMessageHandler;
export { __webpack_exports__WorkerMessageHandler as WorkerMessageHandler };
Expand Down
11 changes: 7 additions & 4 deletions web/viewer.css
Original file line number Diff line number Diff line change
Expand Up @@ -791,15 +791,18 @@
transform:none;
}

.canvasWrapper svg[data-main-rotation="90"] use:not(.clip){
.canvasWrapper svg[data-main-rotation="90"] mask,
.canvasWrapper svg[data-main-rotation="90"] use:not(.clip, .mask){
transform:matrix(0, 1, -1, 0, 1, 0);
}

.canvasWrapper svg[data-main-rotation="180"] use:not(.clip){
.canvasWrapper svg[data-main-rotation="180"] mask,
.canvasWrapper svg[data-main-rotation="180"] use:not(.clip, .mask){
transform:matrix(-1, 0, 0, -1, 1, 1);
}

.canvasWrapper svg[data-main-rotation="270"] use:not(.clip){
.canvasWrapper svg[data-main-rotation="270"] mask,
.canvasWrapper svg[data-main-rotation="270"] use:not(.clip, .mask){
transform:matrix(0, -1, 1, 0, 0, 1);
}

Expand Down Expand Up @@ -2218,7 +2221,7 @@
@media screen and (forced-colors: active){

#highlightParamsToolbarContainer #editorHighlightThickness .thicknessPicker{
--example-color:HighlightText;
--example-color:CanvasText;
}
}

Expand Down
Loading

0 comments on commit ed7ff7a

Please sign in to comment.