• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Use PaperCapture API in .Net

New Here ,
Jul 08, 2010 Jul 08, 2010

Copy link to clipboard

Copied

Hai to All,

               I just want to know how to use PaperCapture API in either VB.Net or C#.Net.. kindly pls help me in this scenario.

Rgds,
Parthasarathy.S

TOPICS
Acrobat SDK and JavaScript

Views

34.7K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 20, 2011 Jul 20, 2011

Copy link to clipboard

Copied

i understand how i can use it in java bit i wanna know i can use it in C++

the VS can't see the System Lib

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 20, 2011 Jul 20, 2011

Copy link to clipboard

Copied

Hi SDK,

normally you only use SendKey from C# or VB or Java but not from C++. But your

idea is not bad to call it directly from the plugin. If you want to use SendKey from

C++ take a look at this explanation here in CodeProject.

What concerns 'Chief Ironside': In the Header Files I found nowhere the parameters

for 'PaperCapture'. Mr. Ironside you first repeated to say that it is documented in the

SDK - please tell us, where 'PaperCapture'  is exactly (?link?) documented in

the Acrobat SDK?

Best regards

Axel Arnold Bangert - Herzogenrath 2011

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 20, 2011 Jul 20, 2011

Copy link to clipboard

Copied

Hi SDK,

yes your idea has been right - a direct call in C++ works 100%. You have to add the

windows.h header.The code is like that:

#include "windows.h"

...

ACCB1 void ACCB2 MyPluginCommand(void *clientData)
{
    PDDoc pddoc;
    AVDoc avDoc = AVAppGetActiveDoc();
    PDDoc pdDoc = AVDocGetPDDoc (avDoc);
    ASAtom cmdName;
    AVCommand cmd;
    cmdName = ASAtomFromString ("PaperCapture");
    cmd = AVCommandNew (cmdName);
    keybd_event(0x0D, 0, 0, 0);                                              // 0x0D is the VK_ENTER
    AVCommandStatus status = AVCommandExecute (cmd);
                                                                                           // ::Sleep(500);
    keybd_event(0x0D, 0, KEYEVENTF_KEYUP, 0);                 // 0x0D is the VK_ENTER
    return;
}

...

The only question that remains, concerns 'Chief Ironside': For we have to know how to

set the other parameters (dpi etc.) In the Header Files I did not find any parameter for

'PaperCapture'. Mr. Ironside you first repeated to say that it is documented in the SDK.

Please tell us, where 'PaperCapture'  is exactly (?link?) documented in the SDK?

Best regards

Axel Arnold Bangert - Herzogenrath 2011

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 20, 2011 Jul 20, 2011

Copy link to clipboard

Copied

thaaaaaaaaaaanks too my best friend AxelArnoldBangert

your last post help me too

but as you say we must search at other way

if i fiend any think to send it in the header file i will post it

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 21, 2011 Jul 21, 2011

Copy link to clipboard

Copied

Hi,

ok, I am using the Trial Version of Acrobat Pro Extended 9.4.5.

Axel Arnold Bangert - Herzogenrath 2011

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 21, 2011 Jul 21, 2011

Copy link to clipboard

Copied

lrosenth plz help us to know how we can set it ?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 21, 2011 Jul 21, 2011

Copy link to clipboard

Copied

Hi,

with the sendKeys we can set ClearScan for example like that:

ACCB1 void ACCB2 MyPluginCommand(void *clientData)
{
    PDDoc pddoc;
    AVDoc avDoc = AVAppGetActiveDoc();
    PDDoc pdDoc = AVDocGetPDDoc (avDoc);
    ASAtom cmdName;
    AVCommand cmd;
    cmdName = ASAtomFromString ("PaperCapture");
    cmd = AVCommandNew (cmdName);
   //SendKeys to set -> clearScan
    keybd_event(VK_TAB ,0x8f ,0 , 0);              //TAB
    keybd_event(VK_TAB ,0x8f , KEYEVENTF_KEYUP, 0);
    keybd_event(VK_DOWN , 0, 0, 0);              //Down
    keybd_event(VK_DOWN , 0, KEYEVENTF_KEYUP, 0);
    keybd_event(VK_DOWN , 0, 0, 0);              //Down -> clearScan
    keybd_event(VK_DOWN , 0, KEYEVENTF_KEYUP, 0);
    keybd_event(VK_TAB, 0x8f, 0 , 0);             //TAB
    keybd_event(VK_TAB ,0x8f , KEYEVENTF_KEYUP, 0);
    keybd_event(VK_TAB, 0x8f, 0 , 0);             //TAB
    keybd_event(VK_TAB ,0x8f , KEYEVENTF_KEYUP, 0);
    keybd_event(0x0D, 0, 0, 0);                       //ENTER
    AVCommandStatus status = AVCommandExecute (cmd);
    keybd_event(0x0D, 0, KEYEVENTF_KEYUP, 0);
    return;
}

