1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

Merge pull request #13207 from Snuffleupagus/api-AnnotationStorage-params

[api-minor] Remove the manual passing of an `AnnotationStorage`-instance when calling various API-method
This commit is contained in:
Tim van der Meij 2021-04-09 21:09:16 +02:00 committed by GitHub
commit b0473eb353
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 54 additions and 39 deletions

View file

@ -998,9 +998,7 @@ const PDFViewerApplication = {
try {
this._ensureDownloadComplete();
const data = await this.pdfDocument.saveDocument(
this.pdfDocument.annotationStorage
);
const data = await this.pdfDocument.saveDocument();
const blob = new Blob([data], { type: "application/pdf" });
await this.downloadManager.download(blob, url, filename, sourceEventType);

View file

@ -66,7 +66,7 @@ function composePage(
transform: [PRINT_UNITS, 0, 0, PRINT_UNITS, 0, 0],
viewport: pdfPage.getViewport({ scale: 1, rotation: size.rotation }),
intent: "print",
annotationStorage: pdfDocument.annotationStorage,
includeAnnotationStorage: true,
optionalContentConfigPromise,
};
currentRenderTask = thisRenderTask = pdfPage.render(renderContext);

View file

@ -48,7 +48,7 @@ function renderPage(
transform: [PRINT_UNITS, 0, 0, PRINT_UNITS, 0, 0],
viewport: pdfPage.getViewport({ scale: 1, rotation: size.rotation }),
intent: "print",
annotationStorage: pdfDocument.annotationStorage,
includeAnnotationStorage: true,
optionalContentConfigPromise,
};
return pdfPage.render(renderContext).promise;