add advanced option forced_ocr to force ocring text

pull/736/head
chrox 10 years ago
parent e91ddee836
commit 120f18737e

@ -402,7 +402,7 @@ returned boxes are in native page coordinates zoomed at 1.0
--]] --]]
function KoptInterface:getTextBoxes(doc, pageno) function KoptInterface:getTextBoxes(doc, pageno)
local text = doc:getPageTextBoxes(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 return text
-- if we have no text in original page then we will reuse native word boxes -- 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 -- in reflow mode and find text boxes from scratch in non-reflow mode

@ -201,6 +201,14 @@ local KoptOptions = {
values={0.5, 1.0, 1.5}, values={0.5, 1.0, 1.5},
default_value = DKOPTREADER_CONFIG_RENDER_QUALITY, 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 = "defect_size",
name_text = S.DEFECT_SIZE, name_text = S.DEFECT_SIZE,

@ -27,6 +27,7 @@ S.VIEW_MODE = _("View Mode")
S.EMBEDDED_STYLE = _("Embedded Style") S.EMBEDDED_STYLE = _("Embedded Style")
S.WRITING_DIR = _("Writing Direction") S.WRITING_DIR = _("Writing Direction")
S.PROGRESS_BAR = _("Progress Bar") S.PROGRESS_BAR = _("Progress Bar")
S.FORCED_OCR = _("Forced OCR")
S.ON = _("on") S.ON = _("on")
S.OFF = _("off") S.OFF = _("off")

Loading…
Cancel
Save