mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-12-01 07:59:05 +08:00
enable pdfrender with NO_CUBE_BUILD
This commit is contained in:
parent
300b5246f3
commit
ff6c088084
@ -42,7 +42,7 @@ libtesseract_api_la_CPPFLAGS = $(AM_CPPFLAGS)
|
|||||||
if VISIBILITY
|
if VISIBILITY
|
||||||
libtesseract_api_la_CPPFLAGS += -DTESS_EXPORTS
|
libtesseract_api_la_CPPFLAGS += -DTESS_EXPORTS
|
||||||
endif
|
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
|
lib_LTLIBRARIES += libtesseract.la
|
||||||
libtesseract_la_LDFLAGS =
|
libtesseract_la_LDFLAGS =
|
||||||
@ -63,7 +63,6 @@ libtesseract_la_LIBADD = \
|
|||||||
../ccutil/libtesseract_ccutil.la \
|
../ccutil/libtesseract_ccutil.la \
|
||||||
../opencl/libtesseract_opencl.la
|
../opencl/libtesseract_opencl.la
|
||||||
if !NO_CUBE_BUILD
|
if !NO_CUBE_BUILD
|
||||||
libtesseract_api_la_SOURCES += pdfrenderer.cpp
|
|
||||||
libtesseract_la_LIBADD += ../cube/libtesseract_cube.la \
|
libtesseract_la_LIBADD += ../cube/libtesseract_cube.la \
|
||||||
../neural_networks/runtime/libtesseract_neural.la
|
../neural_networks/runtime/libtesseract_neural.la
|
||||||
endif
|
endif
|
||||||
|
@ -47,12 +47,10 @@ TESS_API TessResultRenderer* TESS_CALL TessHOcrRendererCreate2(const char* outpu
|
|||||||
return new TessHOcrRenderer(outputbase, font_info);
|
return new TessHOcrRenderer(outputbase, font_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NO_CUBE_BUILD
|
|
||||||
TESS_API TessResultRenderer* TESS_CALL TessPDFRendererCreate(const char* outputbase, const char* datadir)
|
TESS_API TessResultRenderer* TESS_CALL TessPDFRendererCreate(const char* outputbase, const char* datadir)
|
||||||
{
|
{
|
||||||
return new TessPDFRenderer(outputbase, datadir);
|
return new TessPDFRenderer(outputbase, datadir);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
TESS_API TessResultRenderer* TESS_CALL TessUnlvRendererCreate(const char* outputbase)
|
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,
|
TESS_API BOOL TESS_CALL TessBaseAPIProcessPages(TessBaseAPI* handle, const char* filename, const char* retry_config,
|
||||||
int timeout_millisec, TessResultRenderer* renderer)
|
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;
|
return TRUE;
|
||||||
else
|
else
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -33,9 +33,7 @@ extern "C" {
|
|||||||
typedef tesseract::TessResultRenderer TessResultRenderer;
|
typedef tesseract::TessResultRenderer TessResultRenderer;
|
||||||
typedef tesseract::TessTextRenderer TessTextRenderer;
|
typedef tesseract::TessTextRenderer TessTextRenderer;
|
||||||
typedef tesseract::TessHOcrRenderer TessHOcrRenderer;
|
typedef tesseract::TessHOcrRenderer TessHOcrRenderer;
|
||||||
#ifndef NO_CUBE_BUILD
|
|
||||||
typedef tesseract::TessPDFRenderer TessPDFRenderer;
|
typedef tesseract::TessPDFRenderer TessPDFRenderer;
|
||||||
#endif // NO_CUBE_BUILD
|
|
||||||
typedef tesseract::TessUnlvRenderer TessUnlvRenderer;
|
typedef tesseract::TessUnlvRenderer TessUnlvRenderer;
|
||||||
typedef tesseract::TessBoxTextRenderer TessBoxTextRenderer;
|
typedef tesseract::TessBoxTextRenderer TessBoxTextRenderer;
|
||||||
typedef tesseract::TessBaseAPI TessBaseAPI;
|
typedef tesseract::TessBaseAPI TessBaseAPI;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#include "renderer.h"
|
#include "renderer.h"
|
||||||
#include "math.h"
|
#include "math.h"
|
||||||
#include "strngs.h"
|
#include "strngs.h"
|
||||||
#include "cube_utils.h"
|
#include "tprintf.h"
|
||||||
#include "allheaders.h"
|
#include "allheaders.h"
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
|
@ -162,7 +162,6 @@ private:
|
|||||||
bool font_info_; // whether to print font information
|
bool font_info_; // whether to print font information
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef NO_CUBE_BUILD
|
|
||||||
/**
|
/**
|
||||||
* Renders tesseract output into searchable PDF
|
* Renders tesseract output into searchable PDF
|
||||||
*/
|
*/
|
||||||
@ -198,7 +197,6 @@ private:
|
|||||||
static bool imageToPDFObj(Pix *pix, char *filename, long int objnum,
|
static bool imageToPDFObj(Pix *pix, char *filename, long int objnum,
|
||||||
char **pdf_object, long int *pdf_object_size);
|
char **pdf_object, long int *pdf_object_size);
|
||||||
};
|
};
|
||||||
#endif // NO_CUBE_BUILD
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -295,13 +295,11 @@ int main(int argc, char **argv) {
|
|||||||
api.GetBoolVariable("hocr_font_info", &font_info);
|
api.GetBoolVariable("hocr_font_info", &font_info);
|
||||||
renderers.push_back(new tesseract::TessHOcrRenderer(outputbase, font_info));
|
renderers.push_back(new tesseract::TessHOcrRenderer(outputbase, font_info));
|
||||||
}
|
}
|
||||||
#ifndef NO_CUBE_BUILD
|
|
||||||
api.GetBoolVariable("tessedit_create_pdf", &b);
|
api.GetBoolVariable("tessedit_create_pdf", &b);
|
||||||
if (b) {
|
if (b) {
|
||||||
renderers.push_back(new tesseract::TessPDFRenderer(outputbase,
|
renderers.push_back(new tesseract::TessPDFRenderer(outputbase,
|
||||||
api.GetDatapath()));
|
api.GetDatapath()));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
api.GetBoolVariable("tessedit_write_unlv", &b);
|
api.GetBoolVariable("tessedit_write_unlv", &b);
|
||||||
if (b) renderers.push_back(new tesseract::TessUnlvRenderer(outputbase));
|
if (b) renderers.push_back(new tesseract::TessUnlvRenderer(outputbase));
|
||||||
api.GetBoolVariable("tessedit_create_boxfile", &b);
|
api.GetBoolVariable("tessedit_create_boxfile", &b);
|
||||||
|
Loading…
Reference in New Issue
Block a user