OCR Plugin - Languages: none installed  SOLVED

PDF-XChange Editor SDK for Developers

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

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
zarkogajic
User
Posts: 650
Joined: Thu Sep 05, 2019 12:35 pm

OCR Plugin - Languages: none installed

Post by zarkogajic » Mon Dec 02, 2019 2:01 pm

Hi support.

I'm loading the OCRPlugin, and the "OCR Pages(s)..." menu item appears under "Document".

However, the "Languages" box lists no languages and the "Add/Update Languages..." is disabled.

image.png

What needs to be done for some languages to appear there?

p.s.
I've browsed the forum and "PluginsData" and "OCRLanguages" folders are mentioned, but none exist with my EU Editor installation:

image.png





-žarko

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

Re: OCR Plugin - Languages: none installed

Post by Sasha - Tracker Dev Team » Mon Dec 02, 2019 2:54 pm

Hello žarko,

These should be added manually like the topic that you have found suggests.

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

zarkogajic
User
Posts: 650
Joined: Thu Sep 05, 2019 12:35 pm

Re: OCR Plugin - Languages: none installed

Post by zarkogajic » Mon Dec 02, 2019 3:07 pm

Hi Alex,

I've added "OCRLanguages" under added "PluginsData" (same level where my EXE and sdk's DLL is) and I have placed there "eng.lng" and "eng_pxvocr.dat" (found on the forum from 2017) - but the combo is still empty.


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

Re: OCR Plugin - Languages: none installed

Post by Sasha - Tracker Dev Team » Mon Dec 02, 2019 3:10 pm

Hello žarko,

Have you read all of the mentioned topic? From what I remember, the developer there had the same results as you described.

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

zarkogajic
User
Posts: 650
Joined: Thu Sep 05, 2019 12:35 pm

Re: OCR Plugin - Languages: none installed

Post by zarkogajic » Mon Dec 02, 2019 3:25 pm

Hi Alex,

Different topics mention different needed layout. Some mention "Languages" folder at the same level where "plugins" folder is. Some mention "OCRLanguages" folder (under PluginsData).

