mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 17:30:09 +02:00
[Acroform] Use the full path to find the node in the XFA datasets where to store the value
I noticed several 'Path not found' errors because of a field called #subform[2]. From the XFA specs, the hash is used for a class of elements in the template tree. When we're looking for a node in the datasets tree, it doesn't make sense to search for a class. Hence the path element starting with a hash are just skipped.
This commit is contained in:
parent
e676c9388d
commit
3a21423386
8 changed files with 135 additions and 5 deletions
|
@ -782,6 +782,15 @@ class PDFDocumentProxy {
|
|||
constructor(pdfInfo, transport) {
|
||||
this._pdfInfo = pdfInfo;
|
||||
this._transport = transport;
|
||||
|
||||
if (typeof PDFJSDev === "undefined" || PDFJSDev.test("TESTING")) {
|
||||
// For testing purposes.
|
||||
Object.defineProperty(this, "getXFADatasets", {
|
||||
value: () => {
|
||||
return this._transport.getXFADatasets();
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2349,6 +2358,15 @@ class WorkerTransport {
|
|||
this.downloadInfoCapability = createPromiseCapability();
|
||||
|
||||
this.setupMessageHandler();
|
||||
|
||||
if (typeof PDFJSDev === "undefined" || PDFJSDev.test("TESTING")) {
|
||||
// For testing purposes.
|
||||
Object.defineProperty(this, "getXFADatasets", {
|
||||
value: () => {
|
||||
return this.messageHandler.sendWithPromise("GetXFADatasets", null);
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#cacheSimpleMethod(name, data = null) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue