ocr.htm 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" >
  3. <head>
  4. <title>跨浏览器调用高拍仪测试demo</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. </head>
  7. <!-- 引入高拍仪JS接口-->
  8. <script src="gpyhs.js" type="text/javascript" charset="utf-8"></script>
  9. <script type="text/javascript">
  10. //时间格式化显示
  11. function formatDate(time) {
  12. var date = new Date(time);
  13. var year = date.getFullYear(),
  14. month = date.getMonth() + 1,
  15. day = date.getDate(),
  16. hour = date.getHours(),
  17. min = date.getMinutes(),
  18. sec = date.getSeconds();
  19. var newTime = year +
  20. (month < 10 ? '0' + month : month) +
  21. (day < 10 ? '0' + day : day) +
  22. (hour < 10 ? '0' + hour : hour) +
  23. (min < 10 ? '0' + min : min) +
  24. (sec < 10 ? '0' + sec : sec) ;
  25. return newTime;
  26. }
  27. function sleep(milliSeconds) {
  28. var startTime = new Date().getTime();
  29. while (new Date().getTime() < startTime + milliSeconds);
  30. }
  31. function ShowInfo(op) {
  32. var obj = document.getElementById("TextInfo");
  33. obj.value = obj.value + "\r\n" + op
  34. }
  35. /*----------------------------------------------------
  36. ---(必须重写该函数)返回获取的设备数目及设备名称 ---
  37. -----------------------------------------------------*/
  38. function GetDevCountAndNameResultCB(devCount, devNameArr) {
  39. if (devCount > 0) {
  40. var obj = document.getElementById("DevName");
  41. obj.options.length = 0;
  42. for (var i = 0; i < devCount; i++) {
  43. var objOption = document.createElement("option");
  44. objOption.text = devNameArr[i];
  45. objOption.value = i;
  46. obj.options.add(objOption);
  47. }
  48. obj.selectedIndex = 0;
  49. var CamID = obj.selectedIndex;
  50. //获取分辨率
  51. Cam_GetDevResolution(CamID);
  52. }
  53. else {
  54. ShowInfo("没有发现合适的设备!");
  55. }
  56. }
  57. /*---------------------------------------------------
  58. --- (必须重写该函数)返回获取的设备分辨率信息 ---
  59. ----------------------------------------------------*/
  60. function GetResolutionResultCB(resCount, resArr) {
  61. if (resCount > 0) {
  62. var selectIndex = 0;
  63. var obj = document.getElementById("DevResolution");
  64. obj.options.length = 0;
  65. for (var i = 0; i < resCount; i++) {
  66. var objOption = document.createElement("option");
  67. objOption.text = resArr[i];
  68. objOption.value = i;
  69. obj.options.add(objOption);
  70. //默认500万分辨率打开
  71. if (resArr[i] == "2592*1944") {
  72. selectIndex = i;
  73. }
  74. }
  75. obj.selectedIndex = selectIndex;
  76. //打开摄像头
  77. Cam_Close();
  78. sleep(100);
  79. var restr = obj[obj.selectedIndex].text;
  80. var pos = restr.lastIndexOf("*");
  81. var width = parseInt(restr.substring(0, pos));
  82. var height = parseInt(restr.substring(pos + 1, restr.length));
  83. var CamID = document.getElementById("DevName").selectedIndex;
  84. Cam_Open(CamID, width, height);
  85. }
  86. else {
  87. ShowInfo("获取分辨率信息失败!");
  88. }
  89. }
  90. /*---------------------------------------------------
  91. --- (必须重写该函数)返回摄像头开启状态 ---
  92. ----------------------------------------------------*/
  93. function GetCameraOnOffStatus(status) {
  94. if (status == 0) {
  95. ShowInfo("设备开启成功");
  96. //Cam_Rotate(1); // 0-> 0度, 1->90度, 2->180度, 3->270度
  97. }
  98. else {
  99. ShowInfo("设备开启失败!");
  100. }
  101. }
  102. // /*---------------------------------------------------
  103. // -------- (必须重写该函数)当前拍照状态 ---------
  104. // ----------------------------------------------------*/
  105. // function GetCaptrueStatusResultCB(status) {
  106. // if (status == 0) {
  107. // ShowInfo("拍照完成");
  108. // }
  109. // else {
  110. // ShowInfo("正在拍摄...");
  111. // }
  112. // }
  113. /*---------------------------------------------------
  114. -------- (必须重写该函数)拍照结果 ---------
  115. ----------------------------------------------------*/
  116. function GetCaptrueImgResultCB( flag, path , base64Str) {
  117. if (flag == 0) {
  118. var obj = document.getElementById("CameraPhoto");
  119. obj.src = "data:;base64," + base64Str;
  120. if (path == "") {
  121. ShowInfo("拍照成功");
  122. }
  123. else {
  124. ShowInfo("拍照成功,图片保存位置:" + path);
  125. }
  126. }
  127. else {
  128. ShowInfo("拍照失败!");
  129. }
  130. }
  131. /*---------------------------------------------------
  132. ------ (必须重写该函数)身份证信息返回结果 ------
  133. ----------------------------------------------------*/
  134. function GetIdCardInfoResultCB(flag, Name, Sex, Nation, Born, Address, CardNum, IssuedAt, EffectedDate, CardImgPath, CardImgBase64) {
  135. if (flag == 0) {
  136. document.getElementById("CardName").value = Name;
  137. document.getElementById("CardSex").value = Sex;
  138. document.getElementById("CardNation").value = Nation;
  139. document.getElementById("CardBorn").value = Born;
  140. document.getElementById("CardAddress").value = Address;
  141. document.getElementById("CardNum").value = CardNum;
  142. document.getElementById("CardIssuedAt").value = IssuedAt;
  143. document.getElementById("CardEffectDate").value = EffectedDate;
  144. var obj = document.getElementById("IdCardPhoto");
  145. obj.src = "data:;base64," + CardImgBase64;
  146. ShowInfo("读卡成功");
  147. }
  148. else {
  149. ShowInfo("读卡失败!");
  150. }
  151. }
  152. /*-------------------------------------------------------------------
  153. ------ (必须重写该函数)身份证信息及正反面合并照片返回结果 ------
  154. --------------------------------------------------------------------*/
  155. function GetIdCardInfoAndImgResultCB(flag, Name, Sex, Nation, Born, Address, CardNum, IssuedAt, EffectedDate, CardImgPath, CardHeadImgBase64, CardImgBase64) {
  156. if (flag == 0) {
  157. document.getElementById("CardName").value = Name;
  158. document.getElementById("CardSex").value = Sex;
  159. document.getElementById("CardNation").value = Nation;
  160. document.getElementById("CardBorn").value = Born;
  161. document.getElementById("CardAddress").value = Address;
  162. document.getElementById("CardNum").value = CardNum;
  163. document.getElementById("CardIssuedAt").value = IssuedAt;
  164. document.getElementById("CardEffectDate").value = EffectedDate;
  165. var obj = document.getElementById("IdCardPhoto");
  166. obj.src = "data:;base64," + CardHeadImgBase64;
  167. var obj = document.getElementById("CameraPhoto");
  168. obj.src = "data:;base64," + CardImgBase64;
  169. ShowInfo("读卡成功");
  170. }
  171. else {
  172. ShowInfo("读卡失败!");
  173. }
  174. }
  175. /*---------------------------------------------------
  176. ------ (必须重写该函数)条码二维码识别返回结果------
  177. ----------------------------------------------------*/
  178. function QrBarCodeRecogResultCB(flag,codeStr) {
  179. if (flag == 0)
  180. ShowInfo("条码/二维码 识别结果:" + codeStr);
  181. else
  182. ShowInfo("未识别到内容!");
  183. }
  184. /*********************
  185. *** 初始化操作 ***
  186. **********************/
  187. function LoadCameraDocument() {
  188. if (!window.WebSocket) {
  189. alert("浏览器不支持HTML5,请更新浏览器或者使用其它浏览器");
  190. }
  191. //console.log("LoadCameraDocument");
  192. var obj = document.getElementById("CameraCtl");
  193. Cam_ControlInit(obj,0, 0, 600, 400);
  194. }
  195. window.onload = function () {
  196. console.log("window.onload");
  197. }
  198. /*********************
  199. *** 打开摄像头 ***
  200. **********************/
  201. function toOpenCamera() {
  202. var CamID = document.getElementById("DevName").selectedIndex;
  203. var obj = document.getElementById("DevResolution");
  204. var restr = obj[obj.selectedIndex].text;
  205. var pos = restr.lastIndexOf("*");
  206. var width = parseInt(restr.substring(0, pos));
  207. var height = parseInt(restr.substring(pos + 1, restr.length));
  208. Cam_Open(CamID, width, height);
  209. }
  210. /*********************
  211. *** 关闭摄像头 ***
  212. **********************/
  213. function toCloseCamera() {
  214. Cam_Close();
  215. }
  216. /*********************
  217. *** 切换摄像头 ***
  218. **********************/
  219. function SelectDevice() {
  220. var CamID = document.getElementById("DevName").selectedIndex;
  221. //获取分辨率
  222. Cam_GetDevResolution(CamID);
  223. }
  224. /*********************
  225. *** 切换分辨率 ***
  226. **********************/
  227. function SelectResolution() {
  228. var obj = document.getElementById("DevResolution");
  229. var restr = obj[obj.selectedIndex].text;
  230. var pos = restr.lastIndexOf("*");
  231. var width = parseInt(restr.substring(0, pos));
  232. var height = parseInt(restr.substring(pos + 1, restr.length));
  233. var CamID = document.getElementById("DevName").selectedIndex;
  234. Cam_Open(CamID, width, height);
  235. }
  236. /*********************
  237. *** 拍照 ***
  238. **********************/
  239. function TakePhoto() {
  240. var name = formatDate(new Date().getTime());
  241. var obj = document.getElementById("FileType");
  242. var path;
  243. Cam_SetFileType(obj.selectedIndex); //设置文件格式
  244. if (obj.selectedIndex == 0) {
  245. path = "D:\\" + name + ".jpg";
  246. }
  247. else if (obj.selectedIndex == 1) {
  248. path = "D:\\" + name + ".png";
  249. }
  250. else if (obj.selectedIndex == 2) {
  251. path = "D:\\" + name + ".tif";
  252. }
  253. else if (obj.selectedIndex == 3) {
  254. path = "D:\\" + name + ".pdf";
  255. }
  256. else {
  257. path = "D:\\" + name + ".jpg";
  258. }
  259. Cam_Photo(path); //主摄像头拍照
  260. //Cam_Photo(""); //主摄像头拍照
  261. }
  262. function SetCameraCutMode() {
  263. if (document.getElementById("Radio1").checked) {
  264. Cam_SetCutMode(0);
  265. }
  266. if (document.getElementById("Radio3").checked) {
  267. Cam_SetCutMode(1);
  268. }
  269. if (document.getElementById("Radio2").checked) {
  270. Cam_SetCutMode(2);
  271. }
  272. if (document.getElementById("Radio4").checked) {
  273. Cam_SetCutMode(3);
  274. //设置裁剪区域
  275. //toSleep(100);
  276. //console.log("SetCustomArea");
  277. SetCustomArea(3000,3000,9000,9000);
  278. }
  279. }
  280. /*********************
  281. *** 读取身份证 ***
  282. **********************/
  283. function GetIdCardInfo() {
  284. var path = "D:\\IdCard.jpg";
  285. //Cam_ReadIdCard(path);
  286. //Cam_ReadIdCard("");
  287. Cam_ReadIdCardEx(path);
  288. }
  289. /*********************
  290. *** 设置文件格式 ***
  291. **********************/
  292. function toSetFileType() {
  293. var obj = document.getElementById("FileType");
  294. Cam_SetFileType(obj.selectedIndex);
  295. }
  296. /*********************
  297. *** 设置色彩模式 ***
  298. **********************/
  299. function toSetColorModel() {
  300. var obj = document.getElementById("ColorMode");
  301. Cam_SetColorMode(obj.selectedIndex);
  302. }
  303. /*********************
  304. *** 设置JPG图像质量 ***
  305. **********************/
  306. function toSetJpgQuality() {
  307. var obj = document.getElementById("JpgQuality");
  308. var val = obj[obj.selectedIndex].text;
  309. Cam_SetJpgQuality(val);
  310. }
  311. /*********************
  312. *** 设置去黑边 ***
  313. **********************/
  314. function toSetDeleteBlackEdge() {
  315. var obj = document.getElementById("Checkbox1");
  316. if (obj.checked) {
  317. Cam_SetDeleteBlackEdge(1);
  318. }
  319. else {
  320. Cam_SetDeleteBlackEdge(0);
  321. }
  322. }
  323. /*********************
  324. *** 设置去底色 ***
  325. **********************/
  326. function toSetDeleteBgColor() {
  327. var obj = document.getElementById("Checkbox2");
  328. if (obj.checked) {
  329. Cam_SetDeleteBgColor(1);
  330. }
  331. else {
  332. Cam_SetDeleteBgColor(0);
  333. }
  334. }
  335. /*---------------------------------------------------
  336. -------- (必须重写该函数)上传结果 ---------
  337. ----------------------------------------------------*/
  338. function HttpResultCB(flag, ResultStr) {
  339. if (flag == 0) {
  340. alert("上传成功 :" + ResultStr);
  341. }
  342. else {
  343. alert("上传失败!");
  344. }
  345. }
  346. /*********************
  347. ****** 上传 ******
  348. **********************/
  349. function HttpUploadFile() {
  350. var filePath = "D:\\test.jpg";
  351. //var url = "http://112.27.213.220:2201/interface/FileUploadCode.jsp";
  352. //var url = "http://localhost:9005/MyServletTest/upload";
  353. var url = "http://localhost:4523/UploadFile.ashx";
  354. //var url = "http://localhost:9005/MyServletTest/upload";
  355. UploadFile(url, filePath);
  356. }
  357. //从摄像头中识别二维码
  358. function RecogQrCodeFromCamera(type){
  359. Cam_RecogQrBarCodeFromCamera(type)
  360. }
  361. //从图片文件中识别二维码
  362. function RecogBarCodeFromFile(type) {
  363. var imgpath = "D:\\123.jpg";
  364. Cam_RecogQrBarCodeFromFile(type, imgpath)
  365. }
  366. //添加要合并的PDF文件
  367. function ToAddPDFFile() {
  368. Cam_AddImgFileToPDF("");
  369. // var path1 = "D:\\1.jpg";
  370. // var path2 = "D:\\2.jpg";
  371. // var path3 = "D:\\3.jpg";
  372. // var path4 = "D:\\4.jpg";
  373. // var path5 = "D:\\5.jpg";
  374. // var path6 = "D:\\6.jpg";
  375. // //var path7 = "D:\\7.jpg";
  376. // var allpath = path1 + ";" + path2 + ";" + path3 + ";" + path4 + ";" + path5 + ";" + path6 ;
  377. // Cam_AddImgFileToPDF(allpath);
  378. sleep(100);
  379. }
  380. /*---------------------------------------------------
  381. -------- 添加合并的PDF文件返回结果 ---------
  382. ----------------------------------------------------*/
  383. function AddImgFileToPDFResultCB(flag, base64Str)
  384. {
  385. if (flag == 0) {
  386. ShowInfo("添加合并的PDF文件成功");
  387. var obj = document.getElementById("CameraPhoto");
  388. obj.src = "data:;base64," + base64Str;
  389. }
  390. else {
  391. ShowInfo("添加合并的PDF文件失败!");
  392. }
  393. }
  394. //PDF合并测试
  395. function ToCombinePDF() {
  396. Cam_CombinePDF("D:\\test.pdf");
  397. //Cam_CombinePDF("");
  398. //Cam_CombinePDF("D:\\QRjoNxNcgw.pdf");
  399. }
  400. /*---------------------------------------------------
  401. -------- (必须重写该函数)合并PDF结果 ---------
  402. ----------------------------------------------------*/
  403. function PdfCombineResultCB(flag, PdfBase64Str) {
  404. if (flag == 0) {
  405. ShowInfo("合并PDF完成");
  406. console.log(PdfBase64Str);
  407. }
  408. else {
  409. ShowInfo("合并PDF失败!");
  410. }
  411. }
  412. //添加要合并的图像文件
  413. function ToAddMergeImageFile() {
  414. Cam_AddMergeImageFile("");
  415. sleep(100);
  416. }
  417. /*---------------------------------------------------
  418. -------- 添加合并图像文件返回结果 ---------
  419. ----------------------------------------------------*/
  420. function AddMergeImageFileResultCB(flag, base64Str) {
  421. if (flag == 0) {
  422. ShowInfo("添加合并图像文件成功");
  423. var obj = document.getElementById("CameraPhoto");
  424. obj.src = "data:;base64," + base64Str;
  425. }
  426. else {
  427. ShowInfo("添加合并图像文件失败!");
  428. }
  429. }
  430. //图像合并测试
  431. function ToMergeImages() {
  432. Cam_MergeImages("D:\\merge.jpg",0);
  433. }
  434. /*---------------------------------------------------
  435. -------- (必须重写该函数)图像合并结果 ---------
  436. ----------------------------------------------------*/
  437. function MergeImagesResultCB(flag, base64Str) {
  438. if (flag == 0) {
  439. ShowInfo("图像合并完成");
  440. var obj = document.getElementById("CameraPhoto");
  441. obj.src = "data:;base64," + base64Str;
  442. }
  443. else {
  444. ShowInfo("图像合并失败!");
  445. }
  446. }
  447. /*---------------------------------------------------
  448. -------(必须重写该函数)获取驱动盘符返回结果--------
  449. ----------------------------------------------------*/
  450. function GetDriveResultCB(driveStr) {
  451. if (driveStr == "") {
  452. ShowInfo("获取盘符失败!");
  453. }
  454. else {
  455. ShowInfo(driveStr);
  456. }
  457. }
  458. //设置水印
  459. function toSetWaterMarkParams() {
  460. var isAddMark;
  461. var isAddTime;
  462. var wTransp;
  463. var wPos;
  464. var wSize;
  465. var wColor;
  466. var szInfo;
  467. var obj = document.getElementById("Checkbox3");
  468. if (obj.checked)
  469. isAddMark = 1;
  470. else
  471. isAddMark = 0;
  472. obj = document.getElementById("Checkbox4");
  473. if (obj.checked)
  474. isAddTime = 1;
  475. else
  476. isAddTime = 0;
  477. szInfo = document.getElementById("Text1").value; //水印内容
  478. wTransp = parseInt(document.getElementById("Text2").value); //透明度
  479. wSize = parseInt(document.getElementById("Text3").value); //水印大小
  480. wPos = document.getElementById("Select1").selectedIndex; //水印位置
  481. wColor = document.getElementById("Select2").selectedIndex; //水印颜色
  482. SetWaterMark(isAddMark, 0, isAddTime, wTransp, wPos, wSize, wColor, szInfo); //生效水印设置
  483. }
  484. //删除文件
  485. function ToDeleteFile() {
  486. var path = "D:\\log.txt";
  487. DeleteFile(path);
  488. }
  489. //删除文件返回结果
  490. function GetDeleteFileResultCB(flag) {
  491. if (flag == 0) {
  492. ShowInfo("删除文件成功");
  493. }
  494. else {
  495. ShowInfo("删除文件失败!");
  496. }
  497. }
  498. /*----------------------------------------------------------------
  499. -------(必须重写该函数)添加需要OCR识别的图片文件返回结果--------
  500. --------------------------------------------------------------*/
  501. function AddOcrRecogFileResultCB(flag, base64Str) {
  502. if (flag == 0) {
  503. ShowInfo("添加需要OCR识别的图片文件成功");
  504. var obj = document.getElementById("CameraPhoto");
  505. obj.src = "data:;base64," + base64Str;
  506. }
  507. else {
  508. ShowInfo("添加文件失败!");
  509. }
  510. }
  511. //添加文件
  512. function ToAddOcrRecogFile() {
  513. //AddOcrRecogFile(""); //传空拍照添加,也可以传文件路径
  514. var path1 = "D:\\1.jpg";
  515. var path2 = "D:\\2.jpg";
  516. var path3 = "D:\\3.jpg";
  517. var path4 = "D:\\4.jpg";
  518. var path5 = "D:\\5.jpg";
  519. var path6 = "D:\\6.jpg";
  520. //var path7 = "D:\\7.jpg";
  521. var allpath = path1 + ";" + path2 + ";" + path3 + ";" + path4 + ";" + path5 + ";" + path6 ;
  522. console.log(allpath);
  523. AddOcrRecogFile(allpath);
  524. }
  525. /*---------------------------------------------------
  526. -------(必须重写该函数)OCR识别结果返回--------
  527. ----------------------------------------------------*/
  528. function OcrCallResultCB(flag,proValue, ResultStr, base64Str) {
  529. if (flag == 0) {
  530. ShowInfo("Ocr文字识别成功:" + ResultStr);
  531. //ShowInfo("base64data:" + base64Str);
  532. var obj = document.getElementById("mypdf");
  533. obj.src = "data:application/pdf;base64," + base64Str;
  534. }
  535. else if (flag == 1) {
  536. ShowInfo("Ocr文字识别进度:" + proValue);
  537. }
  538. else {
  539. if (flag == 40)
  540. ShowInfo("Ocr授权失败!");
  541. else
  542. ShowInfo("Ocr文字识别失败!");
  543. }
  544. }
  545. //OCR识别(多张合并识别)
  546. function ToOcrCallProEx() {
  547. OcrCallProEx(0, "D:\\out.pdf",0);
  548. }
  549. //OCR测试(单张识别)
  550. function OcrTest() {
  551. OcrCallPro(0, "D:\\test.jpg", "D:\\test.pdf");
  552. }
  553. </script>
  554. <body onload="LoadCameraDocument()">
  555. <div style="width:602px; height: 640px; border: 1px solid white; background:#C7EDCC; float:left">
  556. <div id='CameraCtl' style="width:600px; height: 400px"> </div>
  557. <div>
  558. 设备
  559. <select style="width:140px" id="DevName" onchange = "SelectDevice()"></select>
  560. 分辨率
  561. <select style="width:140px" id="DevResolution" onchange = "SelectResolution()"></select>
  562. <input type = "button" value = " 打开设备 " onclick = "toOpenCamera();"/>
  563. <input type = "button" value = " 关闭设备 " onclick = "toCloseCamera();"/>
  564. <br />
  565. 裁切模式:
  566. <input id="Radio1" name="R1" type="radio" value="V1" onclick="SetCameraCutMode()" checked="checked"/>不裁切
  567. <input id="Radio2" name="R1" type="radio" value="V2" onclick="SetCameraCutMode()"/>手动裁切
  568. <input id="Radio3" name="R1" type="radio" value="V3" onclick="SetCameraCutMode()"/>自动裁切
  569. <input id="Radio4" name="R1" type="radio" value="V4" onclick="SetCameraCutMode()"/>自定义
  570. <br />
  571. 文件格式:
  572. <select id="FileType" onchange = "toSetFileType()">
  573. <option value="0">jpg</option>
  574. <option value="1">png</option>
  575. <option value="2">tif</option>
  576. <option value="3">pdf</option>
  577. </select>
  578. 色彩模式:
  579. <select id="ColorMode" onchange = "toSetColorModel()">
  580. <option value="0">彩色</option>
  581. <option value="1">灰度</option>
  582. <option value="2">黑白</option>
  583. </select>
  584. 图像质量:
  585. <select id="JpgQuality" onchange = "toSetJpgQuality()">
  586. <option value="0">10</option>
  587. <option value="1">20</option>
  588. <option value="2">30</option>
  589. <option value="3">40</option>
  590. <option value="4">50</option>
  591. <option value="5" selected="true">60</option>
  592. <option value="6">70</option>
  593. <option value="7">80</option>
  594. <option value="8">90</option>
  595. <option value="9">100</option>
  596. </select>
  597. <input id="Checkbox1" type="checkbox" onclick = "toSetDeleteBlackEdge()"/> 去黑边
  598. <input id="Checkbox2" type="checkbox" onclick = "toSetDeleteBgColor()"/> 去底色
  599. </div>
  600. <br />
  601. <div>
  602. <input id="Checkbox3" type="checkbox" /> 添加水印
  603. 水印内容<input id="Text1" type="text" value="水印测试" />
  604. 透明度<input id="Text2" type="text" value="127" style="width:40px" />
  605. 大小<input id="Text3" type="text" value="80" style="width:40px"/> <br />
  606. 位置
  607. <select id="Select1">
  608. <option value="0">左上</option>
  609. <option value="1">右上</option>
  610. <option value="2">左下</option>
  611. <option value="3">右下</option>
  612. <option value="4">中间</option>
  613. </select>
  614. 颜色
  615. <select id="Select2" >
  616. <option value="0">红色</option>
  617. <option value="1">绿色</option>
  618. <option value="2">蓝色</option>
  619. <option value="3">青色</option>
  620. <option value="4">黄色</option>
  621. <option value="5">白色</option>
  622. <option value="6">黑色</option>
  623. </select>
  624. <input id="Checkbox4" type="checkbox" /> 添加时间水印
  625. <input type = "button" value = "生效水印参数设置" onclick = "toSetWaterMarkParams()"/>
  626. </div>
  627. <br />
  628. <div>
  629. <input type = "button" value = "获取盘符" onclick = "GetDrives();" />
  630. <input type = "button" value = "放大" onclick = "Cam_ZoomIn();" />
  631. <input type = "button" value = "缩小" onclick = "Cam_ZoomOut();" />
  632. <input type = "button" value = "适屏" onclick = "Cam_BestSize();" />
  633. <input type = "button" value = "1:1" onclick = "Cam_TrueSize();" />
  634. <input type = "button" value = "左旋" onclick = "Cam_RotateLeft();" />
  635. <input type = "button" value = "右旋" onclick = "Cam_RotateRight();" />
  636. <input type = "button" value = "拍照" onclick = "TakePhoto();" />
  637. <input type = "button" value = "对焦" onclick = "Cam_Focus();" />
  638. <input type = "button" value = "设置" onclick = "Cam_ShowVideoProp();" />
  639. <input type = "button" value = "上传" onclick = "HttpUploadFile();" />
  640. <input type = "button" value = "读身份证" onclick = "GetIdCardInfo();" />
  641. <input type = "button" value = "从摄像头中识别二维码" onclick = "RecogQrCodeFromCamera(1);" />
  642. <input type = "button" value = "从图片中识别二维码" onclick = "RecogBarCodeFromFile(1);" />
  643. <input type = "button" value = "添加合并PDF文件" onclick = "ToAddPDFFile();" />
  644. <input type = "button" value = "合并PDF" onclick = "ToCombinePDF();" />
  645. <input type = "button" value = "添加合并图像文件" onclick = "ToAddMergeImageFile();" />
  646. <input type = "button" value = "合并图像" onclick = "ToMergeImages();" />
  647. <input type = "button" value = "删除文件" onclick = "ToDeleteFile();" />
  648. <input type = "button" value = "OCR" onclick = "OcrTest();" />
  649. </div>
  650. <div>
  651. <input type = "button" value = "添加需要OCR识别的图片文件" onclick = "ToAddOcrRecogFile();" />
  652. <input type = "button" value = "OCR识别(多张合并识别)" onclick = "ToOcrCallProEx();" />
  653. </div>
  654. <div style="width:595px; height: 80px">
  655. <textarea style="width:100%; height:100%" id="TextInfo" cols="20" rows="2"></textarea>
  656. </div>
  657. </div>
  658. <div style="width:202px; height: 640px; border: 1px solid white; background:#C7EDCC; float:left">
  659. 拍照图片
  660. <br />
  661. <img id="CameraPhoto" src="" style="width: 198px;height: 198px;" />
  662. <br />
  663. 身份证信息
  664. <br />
  665. <img id="IdCardPhoto" src="" style="width: 80px;height: 100px;" />
  666. <br />
  667. 姓名
  668. <input id="CardName" type="text" style="width: 100px"/> <br />
  669. 性别
  670. <input id="CardSex" type="text" style="width: 50px"/>
  671. 民族
  672. <input id="CardNation" type="text" style="width: 60px"/> <br />
  673. 出生
  674. <input id="CardBorn" type="text" style="width: 100px"/> <br />
  675. 住址
  676. <br />
  677. <textarea id="CardAddress" cols="20" rows="3" style="width:192px"></textarea>
  678. 身份证号码
  679. <br />
  680. <input id="CardNum" type="text" style="width: 195px"/> <br />
  681. 签发机关
  682. <input id="CardIssuedAt" type="text" style="width: 125px"/> <br />
  683. 有效期限
  684. <input id="CardEffectDate" type="text" style="width: 125px"/> <br />
  685. <embed id="mypdf" src="" type="application/pdf" width="200" height="100"/>
  686. </div>
  687. </body>
  688. </html>