1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 01:58:06 +02:00

XFA - Save filled data in the pdf when downloading the file (Bug 1716288)

- when binding (after parsing) we get a map between some template nodes and some data nodes;
  - so set user data in input handlers in using data node uids in the annotation storage;
  - to save the form, just put the value we have in the storage in the correct data nodes, serialize the xml as a string and then write the string at the end of the pdf using src/core/writer.js;
  - fix few bugs around data bindings:
    - the "Off" issue in Bug 1716980.
This commit is contained in:
Calixte Denizet 2021-06-25 14:31:55 +02:00
parent d7fdb72a3f
commit 429ffdcd2f
17 changed files with 71564 additions and 113 deletions

View file

@ -963,6 +963,13 @@ class PDFDocument {
this.xfaFactory.setFonts(pdfFonts);
}
async serializeXfaData(annotationStorage) {
if (this.xfaFactory) {
return this.xfaFactory.serializeData(annotationStorage);
}
return null;
}
get formInfo() {
const formInfo = {
hasFields: false,