cmd.document.OCRPages not launching anything

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
docu-track99
User
Posts: 518
Joined: Thu Dec 06, 2007 8:13 pm

cmd.document.OCRPages not launching anything

Post by docu-track99 »

Hello gents,

I'm trying to figure out how to access OCR pages within the Editor SDK. :roll: It doesn't seem to launch anything when I use the Execute button in the Command tab of your demo. Is there any reason for this? Is it currently implemented within the SDK :?:

Thanks,
Doc.It Development
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: cmd.document.OCRPages not launching anything

Post by Sasha - Tracker Dev Team »

Hello docu-track99,

The problem is that you did not include the OCR plugin in your code.
Here's the code that needs to be evaluated for the correct work of the OCR (also read the comments provided):

Code: Select all

					//Note that plugins must be loaded before the initialization of the control after you've initialized Instance
					Inst.StartLoadingPlugins();
					//Also, the project should contain the PluginsData folder and within it there should be the OCRLanguages folder with dictionaries for the correct command work
					Inst.AddPluginFromFile("..\\Plugins\\OCRPlugin.pvp");
					Inst.FinishLoadingPlugins();
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
docu-track99
User
Posts: 518
Joined: Thu Dec 06, 2007 8:13 pm

Re: cmd.document.OCRPages not launching anything

Post by docu-track99 »

Great, thanks for the help.

So I've got the OCR plugin loading correctly now, however I don't have the languages installed. I'm unclear on where the PluginsData folder should go. I've tried including it in several ways but I still get "Languages: No any installed" in the OCR dialog.

Thanks!
User avatar
Will - Tracker Supp
Site Admin
Posts: 6815
Joined: Mon Oct 15, 2012 9:21 pm
Location: London, UK
Contact:

Re: cmd.document.OCRPages not launching anything

Post by Will - Tracker Supp »

Hi docu-track99,

I'm not a developer, so I'll leave that particular question for Sasha, or another of the Dev. Team.

I'm posting because I'm interested in the dialogue that says "Languages: No any installed" - can you please upload a screen-shot so that I can have the Dev. Team fix the grammar?

Thanks,
If posting files to this forum, you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded.
Thank you.

Best regards

Will Travaglini
Tracker Support (Europe)
Tracker Software Products Ltd.
http://www.tracker-software.com
docu-track99
User
Posts: 518
Joined: Thu Dec 06, 2007 8:13 pm

Re: cmd.document.OCRPages not launching anything

Post by docu-track99 »

Sure thing! What's your preferred method for uploading screenshots? It seems that uploading attachments refuses .png, .bmp, .jpeg and .tif.
User avatar
Will - Tracker Supp
Site Admin
Posts: 6815
Joined: Mon Oct 15, 2012 9:21 pm
Location: London, UK
Contact:

Re: cmd.document.OCRPages not launching anything

Post by Will - Tracker Supp »

Hi docu-track99,

Any is fine, but it will need to be uploaded in a .zip folder or RAR/7Zip archive, otherwise the forums will reject the upload.

Cheers,
If posting files to this forum, you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded.
Thank you.

Best regards

Will Travaglini
Tracker Support (Europe)
Tracker Software Products Ltd.
http://www.tracker-software.com
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: cmd.document.OCRPages not launching anything

Post by Sasha - Tracker Dev Team »

Hi docu-track99,

The plugins data folder should go in the same folder where the PDFXEditCore.dll lies.
It's the same PluginsData folder that is included when the Editor is installed.
Image

HTH
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
docu-track99
User
Posts: 518
Joined: Thu Dec 06, 2007 8:13 pm

Re: cmd.document.OCRPages not launching anything

Post by docu-track99 »

Here you go!
Attachments
for_tracker.zip
(32.78 KiB) Downloaded 178 times
docu-track99
User
Posts: 518
Joined: Thu Dec 06, 2007 8:13 pm

Re: cmd.document.OCRPages not launching anything

Post by docu-track99 »

I can see have the PluginsData folder in the correct location in the PDF Editor. I'm also able to load the OCR form thanks to the code from above. But it still won't load any languages when I load the OCR form from the demo solution.

I'm attaching the original Tracker v5 Demo solution, but I have a modified version of it which enables OCR. How can I get the languages to load in this demo solution?

Is there any other code I need to run to set the languages? If I want access to the languages in the Tracker v5 Demo solution, should it be sufficient to simply have the PluginsData folder present in C:\Program Files\Tracker Software\PDF Editor ?

Not sure what else I can try to get the languages to show up.

Thanks,
Doc.It Development
Attachments
Tracker Sample.zip
(1.34 MiB) Downloaded 182 times
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: cmd.document.OCRPages not launching anything

