mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-08-03 21:07:24 +02:00
Simplify the serializeXfaData method and related code
Rather than having a dedicated `BasePdfManager`-method for this one call-site we can instead change `PDFDocument.prototype.serializeXfaData` to a non-async method, that we invoke via `BasePdfManager.prototype.ensureDoc`.
This commit is contained in:
parent
91bfe12f38
commit
b531720d9c
@ -1408,7 +1408,7 @@ class PDFDocument {
|
|||||||
this.xfaFactory.appendFonts(pdfFonts, reallyMissingFonts);
|
this.xfaFactory.appendFonts(pdfFonts, reallyMissingFonts);
|
||||||
}
|
}
|
||||||
|
|
||||||
async serializeXfaData(annotationStorage) {
|
serializeXfaData(annotationStorage) {
|
||||||
return this.xfaFactory
|
return this.xfaFactory
|
||||||
? this.xfaFactory.serializeData(annotationStorage)
|
? this.xfaFactory.serializeData(annotationStorage)
|
||||||
: null;
|
: null;
|
||||||
|
|||||||
@ -127,10 +127,6 @@ class BasePdfManager {
|
|||||||
return this.pdfDocument.loadXfaImages();
|
return this.pdfDocument.loadXfaImages();
|
||||||
}
|
}
|
||||||
|
|
||||||
serializeXfaData(annotationStorage) {
|
|
||||||
return this.pdfDocument.serializeXfaData(annotationStorage);
|
|
||||||
}
|
|
||||||
|
|
||||||
cleanup(manuallyTriggered = false) {
|
cleanup(manuallyTriggered = false) {
|
||||||
return this.pdfDocument.cleanup(manuallyTriggered);
|
return this.pdfDocument.cleanup(manuallyTriggered);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -617,7 +617,9 @@ class WorkerMessageHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isPureXfa) {
|
if (isPureXfa) {
|
||||||
promises.push(pdfManager.serializeXfaData(annotationStorage));
|
promises.push(
|
||||||
|
pdfManager.ensureDoc("serializeXfaData", [annotationStorage])
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
for (let pageIndex = 0; pageIndex < numPages; pageIndex++) {
|
for (let pageIndex = 0; pageIndex < numPages; pageIndex++) {
|
||||||
promises.push(
|
promises.push(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user