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

Saving a PDF with attached docs

Avatar

Level 1

Hi,

I used Lifecycle Designer to create three buttons ("Add File", "Open File" and "Remove File").

The Add File button has the following code:

var myDoc = event.target;

var sFile = "myFile";

myDoc.importDataObject ({cName: sFile});

var mydataObject = myDoc.getDataObject (sFile);

var sFileName = myDataObject.path;

ProgramCodeLB1.addItem(sFileName,sFile);

Next, the Open File button has the following code:

try{

var myDoc = event.target;

var sFile = ProgramCodeLB1.rawValue;

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

}

catch(e)

{

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

}

Finally, the Remove File button has the following code:

try{

var myDoc = event.target;

var sFile = ProgramCodeLB1.rawValue;

app.alert("You have just removed your Program Code file!");

myDoc.removeDataObject(sFile);

ListBox1.deleteItem(ProgramCodeLB1.selectedIndex);

I am wondering if anyone has been able to save a pdf after you have attached a file to it. The reason I ask is because when I save my file and close and reopen it again the files are no longer available for viewing....?

Any thoughts?

Thanks in advance.

0 Replies

Avatar

Level 8

Are they not attached to the form or is it just the open button that's not working?

Kyle