These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Opening an attachment using C++

zieglers
Registered: Sep 14 2007
Posts: 4

Hi,
 
I'm trying to open an attachment using SDK. However, I want to open it using C++ code, not with JavaScript.
 
As for now, I can open an attachment using JavaScript 'exportDataObject' function.
What are the equivalent functions in Acrobat SDK (for C++) to importDataObject/exportDataObject/openDataObject/createDataObject?
 
thx,
 
zieglers
 
P.S. i don't wanna use the following code snippet to open my attachment in an external window. I just wanna use C++ functions to open it.
 
this.exportDataObject({ cName: \"Notes\", nLaunch: 2 });
AFExecuteThisScript (myPDDoc, buf, NULL);

My Product Information:
Acrobat Pro 8.0999999999999996447286321199499070644378662109375, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
At the COS Level an attachement is just a bunch of bytes in a stream. As far as I know there are no high level functions for handing data objects. This makes sense, since all operations with data objects in and out of a PDF are platform specific. So here's how you might go about opening it.

Extract the decrypted stream data into a file with the approiate file extension. Then use OS functions to launch it.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script