Hi, I have a code to perform a PDF to RTF conversion.
This is a simple snippet of what I do in order to change the idiom
LoadFREngine();
CSafePtr<IDocumentProcessingParams> documentProcessingParams;
CheckResult( FREngine->CreateDocumentProcessingParams( &documentProcessingParams ) );
CSafePtr<IPageProcessingParams> pageProcessingParams;
CheckResult( documentProcessingParams->get_PageProcessingParams( &pageProcessingParams ) );
CSafePtr<IRecognizerParams> recognizerParams;
CheckResult( pageProcessingParams->get_RecognizerParams( &recognizerParams ) );
CheckResult( recognizerParams->SetPredefinedTextLanguage( L"Spanish" ) );
but when I run the makefile, I get the following warning
PDF.cpp:36:74: warning: ISO C++ forbids converting a string constant to ‘BSTR {aka wchar_t*}’ [-Wwrite-strings]
CheckResult( recognizerParams->SetPredefinedTextLanguage( L"Spanish" ) );
Is this a normal behaviour? It doesn't seem to work, because it didn't recognize the accent marks.
Also, some of the documents are not completely OCR'ed. Some of them are only converted to one paragraph, because it detects some text as an image. Is there any way to solve this?
Thanks.
Comments
3 comments
Hi! Your code looks correct. After you’ve set the language, you should pass the documentProcessingParams to the method Process: CheckResult( frDocument->Process( documentProcessingParams ) ); Could you please check whether documentProcessingParams object was passed to the Process method?
As for the second question could you please provide us with the following additional information:
I was passing the wrong parameter to Process! You are absolutely right! Thank!
1. build 11.1.14.686141
2. Im using the following code
I'm using legal documents as input, with logos, stamps and noise. I can't upload any of them because they're confidential.
You can send this information to SDK_Support@abbyy.com. In addition, the following articles may help to improve the quality of recognition:
Please sign in to leave a comment.