Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- BITMAPHANDLE bitmap = { 0 };
- L_OcrEngine ocrEngine = NULL;
- L_OcrPage ocrPage = NULL;
- L_OcrDocumentManager ocrDocumentManager = NULL;
- L_OcrDocument ocrDocument = NULL;
- L_OcrEngineManager_CreateEngine(L_OcrEngineType_Advantage, &ocrEngine);
- L_OcrEngine_Startup(ocrEngine, NULL, OCR_ADVANTAGE_RUNTIME_DIR);
- L_LoadBitmap("Path to Bitmap", &bitmap, sizeof(BITMAPHANDLE), 0, ORDER_RGB, NULL, NULL);
- L_OcrPage_FromBitmap(ocrEngine, &ocrPage, &bitmap, L_OcrBitmapSharingMode_AutoFree, NULL, NULL);
- L_OcrPage_AutoZone(ocrPage, NULL, NULL);
- retCode = L_OcrPage_Recognize(ocrPage, NULL, NULL);
- L_WCHAR* text = NULL;
- L_UINT textLength = 0;
- L_OcrPage_GetText(ocrPage, -1, &text, &textLength);
- printf("%ls", text);
- L_OcrDocument ocrDocument = NULL;
- L_OcrDocument_Save(ocrDocument, outputPath, DOCUMENTFORMAT_PDF, NULL, NULL);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement