Fileattachment of annotation

We can attach file in comments tool. Is there any way we can place paperclip icon with file through script under button?

Following script can just place paperclip icon but how can add file as well?

var annot = this.addAnnot({
page: 0,
type: "FileAttachment",
author: "A. C. Robat",
name: "test",
rect: [400, 400, 550, 500],
contents: "Try it again, this time with order and method!",
attachIcon: "Paperclip" });

Though we can attach file with importDataObject, my intention in on paperclip.


Jack Smith


Voted Best Answer

Add this code at the end of your current code:

annot.cAttachmentPath;

It's a bit weird because you're just calling a property, but if you don't specify a file path it will open the File Open dialog and let the user select the file themselves. I think this should have been a method, but never mind...

.


Visit my custom-made PDF scripts website: http://try67.blogspot.com
Contact me personally: try6767@gmail.com


By Gilad D (try67)   


Please specify a reason: