{"analyzedAt":"2022-12-23T03:23:42.591Z","collected":{"metadata":{"name":"mobile-web-capture","scope":"unscoped","version":"18.0.0","description":"Dynamic Web TWAIN Mobile Web Capture SDK is a web document capture SDK for iOS and Android browsers. It is designed for developers to build document scanning web applications for mobile users to load, edit, save, upload files, and capture images from the","keywords":["mobile","android","ios","camera","cropping","edge detection","document detection","image filter","mobile scanner","pdf","JavaScript","document","scanning","web","browser","cross-platform","scanner","document management","HTML5 scan","JavaScript scan","Web scan","HTML5 scanner","JavaScript scanner","web scanner","HTML5 scanning","JavaScript scanning","Web scanning","TWAIN","Web TWAIN","document scanning"],"date":"2022-12-22T06:05:22.083Z","author":{"name":"Dynamsoft","url":"https://www.dynamsoft.com"},"publisher":{"username":"ellie-dynamsoft","email":"ellie@dynamsoft.com"},"maintainers":[{"username":"ellie-dynamsoft","email":"ellie@dynamsoft.com"}],"links":{"npm":"https://www.npmjs.com/package/mobile-web-capture","homepage":"https://www.dynamsoft.com/web-twain/features/mobile-web-capture-sdk/"},"dependencies":{"dynamsoft-javascript-barcode":"9.2.13"},"releases":[{"from":"2022-11-23T00:00:00.000Z","to":"2022-12-23T00:00:00.000Z","count":2},{"from":"2022-09-24T00:00:00.000Z","to":"2022-12-23T00:00:00.000Z","count":2},{"from":"2022-06-26T00:00:00.000Z","to":"2022-12-23T00:00:00.000Z","count":4},{"from":"2021-12-23T00:00:00.000Z","to":"2022-12-23T00:00:00.000Z","count":6},{"from":"2020-12-23T00:00:00.000Z","to":"2022-12-23T00:00:00.000Z","count":6}],"hasSelectiveFiles":true,"readme":"# Dynamic Web TWAIN Mobile Web Capture SDK\r\n![version](https://img.shields.io/npm/v/mobile-web-capture.svg)\r\n![downloads](https://img.shields.io/npm/dm/mobile-web-capture.svg) \r\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/mobile-web-capture.svg)\r\n![](https://img.shields.io/snyk/vulnerabilities/npm/mobile-web-capture.svg)\r\n\r\n[Dynamic Web TWAIN Mobile Web Capture SDK](https://www.dynamsoft.com/web-twain/features/mobile-web-capture-sdk/) is a web document capture SDK for iOS and Android browsers. It is designed for developers to build document scanning web applications for mobile users to load, edit, save, upload files, and capture images from the camera right in mobile browsers.\r\n\r\nTo see it in action, please visit **[this online demo](https://demo.dynamsoft.com/web-twain/mobile-online-camera-scanner/)**.\r\n\r\nNote: Dynamic Web TWAIN SDK **v18.0** is built in this package. \r\n\r\n## Table of Contents\r\n- [Supported Environments](#supported-environments)\r\n- [License Key](#license-key)\r\n- [Installation](#installation)\r\n- [Deployment](#deployment)\r\n- [Quick Start](#quick-start)\r\n- [Documentation](#documentation)\r\n- [Features](#features)\r\n- [Contact Us](#contact-us)\r\n- [License Agreement](#license-agreement)\r\n\r\n## Supported Environments\r\n\r\n### Supported Mobile Web Browsers\r\n\r\n- Chrome\r\n- Edge\r\n- Safari\r\n\r\n### Supported OSs\r\n\r\n- Android \r\n- iOS\r\n\r\n\r\n## License Key\r\n[![](https://img.shields.io/badge/Get-30--day%20FREE%20Trial%20License-blue)](https://www.dynamsoft.com/customer/license/trialLicense/?product=dwt)\r\n\r\n## Installation\r\n\r\n- Packages from the official website\r\n\t\r\n    **Dynamic Web TWAIN SDK**\r\n    \r\n    [![](https://img.shields.io/badge/Download-Offline%20SDK-orange)](https://www.dynamsoft.com/web-twain/downloads)\r\n\r\n- NPM\r\n\r\n    ```bash\r\n    npm install mobile-web-capture\r\n    ```\r\n\r\n## Deployment\r\n\r\nDynamic Web TWAIN relies on the files in the `/dist/` folder to work. Make sure to put these files on your server and correctly refer to them by specifying the path with `ResourcesPath` (relative and absolute paths are both okay).\r\n\r\n## Quick Start\r\n\r\n### Step 1. Create an HTML page and load **`dynamsoft.webtwain.min.js`** into your page:\r\n\r\n   ```html\r\n<!DOCTYPE html>\r\n<html>\r\n<head>\r\n\t<title>Hello World</title>\r\n\t<script src=\"dist/dynamsoft.webtwain.min.js\"></script>\r\n</head>\r\n<body>\r\n</body>\r\n</html>\r\n   ```\r\n\r\n   > Note that a **relative path** is used. You might want to change it based on where you are putting your code. The best practice is to put all the files on your own server and under the same domain as your web application.\r\n\r\n### Step 2. Add a script tag and make initial settings:\r\n\r\n   ```html\r\n<!DOCTYPE html>\r\n<html>\r\n<head>\r\n\t<title>Hello World</title>\r\n\t<script src=\"dist/dynamsoft.webtwain.min.js\"></script>\r\n</head>\r\n<body>\r\n\t<script type=\"text/javascript\">\r\n\t  //Dynamsoft.DWT.ProductKey = \"YOUR-PRODUCT-KEY\";  // Put your own key here\r\n\t  Dynamsoft.DWT.ResourcesPath = \"dist\";\r\n      Dynamsoft.DWT.Containers = [{ ContainerId: 'dwtcontrolContainer', Width: 270, Height: 350 }];\r\n      Dynamsoft.DWT.UseLocalService = false;\r\n\t</script>\r\n</body>\r\n</html>\r\n   ```\r\n\r\n> Note that `ResourcesPath`  must be set in order to use the library. \r\n\r\n   1. `ResourcesPath` is a relative path to where you put the directory \"/dist/\" and all the files in it.\r\n   2. If you don't have a valid `ProductKey`, you can [request a trial key](https://www.dynamsoft.com/customer/license/trialLicense?product=dwt) to use.\r\n   3. To better use the mobile web capture, the `UseLocalService` must be set to false.\r\n\r\n\r\n### Step 3. Write code to use the package to do a simple document scan\r\n\r\n> The following code demonstrates the minimum code needed to use the package. Note the addition of HTML elements as well as JavaScript code. For more sophisticated sample or demo, check out our [Github Repositories](https://github.com/dynamsoft-dwt).\r\n\r\n   ```html\r\n<!DOCTYPE html>\r\n<html>\r\n<head>\r\n\t<title>Hello World</title>\r\n\t<script src=\"dist/dynamsoft.webtwain.min.js\"></script>\r\n</head>\r\n<body>\r\n\t<input type=\"button\" value=\"Scan\" onclick=\"ScanDocument();\" />\r\n\t<div id=\"dwtcontrolContainer\"></div>\r\n\t<script type=\"text/javascript\">\r\n\t  //Dynamsoft.DWT.ProductKey = \"YOUR-PRODUCT-KEY\";  // Put your own key here\r\n\t  Dynamsoft.DWT.ResourcesPath = \"dist\";\r\n      Dynamsoft.DWT.Containers = [{ ContainerId: 'dwtcontrolContainer', Width: 370, Height: 450 }];\r\n      Dynamsoft.DWT.UseLocalService = false;\r\n\t  window.onload = function () {\r\n\t    Dynamsoft.DWT.Load();\r\n\t  };\r\n\t  var DWObject;\r\n\t  function Dynamsoft_OnReady() {\r\n\t    // dwtcontrolContainer is the id of the DIV to create the WebTwain instance in.\r\n\t    DWObject = Dynamsoft.DWT.GetWebTwain('dwtcontrolContainer');\r\n\t  }\r\n\t  function ScanDocument() {\r\n\t    var showVideoConfigs = {\r\n          scannerViewer:{\r\n\t        autoDetect:{\r\n\t          enableAutoDetect: true\r\n\t        }\r\n          }\r\n\t    };\r\n\t    if (DWObject) {\r\n          if(!DWObject.UseLocalService) {\r\n\t        DWObject.Addon.Camera.scanDocument(showVideoConfigs).then(\r\n\t          function(){\r\n\t            console.log(\"Successful!\");\r\n\t          }, function (error) { \r\n\t            alert(error.message); \r\n\t          }); \r\n          }\r\n\t    }\r\n\t  }\r\n\t</script>\r\n</body>\r\n</html>\r\n   ```\r\n### Step 4. Configure the Server\r\n- Set the MIME type for .wasm as application/wasm on your webserver.\r\n\r\n\tThe goal is to configure your server to send the correct Content-Type header for the wasm file so that it is processed correctly by the browser.\r\n\r\n\tDifferent types of webservers are configured differently, for example:\r\n\r\n\t* Apache\r\n\t* IIS\r\n\t* NGINX\r\n\r\n- Enable HTTPS\r\n\r\n\tTo use the library, you must access your website / web application via a secure HTTPS connection. This is due to browser security restrictions which only grant camera video streaming access to a secure context.\r\n\r\n> For convenience, self-signed certificates can be used during development and testing.\r\n\r\n## Documentation\r\n\r\n* [Developer's Guide](https://www.dynamsoft.com/web-twain/docs/about/index.html)\r\n* [API Reference](https://www.dynamsoft.com/web-twain/docs/info/api/index.html)\r\n* [Github Repositories](https://github.com/dynamsoft-dwt/)\r\n\r\n## Features\r\n\r\n| Features                           | Mobile             |\r\n| ---------------------------------- | ------------------:|\r\n| Document capture                   | :heavy_check_mark: |\r\n| Document edge detection            | :heavy_check_mark: |\r\n| Document perspective correction    | :heavy_check_mark: |\r\n| Document post-processing by filters| :heavy_check_mark: |\r\n| Front and rear camera switching    | :heavy_check_mark: |\r\n| Dedicated image and PDF viewer     | :heavy_check_mark: |\r\n| Built-in ready-to-use UI           | :heavy_check_mark: |\r\n| SIMD and WebGL acceleration        | :heavy_check_mark: |\r\n| Multi-Format export and sharing    | :heavy_check_mark: |\r\n\r\n[More](https://www.dynamsoft.com/web-twain/features/mobile-web-capture-sdk/)\r\n\r\n## Contact Us\r\n\r\n[Contact Dynamsoft](https://www.dynamsoft.com/company/contact/) to resolve any issue you encounter with the library.\r\n\r\n## License Agreement\r\n\r\n<https://www.dynamsoft.com/Products/WebTWAIN_License.aspx>\r\n\r\n## Changelog\r\n\r\nCheck out the [release notes](https://www.dynamsoft.com/web-twain/docs/info/schedule/stable.html?product=dwt&utm_source=npm) of the Dynamic Web TWAIN library."},"npm":{"downloads":[{"from":"2022-12-22T00:00:00.000Z","to":"2022-12-23T00:00:00.000Z","count":0},{"from":"2022-12-16T00:00:00.000Z","to":"2022-12-23T00:00:00.000Z","count":7},{"from":"2022-11-23T00:00:00.000Z","to":"2022-12-23T00:00:00.000Z","count":28},{"from":"2022-09-24T00:00:00.000Z","to":"2022-12-23T00:00:00.000Z","count":155},{"from":"2022-06-26T00:00:00.000Z","to":"2022-12-23T00:00:00.000Z","count":425},{"from":"2021-12-23T00:00:00.000Z","to":"2022-12-23T00:00:00.000Z","count":576}],"starsCount":0},"source":{"files":{"readmeSize":7356,"testsSize":0},"badges":[{"urls":{"original":"https://img.shields.io/npm/v/mobile-web-capture.svg","shields":"https://img.shields.io/npm/v/mobile-web-capture.svg","content":"https://img.shields.io/npm/v/mobile-web-capture.json"},"info":{"service":"npm","type":"version","modifiers":{"type":"v"}}},{"urls":{"original":"https://img.shields.io/npm/dm/mobile-web-capture.svg","shields":"https://img.shields.io/npm/dm/mobile-web-capture.svg","content":"https://img.shields.io/npm/dm/mobile-web-capture.json"},"info":{"service":"npm","type":"downloads","modifiers":{"type":"dm"}}}],"outdatedDependencies":{"dynamsoft-javascript-barcode":{"required":"9.2.13","stable":"9.6.1","latest":"9.6.1"}}}},"evaluation":{"quality":{"carefulness":0.46,"tests":0,"health":0.75,"branding":0.3},"popularity":{"communityInterest":0,"downloadsCount":51.666666666666664,"downloadsAcceleration":0.03457001522070019,"dependentsCount":0},"maintenance":{"releasesFrequency":1,"commitsFrequency":0,"openIssues":0,"issuesDistribution":0}},"score":{"final":0.16305552232941528,"detail":{"quality":0.5435184077647176,"popularity":0,"maintenance":0}}}