Method to Run a Batch Sequence programatically

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

  1. #1

    Default Method to Run a Batch Sequence programatically

    Hi,
    I am new to this Acrobat SDK, I have created few Preflight Batch Sequence and am able to run the sequence from Batch Sequences dialog, I am just trying to run the sequence programmatically, IS it possible to achieve? if yes means, which API i need to use, Please direct me to find the solution for my problem.

    I am using
    Acrobat 9 SDK with VS 2005

    Thanks in Advance,

    Regards,
    Kumar.K
    KUMARARAJA@adobeforums.com Guest

  2. Similar Questions and Discussions

    1. batch sequence memory leak?
      I wrote a JavaScript batch sequence and ran it in Acrobat 9 Pro on a folder of PDFs. Acrobat’s memory use steadily increased until it hit 1.1 GB....
    2. submit a list of files to batch sequence with IAC
      Is it possible to submit a list of files to a batch sequence from an external application? I would like to use an external process (e.g. a...
    3. UserControl event & method call sequence
      I have an aspx page that loads an ascx user control. This is what happens: 1. As the aspx page loads it then loads the ascx usercontrol. 2....
    4. Batch sequence - suppress prompts
      I am a novice user of Acrobat. I have succeeded in creating a batch sequence using a Javascript script. Everything works great but I get unwamted...
    5. Batch method of creating users?
      Hi folks, Is there a batch mechanism for creating users? e.g. useradd ? Thanks Andy U
  3. #2

    Default Re: Method to Run a Batch Sequence programatically

    It is possible to achieve using the plugin APIs (see AVCommand), but not the other methods in the SDK.
    Leonard_Rosenthol@adobeforums.com Guest

  4. #3

    Default Re: Method to Run a Batch Sequence programatically

    Thanks for your Reply Mr.Leonard,

    As you have mentioned, i just used AVCommand, here is my code, please let me know where i have made the mistake.

    I am getting "Unhandled exception at 0x03032a1d in Acrobat.exe: 0xC0000005: Access violation reading location 0x00000000." in AVAppRegisterGlobalCommand(cmd);

    Code Follows....

    static AVCommandHandlerRec gAVCmdHandler;
    const char *kCmdName = "ConvertToGray";

    void InitializeCommandHandler()
    {
    memset (&gAVCmdHandler, 0, sizeof(AVCommandHandlerRec));
    gAVCmdHandler.size = sizeof(AVCommandHandlerRec);
    gAVCmdHandler.Work = ASCallbackCreateProto (AVCommandWorkProc, DoWorkImpl);
    AVAppRegisterCommandHandler (ASAtomFromString(kCmdName),&gAVCmdHandler);
    }
    extern ACCB1 void ACCB2 CB_ConvertGray(void *clientData)
    {
    ASAtom cmdName;
    AVCommand cmd;
    ASCab params = ASCabNew();
    ASText text = ASTextNew();
    ASBool doItAll = false;
    const char *kGroupTitle = "ConvertToGray";
    const char *kCmdGenericTitle = "Preflight";

    //Invoke the AVCommand
    cmdName = ASAtomFromString (kCmdName);
    cmd = AVCommandNew(cmdName);
    AVAppRegisterGlobalCommand(cmd);

    if (ASCabNumEntries(params) == 0)
    doItAll = true;
    if (doItAll || ASCabKnown (params, kAVCommandKeyGroupTitle))
    {
    // Create a new text object and insert it into the ASCab
    text = ASTextNew();
    ASTextSetEncoded (text, kGroupTitle, (ASHostEncoding)PDGetHostEncoding());
    ASCabPutText(params, kAVCommandKeyGroupTitle, text);
    }
    if (doItAll || ASCabKnown (params, kAVCommandKeyCanBatch))
    ASCabPutBool (params, kAVCommandKeyCanBatch, true );
    if (doItAll || ASCabKnown (params, kAVCommandKeyGenericTitle))
    {
    //Create a new text object and insert it into the ASCab
    text = ASTextNew();
    ASTextSetEncoded (text, kCmdGenericTitle,(ASHostEncoding)PDGetHostEncoding ());
    ASCabPutText (params, kAVCommandKeyGenericTitle, text);
    }
    if (doItAll || ASCabKnown (params, kAVCommandKeyTitle))
    {
    // Create another text object and insert it into the ASCab
    text = ASTextNew();
    ASTextSetEncoded (text, kCmdName,(ASHostEncoding)PDGetHostEncoding());
    ASCabPutText (params, kAVCommandKeyTitle, text);
    }
    AVCommandExecute(cmd);
    //AVAlertNote("BatchProcess");
    }

    Note: CB_ConvertGray is the callback of a menu Item from my plug-in
    KUMARARAJA@adobeforums.com Guest

  5. #4

    Default Re: Method to Run a Batch Sequence programatically

    You create a ASCab named params, but never use it.
    Bernd Alheit Guest

  6. #5

    Default Re: Method to Run a Batch Sequence programatically

    Sorry Bernd, i don't understand could you please explain me little bit in detail.

    Thanks
    KUMARARAJA@adobeforums.com Guest

  7. #6

    Default Re: Method to Run a Batch Sequence programatically

    Before you use AVCommandExecute() you must call AVCommandSetInputs() and AVCommandSetParams().
    Bernd Alheit Guest

  8. #7

    Default Re: Method to Run a Batch Sequence programatically

    Thanks Bernd,

    As you have mentioned i have added

    AVCommandSetParams(cmd,params);
    AVCommandSetInputs(cmd,params);

    before AVCommandExecute, but while Debugging it throws an Exception.

    "Unhandled exception at 0x03032e5d in Acrobat.exe: 0xC0000005: Access violation reading location 0x00000010."

    Could you please tell me where i made the mistake.

    Thanks,
    Kumar.K
    KUMARARAJA@adobeforums.com Guest

  9. #8

    Default Re: Method to Run a Batch Sequence programatically

    What kind of parameters did you use for AVCommandSetInputs() and AVCommandSetParams()?
    Bernd Alheit 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