3 #include "config_auto.h"
17 const char* extension)
18 : file_extension_(extension),
19 title_(
""), imagenum_(-1),
23 if (strcmp(outputbase,
"-") && strcmp(outputbase,
"stdout")) {
25 fout_ = fopen(outfile.
string(),
"wb");
41 if (next ==
NULL)
return;
46 while (next->next_ !=
NULL) {
49 next->next_ = remainder;
54 if (!happy_)
return false;
65 if (!happy_)
return false;
75 if (!happy_)
return false;
88 int n = fwrite(s, 1, len, fout_);
89 if (n != len) happy_ =
false;
117 bool pageBreak =
false;
137 font_info_ = font_info;
142 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
143 "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n"
144 " \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n"
145 "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" "
146 "lang=\"en\">\n <head>\n <title>\n");
150 "<meta http-equiv=\"Content-Type\" content=\"text/html;"
151 "charset=utf-8\" />\n"
154 " <meta name='ocr-capabilities' content='ocr_page ocr_carea ocr_par"
155 " ocr_line ocrx_word");
158 " ocrp_lang ocrp_dir ocrp_font ocrp_fsize ocrp_wconf");
161 "</head>\n<body>\n");
174 if (hocr ==
NULL)
return false;
191 if (unlv ==
NULL)
return false;
208 if (text ==
NULL)
return false;
TessTextRenderer(const char *outputbase)
virtual bool AddImageHandler(TessBaseAPI *api)
TessResultRenderer(const char *outputbase, const char *extension)
bool AddImage(TessBaseAPI *api)
virtual bool EndDocumentHandler()
void insert(TessResultRenderer *next)
virtual bool AddImageHandler(TessBaseAPI *api)
virtual bool AddImageHandler(TessBaseAPI *api)
void AppendString(const char *s)
virtual ~TessResultRenderer()
const char * title() const
bool GetBoolVariable(const char *name, bool *value) const
virtual bool EndDocumentHandler()
virtual bool AddImageHandler(TessBaseAPI *api)=0
TessUnlvRenderer(const char *outputbase)
char * GetBoxText(int page_number)
TessResultRenderer * next()
virtual bool BeginDocumentHandler()
virtual bool AddImageHandler(TessBaseAPI *api)
const char * GetStringVariable(const char *name) const
TessBoxTextRenderer(const char *outputbase)
#define TESSERACT_VERSION_STR
TessHOcrRenderer(const char *outputbase, bool font_info)
char * GetHOCRText(int page_number)
virtual bool BeginDocumentHandler()
bool BeginDocument(const char *title)
const char * string() const
void AppendData(const char *s, int len)