The key to this is to create an AcroForm PDF template to store your data. Then you can open that file and write in the data.var doc = event.target;// This opens the AcroForm. It must be contained in the same directory as the XFA form.var reportDoc = app.openDoc({ cPath: "Template.pdf", oDoc: doc, ...