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

Include a link to attached files: is it possible?

Le_Rouscc
Level 1
Level 1

Hi all,

I have a problem I hope you can help me with.

When using Acrobat,Pro you can add attachments to a PDF file and include a link in the PDF file to this attachment. As a result, if you click on the link, the attachment will open in a new window.

Now, I have created a form in LiveCycle Designer, and on the bottom of the form I would like to include a link to an attached file. However, it seems that I cannot edit the newly created form in Acrobat Pro. Hence, I am not able to include a link to the attached file using the method described above.

I cannot find an option to attach files in LiveCycle Designer, nor a way to link to an attachment. Am I overlooking something, or is it just not possible to include a link to an attachment in a form created in LiveCycle Designer?

Many thanks in advance for your reply!

12 Replies
Josh_Geurian
Level 4
Level 4

I do not think that is an option. Livecycle would not know that the form is attached within the PDF as attachments are in Acrobat; not Livecycle. If you want that kind of functions you would have to create the form in Acrobat.

Le_Rouscc
Level 1
Level 1

Hi Josh,

Thanks for your reply. I have recreated the form in Acrobat and got things working the way I wanted. Problem solved.

_Bruce_Robertson
Level 10
Level 10

Hi,

I guess it is too late now, but you can do this in a LiveCycle Designer form.  Just the same as an Acrobat form, except you refer to the Doc object as event.target.  So to attach a file use this JavaScript;

if (event.target.importDataObject("MyAttachedFile"))

{

    var attachmentObject = event.target.getDataObject("MyAttachedFile");

    console.println("Attachment path="+attachmentObject.path);

}

And, this will open it.

event.target.exportDataObject({ cName: "MyAttachedFile", nLaunch: 2 });

Bruce

lateniteNC
Level 4
Level 4

Bruce:

I believe this is sufficient related to avoid a new thread. Is it possible to open a pdf attachment (using your methods above) but with a twist? Open the document and move to a specific bookmark in the pdf?

_Bruce_Robertson
Level 10
Level 10

Hi,

I don't think so.  You can set a PDF document to open at a particular page when you create it, but I guess you want something dynamic.  If the PDF was available on the web you could open it at a specific bookmark using a nameddest=name query string parameter and the app.launchURL() method.

Regards

Bruce

Anonymous
Not applicable

Hi Bruce,

A few years ago (2013), you posted a possible solution to the problem of providing a link for users to attach files to a PDF created in LiveCycle Designer. Now in 2018, this still seems to be a problem and you were the only person who seemed to offer a solution. I copied your script and placed it in the Script Editor as follows:

if (event.target.importDataObject("MyAttachedFile"))
{
    var attachmentObject = event.target.getDataObject("MyAttachedFile");
    console.println("Attachment path="+attachmentObject.path);
}
event.target.exportDataObject({ cName: "MyAttachedFile", nLaunch: 2 });

However, it seems to work only if someone's using Adobe Acrobat but it doesn't work with Adobe Reader which most users have.

I'm wondering if there's something I'm missing (I'm a novice user of JavaScript and LiveCycle Designer) or if there's something I need to modify in the script.

Thanks very much.

MJ

_Bruce_Robertson
Level 10
Level 10

Hi MJ,

You will have to 'Reader Extend' the form to allow Reader to add attachments, there's a good summary of all this in one of Niall's blogs

Using LiveCycle Forms in Acrobat and Reader | Assure Dynamics developing dynamic LiveCycle and Flex ...

Bruce

Anonymous
Not applicable

Hi Bruce,

Thank you for replying - good to know that you're still online after all. Yes, actually I had saved the LCD form (using Acrobat DC) as a Reader Extended PDF (Enable More Tools, includes form fill & Save). Below is a dropbox link to the form:

Dropbox - ReaderExtendedTest.pdf

Thanks again,

MJ

George_Johnson
Level 6
Level 6

When you Reader-enable with Acrobat, it does not include the usage right that allows Reader to add file attachments. Reader does allow user to add attachments as comments, and it can be done via JavaScript, but not with a dynamic XFA form.

Anonymous
Not applicable

Hi George,

Thanks a lot for your reply. It confirms what I've grasped from a number of posts: LCD will produce dynamic PDFs but can't enable file attachments. Adobe Acrobat can enable file attachments but doesn't have the functionality to produce dynamic PDFs - and unfortunately, can't be used to edit forms created with LCD. Just another way that Adobe manipulates the need to purchase its products.

Regards,

MJ

George_Johnson
Level 6
Level 6

Acrobat can't enable normal file attachments. It can enable commenting, thus allowing Reader to attach files as comments, which is a manual process. This process can be initiated via JavaScript, but the user still has to navigate and select the file to be attached. LiveCycle Designer can create static forms which allow this with Reader.

Anonymous
Not applicable

Yes, you’re correct. Although, using LiveCycle to create static forms is not an option (for me).  I’d only use LiveCycle if the form needed some “dynamic” features and I use InDesign to create static forms.