Please make sure the TESSDATA_PREFIX environment variable is set to the parent directory of your "tessdata" directory.
Failed loading language 'deu'
I searched for it in forum, there should exist folder PluginsData in the folder with language files (du.dat).
I have created it but it still does not work.
Code:
Code: Select all
int nID = Inst.Str2ID("op.openDoc", false);
PDFXEdit.IOperation Op = Inst.CreateOp(nID);
PDFXEdit.IAFS_Inst fsInst = (PDFXEdit.IAFS_Inst)Inst.GetExtension("AFS");
PDFXEdit.IAFS_Name name = fsInst.DefaultFileSys.StringToName(testfile);
var input = Op.Params.Root["Input"];
input.v = name;
PDFXEdit.ICabNode options = Op.Params.Root["Options"];
options["NativeOnly"].v = true;
Op.Do();
var doc2 = (IPXC_Document)Op.Params.Root["Output"].v;
nID = Inst.Str2ID("op.document.OCRPages", false);
Op = Inst.CreateOp(nID);
PDFXEdit.ICabNode input2 = Op.Params.Root["Input"];
input2.v = doc2;
PDFXEdit.ICabNode options2 = Op.Params.Root["Options"];
options2["PagesRange.Type"].v = "All"; //OCR all pages
options2["OutputType"].v = 0;
options2["OutputDPI"].v = 300;
options2["ExtParams.Language"].v = "deu+eng";
Inst.AsyncDoAndWaitForFinish(Op);
doc2.WriteToFile(testfile_ocr);
Ernest Baumunk