But its not good coding, as I mentioned before. And in Adobe 9 and 10 you can see, that

there must be parameters that can be used ( see create pdf -> from scanner -> configure

settings ).

For me the OCR side is not so important, for I'm constructing a V-Scanner - its only for

testing, wheather the velocity of the OCR corresponds to the speed of the scanning process,

or not.The OCR can be done such as the final user likes and as he buys the software .

Best regards

Axel Arnold Bangert - Herzogenrath 2011

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 24, 2011 Jul 24, 2011

Copy link to clipboard

Copied

ok it's good

but to do Key_event On the Acrobat

it must be On screen (The Active window on The Windows )

and it's very silly with my application .

is ther any way to done it without be the on screen window ?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 24, 2011 Jul 24, 2011

Copy link to clipboard

Copied

Dear Mr. Ironside,

we have to know how to set the other parameters (dpi etc.)

You (Irosenth) repeated to say that this is documented in the SDK.

After this constant repetition, you changed your statement and

said, perhaps we could find it in the header files.

So now tell us, where 'PaperCapture'  is exactly (?link?)

documented in the SDK or in the header files?

If you don't want to inform us, we have to contact the CEO?

Best regards

Axel Arnold Bangert - Herzogenrath 2011

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jul 24, 2011 Jul 24, 2011

Copy link to clipboard

Copied

I am sure that if you contact our CEO, he will be happy to provide you

tech support...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 25, 2011 Jul 25, 2011

Copy link to clipboard

Copied

Dear Mr. Irosenth,

we shall see what the CEO will answer or not. What counts

is that you did not give a concrete answer.

CEO-Adobe-Fax.JPG

Besides the Acrobat 9.4.5 trial I just tried the new Acrobat X

pro trial too and searched this SDK too - the result is nothing.

We (Gimba NPO Consulting) work completely and continuously

charitable and absolutetly cost-free for NPO's since 1996. Our

organization is approved by the german 'Oberfinanzdirektion'

Rheinland as "altruistic organisation".

The customers want a fully automatable OCR. So i guess that

the potential customers for Acrobat will buy OmniPage or

Tsinghua TH-OCR or much better iText-Pdf in combination with

the Abbyy OCR SDK instead.

http://www.diybookscanner.org/forum/viewtopic.php?f=8&t=1095

I would regret that, for in my opinion Acrobat OCR is the

best choice - but without full OCR automation support

there is no chance for me to recommend Acrobat in this

respect.

Best regards

Axel Arnold Bangert - Herzogenrath 2011

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 27, 2011 Jul 27, 2011

Copy link to clipboard

Copied

MR.lrosenth all we want is just replay on our question

is there any way to set a parameter to the paperCapture to avoid the Dialog ??

Plz Help Us

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jul 27, 2011 Jul 27, 2011

Copy link to clipboard

Copied

If you don't want ot show the dialog, make sure to turn off the UI

(AVCommandSetUIPolicy, I believe).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 27, 2011 Jul 27, 2011

Copy link to clipboard

Copied

thaaaaanks lrosenth it's work with me

after this line of code

cmd=AVCommandNew(cmdName);

add this

ASCab config = ASCabNew();

ASCabPutInt (config, "UIPolicy", kAVCommandUISilent);

AVCommandSetConfig (cmd, config);

but i have problem when try to minimine the Acrobat i have this error

bad parameter

and stop the acrobat

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 28, 2011 Jul 28, 2011

Copy link to clipboard

Copied

i know my problem but i can fix it

the problem is when i execute Command  i get the active document

AVCommandStatus status =AVCommandExecute (cmd);


AVDoc avDoc = AVAppGetActiveDoc();

PDDoc pDDoc = AVDocGetPDDoc(avDoc);

when i minimize the acrobat

the AVAppGetActiveDoc();  --> return null

is there any way to get the returned Document from the command

or avoid this  error

thanks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jul 31, 2011 Jul 31, 2011

Copy link to clipboard

Copied

This is the ADOBE Acrobat SDK support forum.  As such, we ONLY discuss the use/implement/support of the ADOBE Acrobat SDK.   Discussions of 3rd party products take place elsewhere.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 31, 2011 Jul 31, 2011

Copy link to clipboard

Copied

Dear SDK,
all this "SendKey" and UIPolicy programming style is "quick and dirty", as I mentioned

before. It is absolutely logical, that a minimized window might never contain an active

document. That is the same in VS 2010 Office Tools programming.

You will and must always get an exeption on a minimized Window, which contains your

"inactive" document (see:  Eric Carter, Visual Studio Tools for Office 2007, Edison Wesley,

San Francisco, 2009, Page 17, Listing 1-7).

So the only thing that you can do is to set the Acrobat Window to (1,1). So you can

get all events and hold the active document while the user does not not see anything

