Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

How to use Folder level script to attach file in Reader

Avatar

Not applicable

I am having Interactive pdf  form (XFA based) want to get filled by User in Adobe Reader. There is also functionality of file attachments and Form data submission to web service.

importDataObject for file attachment i did use,Which gives Not Allowed Message due to Priviledged context method in Reader. For that i need to implement Folder level Js on user side.

How to Implement it.

Is there any other idea to implement it ???

Thanx in advance.

7 Replies

Avatar

Not applicable

Thnx Jono,

but After putting code in Folder- level js same error again..

_Err.JPG

Actually, I am using Adobe LiveCycle Desginer.

Is it Possible in this ?? Or Should i use Livecycle SERVER to perform this task.

Please Help

Avatar

Not applicable

Is There any way to attach file through Javascript in Dynamic XFA form ???

Is it Possible in Adobe Acrobat Pro ??

Or i need to download Adobe Reader Extension Server ???

Please Help !!

Avatar

Level 10

It should work in Acrobat Pro, Reader needs to be Extended via the server to allow file attachments.

Avatar

Not applicable

After extending it through server....Would it be automatically extended in Adobe Reader at Client/User Side ????

Avatar

Level 10

Once the PDF is extended it works with Reader. It's a setting in the PDF file itself.

Avatar

Level 1

If you obtain reader extensions you will be able to attach documents to the pdf form via javascript.  The only problem is that if you're expecting the attachment to be carried from one user to the next in the workflow; it will not work without some serious work arounds.

[CODE]

var timeStamp = util.printd("yyyymmddHHmmss, new Date());

xfa.event.importDataObject({cName: "" + timeStamp});

[/CODE]

Our project had to get an adobe consultant to engineer this.  The solution wound up being create a FileAttachment element in the schema.  So the contents of the files attached would be read in and then stored in the with the rest of the form data.  When the form was submitted there was a subprocess that would then construct the pdf document and add it to the list of file attachments we had.  Here is some sample code for reading the file contents...

[CODE]

var oFile = oParent.getDataObjectContents(oDataObjects[i].name);

var vEncodedStream = Net.streamEncode(oFile, "base64");

var sBase64 = util.stringFromStream(vEncodedStream);

[/CODE]