Post by Sasha - Tracker Dev Team »

Hello docu-track99,

As I said before - the PluginsData folder must be where the registered PDFXEditCore.dll lies. Then it will work.
If it's the dll from the C:\Program Files\Tracker Software\PDF Editor then yes - the PluginsData will be read there.
If you used regsvr32 to register the PDFXEditCore.dll from custom folder (for example inside your project) then the PluginsData folder must be near it.
Don't forget that the PluginsData folder must contain the OCRLanguages folder with at least one valid language file.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
docu-track99
User
Posts: 518
Joined: Thu Dec 06, 2007 8:13 pm

Re: cmd.document.OCRPages not launching anything

Post by docu-track99 »

Thanks Alex,

What I wasn't doing properly was I didn't register the .dll. I had to register it with regsvr32 using the command prompt as admin. I believe I also added the reference to the .dll in my project, but for some reason I can't see the reference in my project, so I'm not sure if this was necessary or not. In any case, it's working now.

Thanks for all your help.

Regards,
Doc.It Development
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: cmd.document.OCRPages not launching anything

Post by Sasha - Tracker Dev Team »

Glad that worked for you :wink:
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
docu-track99
User
Posts: 518
Joined: Thu Dec 06, 2007 8:13 pm

Re: cmd.document.OCRPages not launching anything

Post by docu-track99 »

Hello folks,

I just noticed that if you cancel an OCR operation it appears to crash the control (cancel while it is OCRing pages).

Regards,
Doc.It Development
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: cmd.document.OCRPages not launching anything

Post by Sasha - Tracker Dev Team »

Hello docu-track99,

Please confirm on what are you using - the OCR command or the OCR operation. Also, please paste a code sample with the problem so we can test on our side.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
docu-track99
User
Posts: 518
Joined: Thu Dec 06, 2007 8:13 pm

Re: cmd.document.OCRPages not launching anything

Post by docu-track99 »

Hi Alex,

Probably you can reproduce it on your side without a code sample. I'm just using your OCR Pages menu option. While the document is being OCR'ed (when the progress bar is shown), simply click cancel during the operation.

Regards,
Doc.It Development
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: cmd.document.OCRPages not launching anything

Post by Sasha - Tracker Dev Team »

Hello docu-track99,

This is a bug and it will be fixed in one of the future releases.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
claude vidal
User
Posts: 138
Joined: Wed Mar 09, 2016 12:47 am

Re: cmd.document.OCRPages not launching anything

Post by claude vidal »

This issue has a strange behavior for me. Cancelling an OCR command will not always crash the Editor.

When it does, it does so after a certain delay (~ 5 secs?). After cancelling the OCR, I'm able to perform other commands on the same document then, all of a sudden, the Editor's process gets killed.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: cmd.document.OCRPages not launching anything

Post by Sasha - Tracker Dev Team »

Hello claude vidal,

The thing is that the Cancel is not yet being implemented inside the operation itself thus the results are not valid and these problems occur. We know about this and will try to fix this in the nearest future.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
docu-track99
User
Posts: 518
Joined: Thu Dec 06, 2007 8:13 pm

Re: cmd.document.OCRPages not launching anything

Post by docu-track99 »

Hi folks,

When I launch the OCR Pages command the control is crashing. I believe that perhaps since I updated to build 317 this broke the OCR. The OCR plugin I'm using is still from 316. Has this been updated? Where can I download the OCR plugin if there is a new version?

Thanks,
Doc.It Development
docu-track99
User
Posts: 518
Joined: Thu Dec 06, 2007 8:13 pm

Re: cmd.document.OCRPages not launching anything

Post by docu-track99 »

Please disregard, I had to download the standard free version of the PDF X Editor to get my hands on the new plugins as they don't come packaged with the SDK (as I hoped they would).

Thanks,
Doc.It Development
User avatar
Will - Tracker Supp
Site Admin
Posts: 6815
Joined: Mon Oct 15, 2012 9:21 pm
Location: London, UK
Contact:

Re: cmd.document.OCRPages not launching anything

Post by Will - Tracker Supp »

:)
If posting files to this forum, you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded.
Thank you.

Best regards

Will Travaglini
Tracker Support (Europe)
Tracker Software Products Ltd.
http://www.tracker-software.com
jeffp
User
Posts: 914
Joined: Wed Sep 30, 2009 6:53 pm

Re: cmd.document.OCRPages not launching anything

Post by jeffp »

--
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: cmd.document.OCRPages not launching anything

Post by Sasha - Tracker Dev Team »

:?:
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply