Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@anyline/anyline-js

Package Overview
Dependencies
Maintainers
5
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@anyline/anyline-js

anyline sdk in the browser

  • 29.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
463
decreased by-11.98%
Maintainers
5
Weekly downloads
 
Created
Source

AnylineJS

Anyline is a mobile OCR SDK, which can be customized to scan all kinds of numbers, characters, text and codes.

AnylineJS is a standalone Anyline version for the browser.

Not included in the bundle are the Example Sheets with testing material. They can be downloaded here: https://anyline.com/samples

In its inital version the UI is hard wired into the SDK. Using custom user interfaces will be supported in the coming releases. AnylineJS has to be served from a web server that supports HTTPS. (Don't forget to add 'https://' if you are testing AnylineJS).

For full documentation visit: https://documentation.anyline.com/toc/platforms/javascript/index.html

The license included in the AnylineJS Repository only allows AnylineJS to run on 127.0.0.1

Install

copy the anylinejs folder into the public folder of your webapp.

import anyline.js via the script tag into your html

Usage

const { init, errorCodes } = window.anylinejs;

const viewConfig = {
  outerColor: '000000',
  outerAlpha: 0.5,
  cutouts: [
    {
      cutoutConfig: {
        maxWidthPercent: '80%',
        alignment: 'top_half',
        ratioFromSize: {
          width: 300,
          height: 250,
        },
        width: 720,
        strokeWidth: 2,
        cornerRadius: 4,
        strokeColor: 'FFFFFFFF',
        feedbackStrokeColor: '0099FF',
      },
      scanFeedback: {
        style: 'contour_point',
        strokeColor: '0099FF',
        fillColor: '300099FF',
        strokeWidth: 2,
        cornerRadius: 4,
        animationDuration: 150,
        animation: 'NONE',
      },
    },
  ],
};


const root = document.getElementById('root');

const Anyline = init({
  preset: 'meter', // or id, ocr, eCard, ...
  viewConfig,
  license: anylicense,
  element: root,
  anylinePath: '../anylinejs',
});

Anyline.onResult = result => {
  console.log('Result: ', result);
  let msg = JSON.stringify(result.result);
  alert(msg);
};

Anyline.onError = ({ code, message }) => {
  if (code === errorCodes.WEBCAM_ERROR) {
    console.error('webcam error: ', message);
  }
  //....
};

Anyline.onLoad = () => {
  console.log('ANYLINE LOADED on main thread');
};

Anyline.startScanning().catch(e => console.error(e.message))

Demo

npm start demo

open https://127.0.0.1:8000/demo

Keywords

FAQs

Package last updated on 19 Mar 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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc