I have a button on the form to help users add attachements, I can get the name / path / size / filetype - but is there a way to check if the new attachemnt is an xfa form ?
thanks
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
You could use the doc objects openDataObject method, so;
var oDoc = event.target.openDataObject("MyAttachedFile");
console.println(oDoc.xfa !== undefined);
This will print true if the attachment is a XFA form. Opening a form this way still fires all the normal events, initialise, validate etc so if there are any exceptions then I don't think it will open correctly.
Regards
Bruce
Views
Replies
Total Likes
Hi,
You could use the doc objects openDataObject method, so;
var oDoc = event.target.openDataObject("MyAttachedFile");
console.println(oDoc.xfa !== undefined);
This will print true if the attachment is a XFA form. Opening a form this way still fires all the normal events, initialise, validate etc so if there are any exceptions then I don't think it will open correctly.
Regards
Bruce
Views
Replies
Total Likes
thanks bruce for a quick reply - will check this option when i get back from vacation regards steve
Views
Replies
Total Likes
Bruce,
It worked - XFA forms are flagged
var oDoc = event.target;
if (oDoc.dataObjects != null) {
var d = oDoc.dataObjects;
for (var i = 0; i < d.length; i++) {
var sizeKB = (d[i].size/1024).toFixed(1);
app.alert("file: " + d[i].path + ";\nSize: " + sizeKB + "KB;\nDate modified: " + d[i].modDate + ";", 3, 0, "Attachment Information");
var oObj = event.target.openDataObject(d[i].path)
if (oObj.xfa != undefined) {
app.alert("This is an XFA Form",3,0,"XFA check");
}
}
}
Is there a way to check the attachments for Interactive forms and forms with annotations ?
I tried
var annots = oObj.getAnnots({nPage:0});
but this ain't working,
thanks
Steve
Views
Replies
Total Likes
Hi Steve,
I don't think I can help you, I didn't even think that an XFA form could have annotations so this is something I haven't tried.
Good luck,
Bruce
Views
Replies
Total Likes
var oDoc = event.target;
var annots = oDoc.getAnnots({nPage:0});
console.println("Number of Annotations: " + annots.length);
Static XFA documents can have annotations, dynamic can not. The above worked for me
Views
Replies
Total Likes
The problem I am trying to solve is the blocking of intelligent or annotated attachments to our livecycle designer form, as these are causing our downstream processing system to crash. The form requires a number of attachments, and everything was working fine until about 12 months ago when customers started adding more complex pdf's. The form already does checks for attachment file size and file type, I was hoping to extend these checks to block "non flattened" attachments or alternatively to trigger some javascript to flatten the attachment and re-attach - or prompt the user to re-attach.
So oObj.xfa != undefined worked for both dynamic and static xfa attachments
but oObj.getAnnots({nPage:0}) does not seem to work when applied to an attachment object. Should it ? If so I will keep trying !
I also read flattenPages() will not work in Adobe Reader so the option to immediately write out a flattened version of the attachment (and attach the flattened version) will not work either.
Looks like I may be not be able to achieve this checking/filtering of attachments (apart from xfa forms) from within the form.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies