Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

Attaching files to the PDF

Avatar

Former Community Member
Hi guys,



I would like to add attachments to the PDF form. I found some tutorial using the menu item with the following code:



try

{

app.execMenuItem("AddFileAttachment");

}

catch(e)

{

xfa.host.messageBox("Cannot add an attachment: " + e);

}



This works fine but not in the Acrobat Reader. For my business case the following two options can be possible:



a) using the attachment functionality of Acrobat (e.g. using the menu item)

b) transporting the binary data in the XML content of the PDF form



To a)

Is there another programmatical way to attach files to the PDF supported by the Acrobat Reader?



To b)

Does someone of you know how to read the binary content of a file using Java Script and adding it into the data XML? With this solution, the data can be extracted using the Adobe Document Service. Would be a fine solution.



Thanks for your help.



Thomas
3 Replies

Avatar

Former Community Member
You will need to Reader Extend your forms to allow attachments to be added. Once this is done your code will work.

Avatar

Former Community Member
Hi Paul,



thanks for you post. Sounds really good. But how can this be done?



Could you please give me a hint?



Thanks very much.



Thomas

Avatar

Former Community Member
Reader Extensions is a server based product ..... you can download a trial version if you want to try it out.