Skip to content

Commit

Permalink
fix #1900: intraword spacing for slightly better pdf copy-paste perfo…
Browse files Browse the repository at this point in the history
…rmance
  • Loading branch information
jbreiden2 authored and zdenop committed Apr 29, 2019
1 parent 137e6de commit 546a9e8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/api/pdfrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,10 @@ char* TessPDFRenderer::GetPDFTextObjects(TessBaseAPI* api,
}
res_it->Next(RIL_SYMBOL);
} while (!res_it->Empty(RIL_BLOCK) && !res_it->IsAtBeginningOf(RIL_WORD));
if (res_it->IsAtBeginningOf(RIL_WORD)) {
pdf_word += "0020";
pdf_word_len++;
}
if (word_length > 0 && pdf_word_len > 0) {
double h_stretch =
kCharWidth * prec(100.0 * word_length / (fontsize * pdf_word_len));
Expand Down

0 comments on commit 546a9e8

Please sign in to comment.