I read all the annot proprieties but I don't understand which one I have to use for opening such as a double-click on the icon!!!
You can use the doc.openDataObject method, but only for attachments that are PDFs. An exception will be thrown if you attempt to use it to lauch other file types, which is a good thing for security reasons.
Thanks for your answer,
so it is not possible?
I know this method, but a FileAttachment type annot is not looked upon as an object, so this method can't be used!
The file attachment annotations cannot be accessed from the regular data object methods. This is because the file in the annot is not in the name tree, where all the regular attachments live. The embedded file stream is in the actual annotation.
So, the file attachment annot has a property named "attachment", which is the actual file attachment. The content of this file is available through the undocumented "contentStream" property of the attachment property.
var strFileText = util.stringFromStream(selectedAnnots.attachment.contentStream);
Thank you for your answer.
Sorry for this late reply, but I just got the notification...
Since this is an undocumented property, do you have any idea what the attachment.contentStream feedback represents.
Below is the feedback of a test.
%PDF-1.6 % 7 0 obj <</Linearized 1/L 4797/O 9/E 725/N 1/T 4512/H [ 422 118]>> endobj 10 0 obj <</DecodeParms<</Columns 3/Predictor 12>>/Filter/FlateDecode/ID[<8BD9D490C05043E8BFEEFA3F4DFBEAEF><1D69BE13C95A45A3886378EFA78CEE33>]/Index[7 5]/Info 6 0 R/Length 30/Prev 4513/Root 8 0 R/Size 12/Type/XRef/W[1 2 0]>>stream hbbd`b`ab`ab'h` true
I doubted a bit...
Actually there is a way to do this. Use the content stream to create a regular attachment, then open it.