Skip to content

Commit

Permalink
fix issue 1417
Browse files Browse the repository at this point in the history
  • Loading branch information
zdenop committed Feb 7, 2015
1 parent 09b0c91 commit 4c7c960
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
7 changes: 7 additions & 0 deletions api/renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@ bool TessTextRenderer::AddImageHandler(TessBaseAPI* api) {
AppendString(utf8);
delete[] utf8;

bool pageBreak = false;
api->GetBoolVariable("include_page_breaks", &pageBreak);
const char* pageSeparator = api->GetStringVariable("page_separator");
if(pageBreak) {
AppendString(pageSeparator);
}

return true;
}

Expand Down
6 changes: 6 additions & 0 deletions ccmain/tesseractclass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,12 @@ Tesseract::Tesseract()
this->params()),
BOOL_MEMBER(preserve_interword_spaces, false,
"Preserve multiple interword spaces", this->params()),
BOOL_MEMBER(include_page_breaks, FALSE,
"Include page separator string in output text after each "
"image/page.", this->params()),
STRING_MEMBER(page_separator, "\f",
"Page separator (default is form feed control character)",
this->params()),

// The following parameters were deprecated and removed from their original
// locations. The parameters are temporarily kept here to give Tesseract
Expand Down
8 changes: 7 additions & 1 deletion ccmain/tesseractclass.h
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,13 @@ class Tesseract : public Wordrec {
double_VAR_H(textord_tabfind_aligned_gap_fraction, 0.75,
"Fraction of height used as a minimum gap for aligned blobs.");
INT_VAR_H(tessedit_parallelize, 0, "Run in parallel where possible");
BOOL_VAR_H(preserve_interword_spaces, false, "Preserve multiple interword spaces");
BOOL_VAR_H(preserve_interword_spaces, false,
"Preserve multiple interword spaces");
BOOL_VAR_H(include_page_breaks, false,
"Include page separator string in output text after each "
"image/page.");
STRING_VAR_H(page_separator, "\f",
"Page separator (default is form feed control character)");

// The following parameters were deprecated and removed from their original
// locations. The parameters are temporarily kept here to give Tesseract
Expand Down

0 comments on commit 4c7c960

Please sign in to comment.