@@ -299,6 +299,9 @@ Now we can use the page to scan or acquire, then upload the images as a PDF docu
299299 < title > Hello World < / title >
300300 < script src = " Resources/dynamsoft.webtwain.initiate.js" > < / script >
301301 < script src = " Resources/dynamsoft.webtwain.config.js" > < / script >
302+ < script src = " Resources/addon/dynamsoft.webtwain.addon.camera.js" >< / script >
303+ < meta http - equiv = " X-UA-Compatible" content = " IE=edge" >
304+ < meta name = " viewport" content = " width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" >
302305< / head >
303306
304307< body >
@@ -311,40 +314,42 @@ Now we can use the page to scan or acquire, then upload the images as a PDF docu
311314 DWObject = Dynamsoft .DWT .GetWebTwain ('dwtcontrolContainer' );
312315 }
313316
314- function AcquireImage () {
315- if (DWObject ) {
316- if (Dynamsoft .Lib .env .bMobile ) {
317- var showVideoConfigs = {
318- scannerViewer : {
319- autoDetect : {
320- enableAutoDetect : true
321- }
322- },
323- filterViewer : {
324- exitDocumentScanAfterSave : true
325- }
326- };
327-
328- if (DWObject ) {
329- if (! DWObject .UseLocalService ) {
330- DWObject .Addon .Camera .scanDocument (showVideoConfigs ).then (
331- function (){console .log (" OK" );},
332- function (error ){console .log (error .message );});
333- }
334- }
335- }
336- }
337- else {
338- DWObject .SelectSource (function () {
339- DWObject .OpenSource ();
340- DWObject .AcquireImage ();
341- },
342- function () {
343- console .log (" SelectSource failed!" );
344- });
345- }
346- }
347- }
317+ function AcquireImage () {
318+ if (DWObject ) {
319+ if (Dynamsoft .Lib .env .bMobile ) {
320+ var showVideoConfigs = {
321+ scannerViewer : {
322+ autoDetect : {
323+ enableAutoDetect : true
324+ }
325+ },
326+ filterViewer : {
327+ exitDocumentScanAfterSave : true
328+ }
329+ };
330+
331+ if (! DWObject .UseLocalService ) {
332+ DWObject .Addon .Camera .scanDocument (showVideoConfigs ).then (
333+ function (){
334+ console .log (" OK" );
335+ },
336+ function (error ){
337+ console .log (error .message );
338+ });
339+ }
340+ }
341+ else {
342+ DWObject .SelectSource (
343+ function () {
344+ DWObject .OpenSource ();
345+ DWObject .AcquireImage ();
346+ },
347+ function () {
348+ console .log (" SelectSource failed!" );
349+ });
350+ }
351+ }
352+ }
348353
349354 function UploadAsPDF () {
350355 var url = Dynamsoft .Lib .detect .ssl ? " https://" : " http://" ;
0 commit comments