- but - this is the ugliest coding of the world - and I never would do that - but if it helps:

[DllImport("user32.dll", SetLastError = true)]
static extern IntPtr FindWindow(string lpClassName, string lpWindowName);

[DllImport("user32.dll")]

static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X,

                                                 int Y, int cx, int cy, uint uFlags);

...
IntPtr hwd;
hwd = FindWindow(null,"Adobe Acrobat Pro Extended");
SetWindowPos(hwd, IntPtr.Zero, 0, 0, 1, 1, 0);

...

Your behaviour is just not cricket Mr. Irosenth. I am getting angry.

Best regards

Axel Arnold Bangert - Herzogenrath 2011

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 04, 2011 Aug 04, 2011

Copy link to clipboard

Copied

I too need to know how to set parameters for the PaperCapture command programmatically. I can't seem to find it in the documentation anywhere.

Our problem is we have about 75k pdf's to OCR. I know we can do this with batch processing via the GUI, but we would like to do this programmatically so we can see a log of errors if the process fails. Is there any reference for the PaperCapture command, so that we can specify our preferred settings before we execute the command?

Thanks.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Aug 04, 2011 Aug 04, 2011

Copy link to clipboard

Copied

Then you should really be looking at high volume solutions including our

own LiveCycle PDF Generator product.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 04, 2011 Aug 04, 2011

Copy link to clipboard

Copied

Thanks, I'll start looking in there and I'm sure I'll be back with questions.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 05, 2011 Aug 05, 2011

Copy link to clipboard

Copied

I downloaded the vmware appliance as linked to on this page:

http://www.adobe.com/devnet/livecycle/trial.html

Inside the virtual machine, I opened my browser and logged into to the administration console @ localhost:8080/adminui

and went to:

Services > Live Cycle PDF Generator ES2 > File Type Settings > New File Type Setting

Under image to pdf, there is no option to use OCR, as there are when the software is installed onto a windows machine. Per this thread, the OCR feature is not supported in Linux:

http://forums.adobe.com/thread/791202

This is a problem because the machine that would be running this is a linux box.

So I'm back to using the PaperCapture command. It appears no documentation on how to set parameters (to avoid the dialog asking for the OCR settings) is available. Is there any way to request this info? If there is documentation on this, can you direct me to it? I have done a lot of searching around but have come up with nothing.

Thanks.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 24, 2011 Aug 24, 2011

Copy link to clipboard

Copied

I have a couple of other questions. I am writing a C++ plugin to perform OCR on all pdf files in a directory.

1)
Currently I can run OCR/Paper Capture on all pdf files in a directory, and further, I can detect whether the document is already searchable to try to cut down on some processing and avoid the problems seen in question #2.

The problem is that although OCR has been run on one or more pages in a document, there are still occasionally pages in a document that have not been OCR'd. I know how to loop through each page and check if there are any words on the page, but I'm not sure I can run AVCommandExecute on an individual page instead of the whole document.

The documentation AVCommandExecute indicates that you can use AVCommandSetParams() to configure the command, and that this function allows you to select the pages to act on.


"AVCommandStatus AVCommandSetParams(AVCommand cmd, ASCab params)

Sets the parameters for the specified command. The parameters are  those pieces of information that can be controlled by the user, such as  the pages to act on. Use this method and AVCommandSetInputs() to set up  a command before calling AVCommandExecute() to execute it."

However, after doing some scouring of the API reference and googling, I'm not sure how to do this and was wondering if someone could push me in the right direction or give me a sample. What do you name the key, what type of value to put in, how does the command know what to do with it?

2)

On some, but not all, already searchable pdf's, If I try to OCR them an alert box will pop up saying there is already renderable text on the page and the plugin won't continue running until the alert box has been closed. I think this may be popping up when the document used clearscan. I have set the UIPolicy to silent already but it doesn't seem to affect that. Is it a matter of catching an exception or is there no way around this?

Here's how I have configured the command:

    ASCab config = ASCabNew();

    ASCabPutInt(config, "UIPolicy", kAVCommandUISilent);
    AVCommandSetConfig(cmd, config);

What's the solution?

Thanks.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Aug 25, 2011 Aug 25, 2011

Copy link to clipboard

Copied

I don't believe that we expose any methods for performing OCR on a single

page. You'd need to extract that page into a new document, perform OCR on

it, then do a ReplacePages() to put it back.

That error probably isn't respecting the UIPolicy - in which case, you'll

need to work around it (as you describe in #1)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 20, 2011 Sep 20, 2011

Copy link to clipboard

Copied

Can Any One Plz Tell Me How I can Test If The document Is Searchable (contains at least one char) or not ??

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 20, 2011 Sep 20, 2011

Copy link to clipboard

Copied

Create a PDWordFinder. For each page in the document, call PDWordFinderAcquireWordList. The last parameter in that function is the number of words in the page.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines