Creating a Movie Annotation Plug-in

Ask a Question related to Adobe Acrobat SDK, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. 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...
    2. 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...
    3. 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...
    4. 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...
    5. 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...
  3. #2

    Default 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

  4. #3

    Default 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

  5. #4

    Default 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

  6. #5

    Default 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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139