enable pdfrender with NO_CUBE_BUILD

This commit is contained in:
Zdenko Podobný 2015-08-07 23:20:22 +02:00
parent 300b5246f3
commit ff6c088084
6 changed files with 3 additions and 12 deletions

View File

@ -42,7 +42,7 @@ libtesseract_api_la_CPPFLAGS = $(AM_CPPFLAGS)
if VISIBILITY
libtesseract_api_la_CPPFLAGS += -DTESS_EXPORTS
endif
libtesseract_api_la_SOURCES = baseapi.cpp capi.cpp renderer.cpp
libtesseract_api_la_SOURCES = baseapi.cpp capi.cpp renderer.cpp pdfrenderer.cpp
lib_LTLIBRARIES += libtesseract.la
libtesseract_la_LDFLAGS =
@ -63,7 +63,6 @@ libtesseract_la_LIBADD = \
../ccutil/libtesseract_ccutil.la \
../opencl/libtesseract_opencl.la
if !NO_CUBE_BUILD
libtesseract_api_la_SOURCES += pdfrenderer.cpp
libtesseract_la_LIBADD += ../cube/libtesseract_cube.la \
../neural_networks/runtime/libtesseract_neural.la
endif

View File

@ -47,12 +47,10 @@ TESS_API TessResultRenderer* TESS_CALL TessHOcrRendererCreate2(const char* outpu
return new TessHOcrRenderer(outputbase, font_info);
}
#ifndef NO_CUBE_BUILD
TESS_API TessResultRenderer* TESS_CALL TessPDFRendererCreate(const char* outputbase, const char* datadir)
{
return new TessPDFRenderer(outputbase, datadir);
}
#endif
TESS_API TessResultRenderer* TESS_CALL TessUnlvRendererCreate(const char* outputbase)
{
@ -426,7 +424,7 @@ TESS_API int TESS_CALL TessBaseAPIRecognizeForChopTest(TessBaseAPI* handle, ETEX
TESS_API BOOL TESS_CALL TessBaseAPIProcessPages(TessBaseAPI* handle, const char* filename, const char* retry_config,
int timeout_millisec, TessResultRenderer* renderer)
{
if (handle->ProcessPages(filename, retry_config, timeout_millisec, renderer))
if (handle->ProcessPages(filename, retry_config, timeout_millisec, renderer))
return TRUE;
else
return FALSE;

View File

@ -33,9 +33,7 @@ extern "C" {
typedef tesseract::TessResultRenderer TessResultRenderer;
typedef tesseract::TessTextRenderer TessTextRenderer;
typedef tesseract::TessHOcrRenderer TessHOcrRenderer;
#ifndef NO_CUBE_BUILD
typedef tesseract::TessPDFRenderer TessPDFRenderer;
#endif // NO_CUBE_BUILD
typedef tesseract::TessUnlvRenderer TessUnlvRenderer;
typedef tesseract::TessBoxTextRenderer TessBoxTextRenderer;
typedef tesseract::TessBaseAPI TessBaseAPI;

View File

@ -7,7 +7,7 @@
#include "renderer.h"
#include "math.h"
#include "strngs.h"
#include "cube_utils.h"
#include "tprintf.h"
#include "allheaders.h"
#ifdef _MSC_VER

View File

@ -162,7 +162,6 @@ private:
bool font_info_; // whether to print font information
};
#ifndef NO_CUBE_BUILD
/**
* Renders tesseract output into searchable PDF
*/
@ -198,7 +197,6 @@ private:
static bool imageToPDFObj(Pix *pix, char *filename, long int objnum,
char **pdf_object, long int *pdf_object_size);
};
#endif // NO_CUBE_BUILD
/**

View File

@ -295,13 +295,11 @@ int main(int argc, char **argv) {
api.GetBoolVariable("hocr_font_info", &font_info);
renderers.push_back(new tesseract::TessHOcrRenderer(outputbase, font_info));
}
#ifndef NO_CUBE_BUILD
api.GetBoolVariable("tessedit_create_pdf", &b);
if (b) {
renderers.push_back(new tesseract::TessPDFRenderer(outputbase,
api.GetDatapath()));
}
#endif
api.GetBoolVariable("tessedit_write_unlv", &b);
if (b) renderers.push_back(new tesseract::TessUnlvRenderer(outputbase));
api.GetBoolVariable("tessedit_create_boxfile", &b);