So am not sure what to follow :(

(and I think I've tried all combinations)


User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 1983
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: OCR Plugin - Languages: none installed

Post by Vasyl-Tracker Dev Team » Mon Dec 02, 2019 11:50 pm

Hi žarko.

You need to organize such files in the following order:

Code: Select all

<EditorSdkFolder>
     Common
         Languages // all UI-languages 
         Dictionaries // all Spellcheck-dictionaries
         Tesseract // all DefaultOCR languages
         ...
     ...
     PDFXEditCore.x86.dll
     PDFXEditCore.x64.dll
HTH.
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.

zarkogajic
User
Posts: 650
Joined: Thu Sep 05, 2019 12:35 pm

Re: OCR Plugin - Languages: none installed

Post by zarkogajic » Tue Dec 03, 2019 8:59 am

Hi Vasyl,

Thanks, unfortunately still nothing in the Languages combo, it is disabled and displays "None Installed", "Add/Update Languages" button is also disabled.

Here's how I have it:

image.png
image.png (13.8 KiB) Viewed 845 times

I have also tried without the manifest - that is via standard regsvr - same results.


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

Re: OCR Plugin - Languages: none installed

Post by Sasha - Tracker Dev Team » Tue Dec 03, 2019 10:21 am

Hello žarko,

Will forward this one to Vasyl for investigation.

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 1983
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: OCR Plugin - Languages: none installed

Post by Vasyl-Tracker Dev Team » Thu Dec 05, 2019 1:51 am

Hi žarko.

The "Add/Update Languages" button is disabled in SDK-mode because at the moment we don’t want to overuse the our site by not our customers (i.e. - by your own customers). Sorry.

According to your problem with OCR-Languages: from your screenshot I see that you using too old lang-files. Try to use latest from the:
https://www.tracker-software.com/pdf-xchange-ocr
- here are different installers that adding lang-files for the installed PDFXEditor (end-user app), to the folder:
c:\Program Files\Tracker Software\Common\Tesseract
so after installing packs you will be able to copy all necessary files to your own folder.

HTH.
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.

zarkogajic
User
Posts: 650
Joined: Thu Sep 05, 2019 12:35 pm

Re: OCR Plugin - Languages: none installed

Post by zarkogajic » Thu Dec 05, 2019 12:14 pm

Hi Vasyl,

Ok, that worked - after downloading and installing a few language packs a new "Common\Tesseract" folder was created under "Tracker Software" under "\Program Files".

The "Tesseract" folder has a bunch of ".lng" and ".dat" files. The .lng files are all 1 KB.

Please note that nothing has changed in the EU Editor!

I've then copied those files to my app's directory "\Common\Tesseract\*" - and the Languages combo got filled with languages... so that part is solved.

One question though: during the installation of the packs, additional files were also placed under "\Windows\System32\ocrdats" - those are a bunch of "name.lng" and "name_pxvocr.dat" files. It seems they are duplicates of those in Tesseract folder, having a different name, so that:

"\Program Files\Tracker Software\Comon\Tesseract\name.lng" == "\Windows\System32\ocrdats\name.lng"
"\Program Files\Tracker Software\Comon\Tesseract\name.dat" == "\Windows\System32\ocrdats\name_pxvocr.dat"


Q: For my application setup: should it also place files under "\Windows\System32\ocrdats\" - or are the files under "\Common\Tesseract" enough ?

-žarko

zarkogajic
User
Posts: 650
Joined: Thu Sep 05, 2019 12:35 pm

Re: OCR Plugin - Languages: none installed

Post by zarkogajic » Thu Dec 05, 2019 1:08 pm

Hi support,

Since "Add/Update Languages" is disabled in SDK by default, I'm trying to hide it from that dialog.

I've implemented IUIX_EventMonitor for "DlgOCRPages" but I cannot find (by try/fail) what event code to catch, as it seems it is not any of: "e.InitDialog", "e.Visible", "e.ShowModal".

What event to listen to ?

-žarko

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

Re: OCR Plugin - Languages: none installed

Post by Sasha - Tracker Dev Team » Thu Dec 05, 2019 1:11 pm

Hello žarko,

Forwarded your question about the language packs to Vasyl.
As for the dialog, can you make a screenshot of what you are trying to achieve?

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

zarkogajic
User
Posts: 650
Joined: Thu Sep 05, 2019 12:35 pm

Re: OCR Plugin - Languages: none installed

Post by zarkogajic » Thu Dec 05, 2019 2:00 pm

Hi Alex,

Hide this button:

image.png


User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 1983
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: OCR Plugin - Languages: none installed  SOLVED

Post by Vasyl-Tracker Dev Team » Thu Dec 05, 2019 7:52 pm

Please note that nothing has changed in the EU Editor!
Yes, yesterday, when I tried to reproduce your problem - also I noticed that that OCR-lang-installers add files into location that is obsolete for Editor and Tools applications. For the latest Editor/Tools the correct place should be:
c:\Program Files\Common Files\Tracker Software\Common\
but unfortunately we forget to update such installers according to the needs of latest Editor/Tools. We will fix it soon. I guess this problem was 'masked' by 'Add/Update Languages' feature that allow user to easily add new OCR-langs without using special installers. And I believe - most users prefer to use such simple feature.

during the installation of the packs, additional files were also placed under "\Windows\System32\ocrdats"
We reproduced it. It is issue definitely. Thanks for report. It also will be fixed soon. And for sure, it is enough to fill just your "\Common\Tesseract" folder.

Since "Add/Update Languages" is disabled in SDK by default, I'm trying to hide it from that dialog.
To hide this button you may use the following code:

Code: Select all

public void OnEventMonitor(PDFXEdit.IUIX_Obj pTarget, PDFXEdit.IUIX_Event pEvent)
{
	if (pEvent.Code == (int)PDFXEdit.UIX_EventCodes.e_InitDialog)
	{
		if (pTarget.ID == pTarget.ThreadCtx.Inst.Str2ID("DlgOCRPages2"))
		{
			PDFXEdit.IUIX_Obj btn = pTarget.FindChild(pTarget.ThreadCtx.Inst.Str2ID("btn.addUpdateLangs"), 2);
			if (btn != null)
			{
				btn.Show(0); // SW_HIDE==0
			}
		}
	}
}
HTH.
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.

zarkogajic
User
Posts: 650
Joined: Thu Sep 05, 2019 12:35 pm

Re: OCR Plugin - Languages: none installed

Post by zarkogajic » Fri Dec 06, 2019 8:51 am

Hi Vasyl,

That does it, thanks.

-žarko

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

Re: OCR Plugin - Languages: none installed

Post by Sasha - Tracker Dev Team » Fri Dec 06, 2019 9:46 am

:)
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

Post Reply