Fix the inconsistent return type of the PDFDocument.isPureXfa getter

Also (slightly) simplifies a couple of small getters/methods related to the `XFAFactory`-instance.
This commit is contained in:
Jonas Jenwald 2021-10-16 12:28:48 +02:00
parent cd94a44ca1
commit 0e5348180e

View File

@ -900,14 +900,11 @@ class PDFDocument {
} }
get isPureXfa() { get isPureXfa() {
return this.xfaFactory && this.xfaFactory.isValid(); return this.xfaFactory ? this.xfaFactory.isValid() : false;
} }
get htmlForXfa() { get htmlForXfa() {
if (this.xfaFactory) { return this.xfaFactory ? this.xfaFactory.getPages() : null;
return this.xfaFactory.getPages();
}
return null;
} }
async loadXfaImages() { async loadXfaImages() {
@ -1088,10 +1085,9 @@ class PDFDocument {
} }
async serializeXfaData(annotationStorage) { async serializeXfaData(annotationStorage) {
if (this.xfaFactory) { return this.xfaFactory
return this.xfaFactory.serializeData(annotationStorage); ? this.xfaFactory.serializeData(annotationStorage)
} : null;
return null;
} }
get formInfo() { get formInfo() {