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

SOLVED

how i can to attach a document?

Avatar

Level 2

hellow!

I need to attach a document in my form, but I don´t have any idea, somebody could give an idea only, please!

Thank´s

1 Accepted Solution

Avatar

Correct answer by
Level 10

Scripting for attachments is not 'native' to Designer and XFA-based forms. To utilize Acrobat 'Doc' object properties you can do the following:

// form1.page1.btn::click - (JavaScript, client)


var myDoc = event.target;

myDoc.importDataObject("pdfAttachment");

See page 16 of http://partners.adobe.com/public/developer/en/acrobat/sdk/AcroJS_DesignerJS.pdf.

Steve

View solution in original post

0 Replies

Avatar

Level 10

Adding attachments to a PDF is possible under two scenarios:

1) The originating user adds the attachment using Acrobat (not Adobe Reader). Subsequent consumers of the PDF can access the attachment with Acrobat or Reader.

2) If users do not have Acrobat and you are planning on supporting attachments for Reader clients, you must use LiveCycle Reader Extensions ES2 to add a right to a PDF to enable attachments. Any user with Adobe Reader can then add attachments.

Steve

Avatar

Level 2

Ok Steve, but what code do I have to put into my botton (attach)? do you have some example please?

Thank´s

Avatar

Correct answer by
Level 10

Scripting for attachments is not 'native' to Designer and XFA-based forms. To utilize Acrobat 'Doc' object properties you can do the following:

// form1.page1.btn::click - (JavaScript, client)


var myDoc = event.target;

myDoc.importDataObject("pdfAttachment");

See page 16 of http://partners.adobe.com/public/developer/en/acrobat/sdk/AcroJS_DesignerJS.pdf.

Steve

Avatar

Level 2

Ok Steve

And do you know, how could I get the document path?

I´m trying with...

myDoc = event.target;

myDoc.importDataObject("pdfAttachment");

xfa.form.form1.Page1.Contenedor.Documentos.rawValue

= myDoc.path;

I need the path of my attach document pdf, and "myDoc.path" show me the file´s path wrong.

Thank´s