From 546a9e81eb76d8331092e489dc1e7a14dbe55c1a Mon Sep 17 00:00:00 2001 From: Jeff Breidenbach Date: Mon, 29 Apr 2019 11:28:30 +0200 Subject: [PATCH] fix #1900: intraword spacing for slightly better pdf copy-paste performance --- src/api/pdfrenderer.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/api/pdfrenderer.cpp b/src/api/pdfrenderer.cpp index db5449e08e..3495cd7f25 100644 --- a/src/api/pdfrenderer.cpp +++ b/src/api/pdfrenderer.cpp @@ -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));