Socket
Book a DemoInstallSign in
Socket

adf-plugin-hwsheet

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

adf-plugin-hwsheet

Recognizing Hand-Written charactors and apply to Defined Field.

1.0.0
latest
npmnpm
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

ADF HWSheet Plugin

スマートデバイスの画面にユーザーが筆記した文字を認識し、データとして画面上に反映する機能を提供します。

導入方法

cordova plugin add adf-plugin-hwsheet

対応OS

  • Android
  • iOS
  • Windows

使用例

index.html

<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>

<body>
    <div id="hw-sheet-parent" style="width:800px;height:450px"></div>
    <script type='text/javascript' src='cordova.js'></script>
    <script type='text/javascript' src='index.js'></script>
</body>

</html>

index.js

document.addEventListener('deviceready', function () {
    var hwSheetDivElement = document.getElementById('hw-sheet-parent');
    readBackgroundImage('img/bgImage.png', function (backgroundImageElement) {
        var xhr = new XMLHttpRequest();
        xhr.open('get', 'json/hw_sheet.conf', true);
        xhr.send();
        xhr.onload = function () {
            // レイアウト定義ファイルに記載されたJSONをオブジェクト化
            var hwSheetConf = JSON.parse(xhr.responseText);
            // 文字認識エンジンの初期化
            HWSheet.Engine.init(function () {
                // ライブラリの初期化
                hw = new HWSheet(hwSheetDivElement, backgroundImageElement, hwSheetConf);
                window.addEventListener('resize', function () {
                    hw.resize();
                });
            }, error);
        };
    });

    function error(msg) {
        console.log(msg);
    }
});

function readBackgroundImage(imageUrl, successCallback, errorCallback) {
    'use strict';
    var image = new Image();

    image.onload = function () {
        successCallback(image);
    };
    image.onerror = function () {
        errorCallback('Image file "' + imageUrl + '" is not found.');
    };
    image.src = imageUrl;
}

json/hw_sheet.conf

{
    "layout": {
        "Field1": {
            "top": 50,
            "bottom": 100,
            "left": 50,
            "right": 250,
            "fieldType": "text",
            "recognizeType": "text_all",
            "maxChar": 10
        }
    }
}

FAQs

Package last updated on 18 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.