Ask a Question related to Adobe Acrobat SDK, Design and Development.
-
KUMARARAJA@adobeforums.com #1
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
-
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.... -
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... -
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.... -
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... -
Batch method of creating users?
Hi folks, Is there a batch mechanism for creating users? e.g. useradd ? Thanks Andy U -
Leonard_Rosenthol@adobeforums.com #2
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
-
KUMARARAJA@adobeforums.com #3
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
-
Bernd Alheit #4
Re: Method to Run a Batch Sequence programatically
You create a ASCab named params, but never use it.
Bernd Alheit Guest
-
KUMARARAJA@adobeforums.com #5
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
-
Bernd Alheit #6
Re: Method to Run a Batch Sequence programatically
Before you use AVCommandExecute() you must call AVCommandSetInputs() and AVCommandSetParams().
Bernd Alheit Guest
-
KUMARARAJA@adobeforums.com #7
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
-
Bernd Alheit #8
Re: Method to Run a Batch Sequence programatically
What kind of parameters did you use for AVCommandSetInputs() and AVCommandSetParams()?
Bernd Alheit Guest



Reply With Quote

