diff --git a/app/scanner/Scanner_zh_CN.qm b/app/scanner/Scanner_zh_CN.qm
index f57ab4a8..4e0c79d3 100644
Binary files a/app/scanner/Scanner_zh_CN.qm and b/app/scanner/Scanner_zh_CN.qm differ
diff --git a/app/scanner/Scanner_zh_CN.ts b/app/scanner/Scanner_zh_CN.ts
index 64dcf13c..5796c592 100644
--- a/app/scanner/Scanner_zh_CN.ts
+++ b/app/scanner/Scanner_zh_CN.ts
@@ -496,7 +496,7 @@ Continue to clear?
导出
-
+
-
+
+
+ OCR类型:
+
+
+
压缩选项
-
+
页码范围
-
+
被选页码
-
+
所有页码
-
+
指定页码(例如:1,3,6 或者3-6)
-
+
页码
-
+
Save as multipages (TIFF/PDF/OFD)
多页保存(TIFF/PDF/OFD/GIF)
-
-
+
+
输入无效。
页码范围将是“被选页码”
+
+
+
+ 英语
+
+
+
+
+ 中文(简体)
+
+
+
+
+ 中文(繁体)
+
+
+
+
+ 日文
+
+
+
+
+ 韩文
+
Dialog_ExportImageFile
@@ -563,17 +593,17 @@ Page range will be 'Chosen Pages'.
停止导出
-
+
导出失败:
-
+
提示
-
+
导出完成
@@ -1556,6 +1586,36 @@ Please make sure the two passwords are the same.
使用当前日期建立子文件夹
+
+
+
+ OCR类型:
+
+
+
+
+ 英语
+
+
+
+
+ 中文(简体)
+
+
+
+
+ 中文(繁体)
+
+
+
+
+ 日文
+
+
+
+
+ 韩文
+
Dialog_SaveMessageBox
@@ -2262,8 +2322,8 @@ bug description:
-
-
+
+
询问
@@ -2325,12 +2385,12 @@ Do you want to clear?
磁盘空间不足,请删除不需要的文件,以保证有足够的空间
-
+
打开图片
-
+
插入图片
@@ -2360,14 +2420,14 @@ Do you want to clear?
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
请手动唤醒设备
@@ -2387,216 +2447,216 @@ Do you want to clear?
取消
-
-
-
+
+
+
保存成功
-
-
+
+
图片名在列表中已存在
-
+
请至少选中一张图片再进行导出
-
+
文件名
-
+
文件路径
-
+
文件大小
-
+
创建时间
-
+
修改时间
-
+
访问时间
-
+
格式
-
+
宽度
-
+
高度
-
+
深度
-
+
色彩模式
-
+
每英寸像素点
-
+
打印尺寸
-
+
帧
-
+
无
-
+
黑白
-
+
灰度
-
+
彩色
-
+
不支持
-
+
警告
-
+
设备正在运行!
请先结束扫描。
-
+
无法访问当前缓存路径:%1
请尝试在【用户】菜单登录管理员账户,前往【缓存设置】更改缓存路径。
-
+
无法访问当前缓存路径:%1
请尝试在【扫描到】更改缓存路径。
-
+
图像处理失败
-
+
OCR初始化错误
-
+
OCR错误
-
+
文件不存在
-
+
加载动态库失败
-
+
文件数据错误
-
+
图像格式处理错误
-
+
内存不足
-
+
错误
-
-
+
+
语言切换成功,下次启动软件时生效!
-
+
您确定彻底删除选中项文件?
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
已唤醒设备
-
+
就绪
@@ -2606,7 +2666,7 @@ Please finish scanning first.
请尝试在【用户】菜单登录管理员账户,前往【缓存设置】更改缓存路径
-
+
文件访问权限不足
@@ -2619,46 +2679,46 @@ Please finish scanning first.
图像处理失败
-
+
您确定要断开设备:
-
+
吗?
-
-
+
+
关闭
-
+
提示
-
+
未获取到其他版本
-
-
+
+
设备不支持该操作
-
-
+
+
IO错误
-
-
+
+
错误
@@ -2673,17 +2733,17 @@ Continue to close?
是否继续关闭?
-
+
是否确定登出管理员账户?
-
+
确认操作
-
+
你确定要清除滚轴计数吗
@@ -2692,36 +2752,36 @@ Continue to close?
请重新进入关于界面以获取最新值
-
-
+
+
-
-
+
+
-
+
滚轴张数
-
+
打开扫描仪
-
-
+
+
华高扫描软件
-
-
+
+
成功
@@ -2738,22 +2798,22 @@ Continue to close?
失败
-
-
+
+
失败
-
+
警告
-
+
当前路径磁盘空间不足,
请重新选择路径或及时清理磁盘空间。
@@ -2763,7 +2823,7 @@ Continue to close?
配置丢失
-
+
应用配置
@@ -2771,18 +2831,18 @@ Continue to close?
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
启动失败
@@ -2931,25 +2991,25 @@ Continue to close?
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
保存图片文件失败:
-
+
启动安装程序失败!
-
+
有图像未保存,确定关闭?
@@ -2960,63 +3020,63 @@ Are you sure to close?
发现设备 : %1
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
提示
-
+
确定关闭应用软件?
-
+
确认操作
-
+
您确定要清除滚轴计数吗
-
-
-
+
+
+
提示
-
-
+
+
辊轴计数已置零
-
-
+
+
重置滚轴计数失败
-
+
错误
-
+
文档丢失!文档可能已被删除或被重命名。
@@ -3057,21 +3117,21 @@ Are you sure to close?
<p>%1</p><p>版本: %2<br>版权: © %3</p><p>%4%5%6%7%8%9</p>
-
-
+
+
关于 %1
-
-
+
+
<p>版本: %1</p>
<p>版本: %1</p>
-
-
+
+
<p>版权: © %1</p>
<p>版权: © %1</p>
diff --git a/app/scanner/Scanner_zh_EN.qm b/app/scanner/Scanner_zh_EN.qm
index a063164a..88b4f9b5 100644
Binary files a/app/scanner/Scanner_zh_EN.qm and b/app/scanner/Scanner_zh_EN.qm differ
diff --git a/app/scanner/Scanner_zh_EN.ts b/app/scanner/Scanner_zh_EN.ts
index bedc410f..47da6a89 100644
--- a/app/scanner/Scanner_zh_EN.ts
+++ b/app/scanner/Scanner_zh_EN.ts
@@ -470,32 +470,32 @@ Continue clearing?
Export
-
+
Page range
-
+
Specific page number (For example:1,3,6 or 3-6)
-
+
Selected pages
-
+
All pages
-
+
Page number:
-
+
-
+
Save multiple pages(TIFF/PDF/OFD/GIF)
-
+
+
+ OCR type:
+
+
+
Compression options
@@ -523,13 +528,38 @@ The page range will be “selected pages”
-
-
+
+
Input invalid.
The page range will be “selected pages”
+
+
+
+ English
+
+
+
+
+ Simplified Chinese
+
+
+
+
+ Traditional Chinese
+
+
+
+
+ Japanese
+
+
+
+
+ Korean
+
Dialog_ExportImageFile
@@ -544,17 +574,17 @@ The page range will be “selected pages”
Stop exporting
-
+
Export completed
-
+
Export failed:
-
+
Prompt
@@ -1476,6 +1506,36 @@ Please make sure the two passwords are the same.
Create a subfolder using the current date
+
+
+
+ OCR type:
+
+
+
+
+ English
+
+
+
+
+ Simplified Chinese
+
+
+
+
+ Traditional Chinese
+
+
+
+
+ Japanese
+
+
+
+
+ Korean
+
Dialog_SaveMessageBox
@@ -2195,8 +2255,8 @@ Please make sure the two passwords are the same.
-
-
+
+
Ask
@@ -2249,7 +2309,7 @@ Please make sure the two passwords are the same.
-
+
Insufficient disk space for the current path.
Please reselect a path or clear disk space immediately.
@@ -2257,7 +2317,7 @@ Please reselect a path or clear disk space immediately.
-
+
Warning
@@ -2286,15 +2346,15 @@ Please reselect a path or clear disk space immediately.
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
Failed to save image:
@@ -2317,46 +2377,46 @@ Please reselect a path or clear disk space immediately.
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
Failed to start
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
Please wake up the device manually
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
Device is awake
@@ -2393,230 +2453,230 @@ Do you want to clear?
Clear?
-
+
Open image
-
+
Insert image
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
prompt
-
-
-
+
+
+
Saved successfully
-
-
+
+
Image name already exists in the list
-
+
Please select at least one image and then export
-
+
File name
-
+
File path
-
+
File size
-
+
Creation time
-
+
Modification time
-
+
Access time
-
+
Format
-
+
Width
-
+
Height
-
+
Depth
-
+
Color mode
-
+
Pixels per inch
-
+
Print size
-
+
Frame
-
+
None
-
+
Black and white
-
+
Gray scale
-
+
Color
-
+
Not supported
-
+
Warning
-
+
Device is currently running!
Please stop scanning first.
-
+
There are unsaved images; are you sure you want to close?
-
+
Are you sure you want to close?
-
+
Are you sure you want to log out of the administrator account?
-
+
Confirm operation
-
+
Are you sure you want to clear the roller count?
-
-
-
+
+
+
Prompt
-
-
+
+
Roller count reset to zero.
-
-
+
+
Failed to reset roller count.
-
+
Error
-
+
File lost! File may be deleted or renamed.
-
+
Confirm operation
-
+
Are you sure you want to clear the roller count?
-
+
Unable to access the current path:%1
Please try to log in to the administrator account in the [User] menu and go to the [Cache settings] to change the cache path.
-
+
Unable to access the current path:%1
Please try to change the cache path in [Scan to].
@@ -2630,76 +2690,76 @@ Please try to change the cache path in [Scan to].
<p>%1</p><p>Version: %2<br>Copyright: © %3</p><p>%4%5%6%7%8%9</p>
-
-
+
+
About %1
-
-
+
+
<p>Version: %1</p>
-
-
+
+
<p>Copyright: © %1</p>
-
-
+
+
<p>%1: <a href='%2'>%3</a>
-
-
+
+
<p>%1: %2
-
+
Number of rollers
-
+
Open scanner
-
-
+
+
HUAGOSCAN scanning software
-
-
+
+
successfully
-
+
Ready
-
-
+
+
failed
-
-
+
+
Error
-
+
Failed to start!
@@ -2709,106 +2769,106 @@ Please try to change the cache path in [Scan to].
Please go to “Scan to” and change the accessible scan folder and then perform the scan.
-
+
Insufficient file access permissions
-
+
Image processing failed
-
+
OCR initialization error
-
+
OCR failed
-
+
File does not exist
-
+
Failed to load dynamic library
-
+
File data error
-
+
Image format processing error
-
+
Insufficient memory
-
+
Failed
-
+
Apply configuration
-
+
Are you sure you want to disconnect device:
-
+
?
-
-
+
+
Close
-
+
Prompt
-
+
No other versions obtained
-
-
+
+
Device does not support this operation
-
-
+
+
IO error
-
-
+
+
The language switch is successful and takes effect the next time the software is started!
-
+
Are you sure to delete the selected file completely?
diff --git a/app/scanner/dialog_export.cpp b/app/scanner/dialog_export.cpp
index 2b844276..f99d338a 100644
--- a/app/scanner/dialog_export.cpp
+++ b/app/scanner/dialog_export.cpp
@@ -144,6 +144,16 @@ Dialog_Export::Dialog_Export(int total, const std::vector &selectedIndexs,
ui->lab_warning->setVisible(true);
ui->lab_warning->setText(tr("Input is not valid.\nPage range will be 'Chosen Pages'."));
}
+
+ ui->label_ocrType->setVisible(false);
+ ui->comboBox_ocrType->setVisible(false);
+#if defined(OEM_ZHONGJING) && defined(HG_CMP_MSC)
+ ui->label_ocrType->setVisible(isOcr());
+ ui->comboBox_ocrType->setVisible(isOcr());
+ QStringList ocrType = { tr("English"), tr("Simplified Chinese"), tr("Traditional Chinese"), tr("Japanese"), tr("Korean") };
+ ui->comboBox_ocrType->addItems(ocrType);
+ ui->comboBox_ocrType->setCurrentIndex(getCfgValue("export", "ocrLanguage", 0));
+#endif
}
Dialog_Export::~Dialog_Export()
@@ -273,6 +283,11 @@ void Dialog_Export::on_dialog_accepted()
saveCfgValue("export", "exportType", exportType);
saveCfgValue("export", "saveAsMulti", ui->check_saveAsMulti->isChecked());
+#if defined(OEM_ZHONGJING) && defined(HG_CMP_MSC)
+ int ocrLanguage = ui->comboBox_ocrType->currentIndex();
+ saveCfgValue("export", "ocrLanguage", ocrLanguage);
+#endif
+
accept();
}
@@ -281,6 +296,12 @@ void Dialog_Export::on_filterSelected(const QString& filterName)
bool enabled = false;
m_suffix = ui->fileDialog->nameFilters().indexOf(filterName);
+
+#if defined(OEM_ZHONGJING) && defined(HG_CMP_MSC)
+ ui->label_ocrType->setVisible(isOcr());
+ ui->comboBox_ocrType->setVisible(isOcr());
+#endif
+
enabled = (m_supportType[m_suffix].attr & FILE_TYPE_ATTR_CONTAIN_MULTI_PAGES) == FILE_TYPE_ATTR_CONTAIN_MULTI_PAGES;
ui->check_saveAsMulti->setEnabled(enabled);
// ui->check_saveAsMulti->setEnabled(m_suffix > 2 && m_suffix < 6);
diff --git a/app/scanner/dialog_export.ui b/app/scanner/dialog_export.ui
index a1ffec9f..d92bd3bc 100644
--- a/app/scanner/dialog_export.ui
+++ b/app/scanner/dialog_export.ui
@@ -13,148 +13,169 @@
Export
-
+
-
-
-
+
-
-
-
- Page Range
-
-
-
-
-
+
+
-
+
+
+ Page Range
+
+
-
-
-
- Nominate Pages(example:1,3,6 or 3-6)
-
-
+
+
-
+
+
+ Nominate Pages(example:1,3,6 or 3-6)
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+ Chosen Pages
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+ All Pages
+
+
+
+
-
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
- -
-
-
- Chosen Pages
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
- -
-
-
- All Pages
-
-
-
-
-
- -
-
-
-
-
-
- Page:
-
-
-
- -
-
-
- -
-
-
- true
-
-
- color: rgb(216, 0, 0);
-
-
-
+
+
-
+
+
+ Page:
+
+
+
+ -
+
+
+ -
+
+
+ true
+
+
+ color: rgb(216, 0, 0);
+
+
+
Input is not valid.
Page range will be "Chosen Pages".
-
-
- true
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
+
+
+ true
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
-
-
-
-
-
-
- -
-
-
-
-
-
- Save as multipages (TIFF/PDF/OFD/GIF)
-
-
+
+
+
-
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
- -
-
-
- Compression Option
-
-
+
+
-
+
+
+ Save as multipages (TIFF/PDF/OFD/GIF)
+
+
+
+ -
+
+
+ Ocr type:
+
+
+
+ -
+
+
+
+ 111
+ 0
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+ Compression Option
+
+
+
+
diff --git a/app/scanner/dialog_exportimagefile.cpp b/app/scanner/dialog_exportimagefile.cpp
index 34dfdc18..ff723bcb 100644
--- a/app/scanner/dialog_exportimagefile.cpp
+++ b/app/scanner/dialog_exportimagefile.cpp
@@ -10,6 +10,7 @@
#include
#include
#include "ocrPdf.h"
+#include "app_cfg.h"
Dialog_ExportImageFile::Dialog_ExportImageFile(const QString &destPath, const QString &destName, const QString &destExt,
bool isSaveAsMulti, int jpegQuality, int tiffCompressionBW, int tiffCompression, int tiffQuality, bool isOcr,
@@ -116,7 +117,7 @@ void HGAPI Dialog_ExportImageFile::ThreadFunc(HGThread thread, HGPointer param)
HGImgFmt_CloseImageWriter(writer);
- bool result = createOcrPdf(tmpFileName, getStdString(fileName).c_str());
+ bool result = createOcrPdf(tmpFileName, getStdString(fileName).c_str(), getCfgValue("export", "ocrLanguage", 0));
QFile::remove(tmpFileName);
if (!result)
{
diff --git a/app/scanner/dialog_saveas.cpp b/app/scanner/dialog_saveas.cpp
index e8ef4f12..3ec54285 100644
--- a/app/scanner/dialog_saveas.cpp
+++ b/app/scanner/dialog_saveas.cpp
@@ -107,6 +107,17 @@ Dialog_SaveAs::Dialog_SaveAs(QWidget *parent) :
ui->cbox_subFolder->setChecked(false);
ui->cbox_subFolder->setChecked(getCfgValue("saveAs", "subFolderByTime", false));
+
+ ui->label_ocrType->setVisible(false);
+ ui->comboBox_ocrType->setVisible(false);
+
+#if defined(OEM_ZHONGJING) && defined(HG_CMP_MSC)
+ ui->label_ocrType->setVisible(isOcr());
+ ui->comboBox_ocrType->setVisible(isOcr());
+ QStringList ocrType = { tr("English"), tr("Simplified Chinese"), tr("Traditional Chinese"), tr("Japanese"), tr("Korean") };
+ ui->comboBox_ocrType->addItems(ocrType);
+ ui->comboBox_ocrType->setCurrentIndex(getCfgValue("saveAs", "ocrLanguage", 0));
+#endif
}
Dialog_SaveAs::~Dialog_SaveAs()
@@ -224,6 +235,11 @@ void Dialog_SaveAs::on_dialog_accepted()
m_savePath = getStdFileName(path + "/" + name + extName);
}
+#if defined(OEM_ZHONGJING) && defined(HG_CMP_MSC)
+ int ocrLanguage = ui->comboBox_ocrType->currentIndex();
+ saveCfgValue("saveAs", "ocrLanguage", ocrLanguage);
+#endif
+
saveCfgValue("saveAs", "suffix", m_suffix);
saveCfgValue("saveAs", "subFolderByTime", ui->cbox_subFolder->isChecked());
accept();
@@ -233,6 +249,11 @@ void Dialog_SaveAs::on_filterSelected(const QString& filterName)
{
m_suffix = ui->fileDialog->nameFilters().indexOf(filterName);
ui->btn_option->setEnabled(0 == m_suffix || 6 == m_suffix);
+
+#if defined(OEM_ZHONGJING) && defined(HG_CMP_MSC)
+ ui->label_ocrType->setVisible(isOcr());
+ ui->comboBox_ocrType->setVisible(isOcr());
+#endif
}
void Dialog_SaveAs::on_btn_option_clicked()
diff --git a/app/scanner/dialog_saveas.ui b/app/scanner/dialog_saveas.ui
index 8d9775c0..b02c1f83 100644
--- a/app/scanner/dialog_saveas.ui
+++ b/app/scanner/dialog_saveas.ui
@@ -33,6 +33,23 @@
+ -
+
+
+ Ocr type:
+
+
+
+ -
+
+
+
+ 101
+ 0
+
+
+
+
-
diff --git a/app/scanner/mainwindow.cpp b/app/scanner/mainwindow.cpp
index f57e1f7a..2b73ba80 100644
--- a/app/scanner/mainwindow.cpp
+++ b/app/scanner/mainwindow.cpp
@@ -435,7 +435,7 @@ HGResult MainWindow::saveImage(HGImage image, const HGImgFmtSaveInfo* info, bool
HGChar tmpFileName[256];
HGBase_GetTmpFileName("bmp", tmpFileName, 256);
ret = HGImgFmt_SaveImage(image, 0, info, tmpFileName);
- bool result = createOcrPdf(tmpFileName, fileName);
+ bool result = createOcrPdf(tmpFileName, fileName, getCfgValue("saveAs", "ocrLanguage", 0));
QFile::remove(tmpFileName);
return (result) ? HGBASE_ERR_OK : HGIMGPROC_ERR_OCR;
#else
diff --git a/app/scanner/ocrPdf.cpp b/app/scanner/ocrPdf.cpp
index 9ed8d725..660db350 100644
--- a/app/scanner/ocrPdf.cpp
+++ b/app/scanner/ocrPdf.cpp
@@ -32,7 +32,7 @@ std::string getOcrPath()
return ocrPath;
}
-bool createOcrPdf(const std::string &imgPath, const std::string &dstFile)
+bool createOcrPdf(const std::string &imgPath, const std::string &dstFile, int languageType)
{
#ifdef HG_CMP_MSC
std::string ocrPath = getOcrPath();
@@ -93,7 +93,28 @@ bool createOcrPdf(const std::string &imgPath, const std::string &dstFile)
bool ret = false;
char cmd[1024] = {0};
- sprintf(cmd, "tesseract.exe \"%s\" \"%s\" -l %s --psm %d --oem %d %s", imgPath.c_str(), prefix, "eng", 3, 3, "pdf");
+
+ if (0 == languageType)
+ {
+ sprintf(cmd, "tesseract.exe \"%s\" \"%s\" -l %s --psm %d --oem %d %s", imgPath.c_str(), prefix, "eng", 3, 3, "pdf");
+ }
+ else if (1 == languageType)
+ {
+ sprintf(cmd, "tesseract.exe \"%s\" \"%s\" -l %s --psm %d --oem %d %s", imgPath.c_str(), prefix, "chi_sim", 3, 3, "pdf");
+ }
+ else if (2 == languageType)
+ {
+ sprintf(cmd, "tesseract.exe \"%s\" \"%s\" -l %s --psm %d --oem %d %s", imgPath.c_str(), prefix, "chi_tra", 3, 3, "pdf");
+ }
+ else if (3 == languageType)
+ {
+ sprintf(cmd, "tesseract.exe \"%s\" \"%s\" -l %s --psm %d --oem %d %s", imgPath.c_str(), prefix, "jpn", 3, 3, "pdf");
+ }
+ else if (4 == languageType)
+ {
+ sprintf(cmd, "tesseract.exe \"%s\" \"%s\" -l %s --psm %d --oem %d %s", imgPath.c_str(), prefix, "kor", 3, 3, "pdf");
+ }
+
BOOL b = CreateProcessA(NULL, cmd, NULL, NULL, TRUE, CREATE_NO_WINDOW, NULL, NULL, &StartupInfo, &ProcessInfo);
if (b)
{
diff --git a/app/scanner/ocrPdf.h b/app/scanner/ocrPdf.h
index f2dbcffb..e500ee45 100644
--- a/app/scanner/ocrPdf.h
+++ b/app/scanner/ocrPdf.h
@@ -4,6 +4,6 @@
#include
std::string getOcrPath();
-bool createOcrPdf(const std::string &imgPath, const std::string &dstFile);
+bool createOcrPdf(const std::string &imgPath, const std::string &dstFile, int languageType);//languageType is the index of the comboBox on export and save_as ui.
#endif /* __OCRPDF_H__ */