diff --git a/frontend/document/koptinterface.lua b/frontend/document/koptinterface.lua index 67ef58f5b..7c4eeb12d 100644 --- a/frontend/document/koptinterface.lua +++ b/frontend/document/koptinterface.lua @@ -402,7 +402,7 @@ returned boxes are in native page coordinates zoomed at 1.0 --]] function KoptInterface:getTextBoxes(doc, pageno) local text = doc:getPageTextBoxes(pageno) - if text and #text > 1 then + if text and #text > 1 and doc.configurable.forced_ocr == 0 then return text -- if we have no text in original page then we will reuse native word boxes -- in reflow mode and find text boxes from scratch in non-reflow mode diff --git a/frontend/ui/data/koptoptions.lua b/frontend/ui/data/koptoptions.lua index b9a6ad68c..a9686ed98 100644 --- a/frontend/ui/data/koptoptions.lua +++ b/frontend/ui/data/koptoptions.lua @@ -201,6 +201,14 @@ local KoptOptions = { values={0.5, 1.0, 1.5}, default_value = DKOPTREADER_CONFIG_RENDER_QUALITY, }, + { + name = "forced_ocr", + name_text = S.FORCED_OCR, + toggle = {S.ON, S.OFF}, + values = {1, 0}, + default_value = 0, + advanced = true, + }, { name = "defect_size", name_text = S.DEFECT_SIZE, diff --git a/frontend/ui/data/strings.lua b/frontend/ui/data/strings.lua index 51ed3a2bf..c6f1570b9 100644 --- a/frontend/ui/data/strings.lua +++ b/frontend/ui/data/strings.lua @@ -27,6 +27,7 @@ S.VIEW_MODE = _("View Mode") S.EMBEDDED_STYLE = _("Embedded Style") S.WRITING_DIR = _("Writing Direction") S.PROGRESS_BAR = _("Progress Bar") +S.FORCED_OCR = _("Forced OCR") S.ON = _("on") S.OFF = _("off")