Ask a Question related to Adobe Acrobat SDK, Design and Development.
-
miniCooper@adobeforums.com #1
Creating a Movie Annotation Plug-in
Hi,
I'm trying to create a plug-in that creates a pdf and embeds a movie annotation into the pdf.
The only problem i'm having is locating the correct path to the file.
File Location-> C:/tmp/Surgery.avi
I've tried passing in the file specification as a string via
1) "C:/tmp/Surgery.avi"
2) "C:\\/tmp\\/Surgery.avi"
But none of them seem to be locating the correct movie file. I read about protecting the file path using back slashes in the PDF Reference documentation.
My plug-in creates the pdf and begins to set up the cos object properly but cannot find the correct path ... When I run my plug-in in Acrobat 3D, a window appears saying "C:/tmp/Surgery.avi cannot be found. Would you like to choose a replacement file?"
If someone could help me out, I would greatly appreciate it.
Thanks,
Kristy
Below is my source code to setup my Cos Object
----------------------------------------------
// Create Dictionary and set its Key as "Movie" in the annot dictionary
CosObj dictMovie = CosNewDict ( cosDoc, true, DICTIONARY_SIZE );
CosDictPutKeyString ( cosAnnot, "Movie", dictMovie );
// -----------------------------
// Entries in a movie dictionary
// -----------------------------
// Key = subtype, value = Movie
CosDictPutKeyString(dictMovie, "Subtype", CosNewName(cosDoc, false, ASAtomFromString("Movie")));
// Key = T [Movie Title]
CosDictPutKeyString(dictMovie, "T", CosNewString(cosDoc, false, "Movie Annotation", DICTIONARY_SIZE));
// Key = F [File Specification], Value = movieFileName
CosDictPutKeyString(dictMovie, "F", CosNewString(cosDoc, false, "C:/tmp/Surgery.avi", DICTIONARY_SIZE));
// -------------
// Movie Action
// -------------
CosDictPutKeyString(dictMovie, "S", CosNewName(cosDoc, false, ASAtomFromString("Movie")));
CosDictPutKeyString(dictMovie, "Operation", CosNewName(cosDoc, false, ASAtomFromString("Play")));
miniCooper@adobeforums.com Guest
-
Creating a filesystem directory - is this possible from a plug-in.
I am wondering if this level of File system access is possible using the SDK ? I know that I can read any file system file / directory - but is is... -
Creating single plug-ins from many plug-ins
Hi, I have some 10-15 plug-ins, now i want to create a single plug-ins, which inturn loads all these plug-ins to Acrobat. Is it possible to do... -
Loading a Poster to a Movie Annotation
Hi, I'm trying to add a poster to my movie annotation because when it initially loads before playing, it is a blank rectangle. So, I thought of... -
creating plug ins
How to create our own plug ins in adobe acrobat reader. what are the tools needed and i tried downloadin the sdk from adobe but it asking for the... -
WS Interoperablity: plug-and-play, plug-and-pray, or plug-and-pry?
Hi- Are web services interoperable? The debate continues. The answer is yes and no. The real question is when, where, and how much. Here's a set... -
PDL@adobeforums.com #2
Re: Creating a Movie Annotation Plug-in
"C:\\/tmp\\/Surgery.avi"
This is not the proper way to escape slashes in a Windows path. It should be like this:
"C:\\tmp\\Surgery.avi"
Exactly like you would escape slashes in any C-String. What you have would be interpreted as:
"C:\/tmp\/Surgery.avi"
You may also want to try a device-independant path style, like:
"/C/tmp/Surgery.avi" if you want to avoid escaping slashes by using font slashes.
PDL@adobeforums.com Guest
-
miniCooper@adobeforums.com #3
Re: Creating a Movie Annotation Plug-in
Hi
I just tried "C:\\tmp\\Surgery.avi" and for some reason I got the exact same error. "C:\tmp\Sur" Cannot be found..."
But, I suddenly recognized why I was getting that error. It was b/c I had my DICTIONARY_SIZE set to 10 -> Which only takes the first 10 characters of the path :)
So, in case anyone else has this issue, make sure you specify the correct file path as well as
// Key = F [File Specification], Value = movieFileName
#define DICTIONARY_SIZE 30
CosDictPutKeyString(dictMovie, "F", CosNewString(cosDoc, false, "/C/tmp/Surgery.avi", DICTIONARY_SIZE));
Thanks PDL for your help!!! :)
miniCooper@adobeforums.com Guest
-
Aandi_Inston@adobeforums.com #4
Re: Creating a Movie Annotation Plug-in
Very risky coding, as it relies on counting. C can do that for you.
Instead of
#define DICTIONARY_SIZE 30
CosDictPutKeyString(dictMovie, "F", CosNewString(cosDoc, false,
"/C/tmp/Surgery.avi", DICTIONARY_SIZE));
try something like
#define FILE_NAME "/C/tmp/Surgery.avi"
CosDictPutKeyString(dictMovie, "F", CosNewString(cosDoc, false,
FILE_NAME, strlen(FILE_NAME)));
Aandi Inston
Aandi_Inston@adobeforums.com Guest
-
miniCooper@adobeforums.com #5
Re: Creating a Movie Annotation Plug-in
Oh, right...that is a much better approach -> using the "strlen()" method. :)
Thanks. I'll definitely update my code!
miniCooper@adobeforums.com Guest



Reply With Quote

