OCR-Plugin brings up unknown error

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
MaSeife
User
Posts: 16
Joined: Thu Jun 27, 2019 11:21 am

OCR-Plugin brings up unknown error

Post by MaSeife »

The OCR plugin doesn't work as expected. A document is loaded in PdfXChange and the plugin is initialized. When opening the preferences-page you can see the OCR-Plugin as an activated entry. In the filesystem a folder PluginsData with subfolder OCRLanguages exists and contains files deu.lng and eng.lng. So the setup in general seems to be ok.

The example code looks like this:

Code: Select all

int nID = getInst().Str2ID("op.document.OCRPages", false);
operation = getInst().CreateOp(nID);
operation.Params().Root().SetUnknown("Input", getActiveDocument());
options = operation.Params().Root().Item(new VARIANT("Options"));
options.SetString("PagesRange.Type", "All");
options.SetInt("OutputType", 0);
options.SetInt("OutputDPI", 300);
options.SetString("ExtParams.Language", "deu");
operation.Do(0);
The call of the last line leads to an exception: com.sun.jna.platform.win32.COM.COMException: Unbekannter Fehler(HRESULT: 80004005) (puArgErr=).

Do you by chance have any idea what might cause the error or what we're doing wrong? Or is the operation called differently now?
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17820
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: OCR-Plugin brings up unknown error

Post by Tracker Supp-Stefan »

Hello MaSeife,

Can you please check (through the Editor UI) which of the OCR engines is active. (Preferences -> OCR )
If it is the Enhanced OCR engine - I believe this one is not included for use through the SDK.

Kind regards,
Stefan
MaSeife
User
Posts: 16
Joined: Thu Jun 27, 2019 11:21 am

Re: OCR-Plugin brings up unknown error

Post by MaSeife »

Hi Stefan,

the Plugin is initialized like this (with no Exception during the call):

Code: Select all

getInst().StartLoadingPlugins();
getInst().AddPluginFromFile("C:/Program Files/Tracker Software/PDF Editor/Plugins.x64/OCRPlugin.pvp");
getInst().FinishLoadingPlugins();
In the Preferences I could only find this:
OCRPlugin.jpg
After selecting the OCR Plug-In entry in the table, the Setup...-Button stays inactive. There is also no 'Preferences -> OCR' :-(

Regards,
Markus
MaSeife
User
Posts: 16
Joined: Thu Jun 27, 2019 11:21 am

Re: OCR-Plugin brings up unknown error

Post by MaSeife »

Hi Stefan,

I think we found out what the problem is/was: version incompatibilities (V7 SDK and OCR-Plugin from V9-PDF-XChange-folder) :-)

So as in many cases the problem was sitting in front of the computer ...

Regards,
Markus
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17820
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: OCR-Plugin brings up unknown error

Post by Tracker Supp-Stefan »

Hello Markus,

Glad that it is sorted now!

Kind regards,
Stefan
Post Reply