Acrobat User Community Forums

You are not logged in.     Log in to your AUC account.     Don't have an account? Sign up today

#1 2007-10-03 16:51:46

mrogers
Member
Registered: 2007-09-20
Posts: 0

Button to Attach File in Reader

In creating/editing a form in LiveCycle, I would like to create a button that my Reader users can click to allow them to attach a file(s) to the form, which they will then submit back to me. I know that the user could simply go to Tools, Comments & Markup, Attach a file as a comment, but this will be too complicated for my very low-tech users. What is the most efficient way of creating this function? Thanks.


My Product Information:
LiveCycle Designer Pro 8 / Windows

Offline

 

#2 2007-10-04 11:47:17

pddesigner
Member

Registered: 2007-04-24
Posts: 64

Re: Button to Attach File in Reader

Follow this link:

http://www.box.net/shared/qimy7l9h7i

Open the PDF (Developing Acrobat® Applications Using JavaScript), search for - keyword - attachment. Select the method you want to use.

Offline

 

#3 2007-10-04 12:29:33

pddesigner
Member

Registered: 2007-04-24
Posts: 64

Re: Button to Attach File in Reader

Make sure your LiveCycle Form is saved as an Acrobat 7 (Static) PDF form so it will be compatible with more users.

Offline

 

#4 2007-10-27 15:02:23

pddesigner
Member

Registered: 2007-04-24
Posts: 64

Re: Button to Attach File in Reader

This code (button click) will email the current PDF as an attachment.

var myDoc = event.target;
myDoc.mailDoc(true, "management@company.com", "supervisor@company.com", "ceo@company.com", "Employment Application Form");

++++++++++++++++++++++++++++

If the file attachment is not FDF, XDP, XFDF, HTML, XML, XFD, OR PDF, use this button click script in LiveCycle.

app.mailMsg(false, "youremail@yourcompany.com; otheremail@yourcompany.com", "","",
"This is the subject", "Please use your email application to attach the excel spreadsheet file to this message.");

This code allows the user to browse their hard drive for the file to attach.

Note: In LiveCycle Designer, you must ensure that the scripting language for the event is set to JavaScript
so that the script will execute correctly at run time.

Make sure all incoming file attachments are throughly check for virus and other nasty programs.

Offline

 

#5 2007-10-29 17:11:11

pddesigner
Member

Registered: 2007-04-24
Posts: 64

Re: Button to Attach File in Reader

The solution I posted is the simpliest way to instruct the user to browse their hard drive for the file to attach.

I'll post another method using LiveCycle that is a little more complicated so I'll need time to write the complete instructions.

Offline

 

#6 2007-10-29 20:14:35

pddesigner
Member

Registered: 2007-04-24
Posts: 64

Re: Button to Attach File in Reader

After further review and testing of a few scripts, I discovered that the only solution to this issue is the one that I posted in my initial response with instructions in the body of the email on having the user attaching a file.

Here are a couple on incomplete scripts that will work in LiveCycle, which you can experiment with.

Put the following javascript on "click" event of a button will pop up a file browser that you can select a file from your client's hard drives.

var myDoc = event.target;
var sFile = "myFile"
myDoc.importDataObject(sFile);


Here is the code to display the selected file name in a text field:

var myDoc = event.target;
var sFile;
myDoc.importDataObject(sFile);
var myDataObject = myDoc.getDataObject(sFile);

TextField1.rawValue = myDataObject.path;

According to the Acrobat JavaScript Scripting Reference, Reader can not use the "importDataObject", unless the PDF has had Extended Reader Usage Rights applied to the PDF. If you manage to get the script to work, you'll have to enable Extended Reader Usage Rights or the person receiving the form must open it in Acrobat Pro OR render the form through Reader Extensions with attachment enabled.

Sorry, I couldn't help.

Offline

 

#7 2007-10-26 15:47:04

thea_ls
Member
Registered: 2007-10-24
Posts: 2

Re: Button to Attach File in Reader

Eugene, I am wanting to do the same thing as  mrogers, but I am unable to access your link which looks like it may have the answer.  Do you know why this is?

Offline

 

#8 2007-10-29 16:51:10

brianscottoliver
Member
From: Washington DC
Registered: 2007-10-29
Posts: 1

Re: Button to Attach File in Reader

Eugene,
I am also wanting to do the same thing and there are no shared files when I open the link.

I would appreciate any help

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson

AcrobatUsers.com  >>  User Groups • News • Events • Articles • Blogs • How To • Resources • Member Log in