I am getting below error when I tried to use page splitting parameters and indices in my program. Why i am getting this error? How can use both parameters.?
line--page numbers list[]
line--page numberscom.abbyy.FREngine.IIntsCollection@d059f0f4
line--This operation cannot be performed in parallel: pages splitting. Set ABBYY FineReader Engine for recognition in one process.
line--Deinitializing Engine...
コメント
5件のコメント
Hi Rama
Can you please post the original PDF and the part(s) of your Java-code with which you are trying to perfom the splitting?
Best regards
Koen de Leijer
private void processImage() {
// String imagePath = SamplesConfig.GetSamplesFolder() + "//home//DCXMprod//ABBYY//Samples//images//Charlotta_1.jpg";
String imagePath = SamplesConfig.GetSamplesFolder() + "images/DL/images.jpg";
try {
// Don't recognize PDF file with a textual content, just copy it
if( engine.IsPdfWithTextualContent( imagePath, null ) ) {
displayMessage( "Copy results..." );
// String resultPath = SamplesConfig.GetSamplesFolder() + "/home/DCXMprod/ABBYY/Samples/images/Charlotta_1.txt";
String resultPath = SamplesConfig.GetSamplesFolder() + "images/DL/images.pdf";
Files.copy( Paths.get( imagePath ), Paths.get( resultPath ), StandardCopyOption.REPLACE_EXISTING );
return;
}
// Create document
//engine.LoadPredefinedProfile("DocumentConversion_Accuracy");
//engine.CreateRecognizerParams().SetPredefinedTextLanguage("German");
//IEngine engine=null;
//engine=Engine.GetEngineObject(SamplesConfig.GetDllFolder(),SamplesConfig.GetDeveloperSN());
//String profile=SamplesConfig.GetSamplesFolder() + "images/dff.ini";
//engine.LoadProfile(profile);
IFRDocument document = engine.CreateFRDocument();
try {
// Add image file to document
displayMessage( "Loading image..." );
ISynthesisParamsForPage sysparams=engine.CreateSynthesisParamsForPage();
sysparams.setSynthesizeBusinessCards(true);
IPrepareImageMode imageparam=engine.CreatePrepareImageMode();
imageparam.setEnhanceLocalContrast(true);
imageparam.setOverwriteResolution(true);
//imageparam.setPhotoProcessingMode(PhotoProcessingModeEnum.PPM_TreatAsPhoto);
IImageModification image_modif=engine.CreateImageModification();
image_modif.ClearPaintRegions();
image_modif.ClearRemoveGarbageRegions();
IRecognizerParams recparams=engine.CreateRecognizerParams();
recparams.setLowResolutionMode(true);
IPagePreprocessingParams pageproparams=engine.CreatePagePreprocessingParams();
pageproparams.setCorrectOrientation(true);
IPageSplittingParams pagesplitparams=engine.CreatePageSplittingParams();
pagesplitparams.setSplitType(PageSplitTypeEnum.PST_BusinessCardSplit);
document.AddImageFile( imagePath, imageparam, null );
//pages=document.getPages();
IDocumentProcessingParams docProcessingParams =engine.CreateDocumentProcessingParams();
IPageAnalysisParams tabParams=docProcessingParams.getPageProcessingParams().getPageAnalysisParams();
IObjectsExtractionParams objparams=engine.CreateObjectsExtractionParams();
tabParams.setDetectText(true);
tabParams.setAggressiveTableDetection(true);
objparams.setDetectTextOnPictures(true);
//tabParams.DetectTables=true;
//IRTFExportParams rtfparam=engine.CreateRTFExportParams();
//rtfparam.setKeepLines(true);
//rtfparam.setPageSynthesisMode("PSM_RTFEditableCopy");
//IXLExportParams xlparam=engine.CreateXLExportParams();
//xlparam.setLayoutRetentionMode(XLSXLayoutRetentionModeEnum.XLLRM_ExactLines);
//xlparam.setTablesOnly(true);
//IIntsCollection indices=engine.CreateIntsCollection();
//for (int i=0;i<pages_cnt;i++){
//indices.Add(pages_cnt-1);
//System.out.println(indices);
//}
//IDocumentProcessingParams docProcessingParams =engine.CreateDocumentProcessingParams();
//IRecognizerParams recognizerParams=docProcessingParams.getPageProcessingParams().getRecognizerParams();
//ITextLanguage textLanguage ="ChinesePRC";
//recognizerParams.SetPredefinedTextLanguage("English,ChinesePRC");
//document.ProcessPages(indices,null);
//document.Synthesize(Synchronizer.ProcessingParams.SynthesisParamsForDocument);
//document.Synthesize(null);
// Save results
//IPageAnalysisParams ipage=engine.PageProcessingParams();
//ipage.DetectText=false;
//ipage.DetectTables=true;
document.Preprocess(pageproparams,objparams,recparams,pagesplitparams);
document.Recognize(sysparams,objparams);
document.Process(docProcessingParams);
displayMessage( "Saving results..." );
// Save results to rtf with default parameters
String pdfExportPath = SamplesConfig.GetSamplesFolder() + "images/DL/images2.txt";
//document.Export( pdfExportPath, FileExportFormatEnum.FEF_PDF, pdfParams );
document.Export( pdfExportPath, FileExportFormatEnum.FEF_TextUnicodeDefaults, null);
} finally {
// Close document
document.Close();
}
} catch( Exception ex ) {
displayMessage( ex.getMessage() );
}
}
above is my input and java code If i need to pass indices how can I do?
Hi Rama
I don't understand, the image is a single image and is not multipage,
why would you need indices for "multi page" ?
Best regards
Koen de Leijer
Hi Koen,
If we have multiple cards in multiple pages how can we deal with them? And all the properties which i used in the code are required and what all properties can be helpful to me to extract all text from that business card?
サインインしてコメントを残してください。