Expand my Community achievements bar.

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
Former Community Member

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

4 Replies

Avatar

Former Community Member

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
Former Community Member

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

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----