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
BedrockMission!

Learn More

View all

Sign in to view all badges

Script enable Attachment in PDF using liveCycle and users can enjoy the function with Adobe Reader?

Avatar

Avatar
Level 1
Jacky_Ouyang
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
Jacky_Ouyang
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
View profile
Jacky_Ouyang
Level 1

26-10-2016

Hello Everyone

I have a question on attachment please.

I am current working on a PDF that requires users to attach multiple files (e.g. Invoices). After reading so many posts, I still confuse about is that even possible.

This PDF form is created from LiveCycle but all other users are using adobe reader. Examples I found online seems only works with Acrobat and the function can't even fire up in adobe reader. If I would like to use the comment attachment function in adobe reader, the form must be flatten first and that will defeat the purpose of using PDF Form.

Ideally, it would be great if I can combine the pdf form and the other pdf files instead of attaching it, but i don't think it will work for users when they are using adobe reader.

Does anyone have an idea on how can I program the attachment function using LiveCycle designer, that allow users to attach and retrieve in their adobe reader please?

Many Thanks.

----- Codes I found that is close to what I wanted to do, but does not work on adobe reader-----

//==Attach==

var myDoc = event.target;

var sFile = "myFile" + NumericField1.rawValue;

myDoc.importDataObject({cName: sFile});

var myDataObject = myDoc.getDataObject(sFile);

var sFileName = myDataObject.path;

ListBox1.addItem(sFileName,sFile);

NumericField1.rawValue = NumericField1.rawValue + 1;

//==Retrieve==

try{

var myDoc = event.target;

var sFile = ListBox1.rawValue;

myDoc.exportDataObject({ cName: sFile, nLaunch: 2 });

}

catch(e)

{

app.alert("There are no files to open");

}

//==Remove==

Untitled.#subform[0].Button3::click - (JavaScript, client)

try{

var myDoc = event.target;

var sFile = ListBox1.rawValue;

app.alert(sFile);

myDoc.removeDataObject(sFile);

ListBox1.deleteItem(ListBox1.selectedIndex);

NumericField1.rawValue = NumericField1.rawValue - 1;

}

catch(e)

{

app.alert("Error in removing document");

}

xfa.layout.relayout();

Accepted Solutions (0)

Answers (3)

Answers (3)

Avatar

Avatar
Level 1
arunpriyan89483
Level 1

Likes

0 likes

Total Posts

10 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
arunpriyan89483
Level 1

Likes

0 likes

Total Posts

10 posts

Correct Reply

0 solutions
View profile
arunpriyan89483
Level 1

04-12-2017

Hi,

I'm creating PDF form and trying add the attachment which is excel file in adobe livecycle designer ES8.2

The excel should converted to XML data while submitting the form. Could you please share script for this.

Appreciated your help!!

Avatar

Avatar
Level 1
Jacky_Ouyang
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
Jacky_Ouyang
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
View profile
Jacky_Ouyang
Level 1

27-10-2016

Thanks Radzmar

So there are no ways around it?

Avatar

Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile

Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
MVP

26-10-2016

To enable Reader to add/remove attachments you need LiveCycle Reader Extensions, which is a very expensive module for LiveCycle server product (not LiveCycle Designer!).

Understanding Reader Extensions > Adobe LiveCycle Designer: Working with PDF and Acrobat