Yes to the steps with the exception of using the generatePDFOutput object so that the dynamic PDF has its state preserved.
Here is the DDX generated from script using the list generated from extracting the attachments:
<?xml version="1.0" encoding="UTF-8"?>
<DDX xmlns="http://ns.adobe.com/DDX/1.0/">
<PDF result="outDoc">
<FileAttachments source="0">
<File filename="testattach.docx" mimetype="application/vnd.openxmlformats-officedocument.wordprocessingml.document"/>
<FilenameEncoding encoding="UTF-8"/>
</FileAttachments>
<FileAttachments source="1">
<File filename="exceltest.xls" mimetype="application/excel"/>
<FilenameEncoding encoding="UTF-8"/>
</FileAttachments>
<FileAttachments source="2">
<File filename="attachTest.txt" mimetype="text/plain"/>
<FilenameEncoding encoding="UTF-8"/>
</FileAttachments>
<PDF source="3"/>
</PDF>
</DDX>
Hi @jcaltrans
the DDX per se is ok, you would not even need the mimetype. I used a static PDF and added an xlxs file and it showed up allright.
I have a feeling that your extraction of those attachments already goes wrong.
I did a quick DDX only approach which extracts and adds. The file types remain what they were.
<DDX xmlns="http://ns.adobe.com/DDX/1.0/">
<FileAttachments result="attachmentInfo.xml" nameKeys="*" extract="true">
<PDF source="doc3.pdf"/>
<FilenameEncoding encoding="UTF-8"/>
</FileAttachments>
<PDF result="outDoc">
<FileAttachments source="doc3.pdf_attach.0000.0001">
<File filename="testattach.xlsx"/>
<FilenameEncoding encoding="UTF-8"/>
</FileAttachments>
<PDF source="3"/>
</PDF>
</DDX>
This pulls attachments from an XFA PDF and then I can use it to add to a static PDF.
The naming of the attachments source is generic. When you generate your DDX you can dynamically set it.