npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@docutain/capacitor-plugin-docutain-sdk

v7.0.0

Published

Capacitor plugin of the Docutain Document Scanner SDK for Android and iOS. High quality document scanning, data extraction, text recognition and PDF creation for your apps. Easily scan documents in your app.

Readme

Docutain SDK for Capacitor

Preview

What is Docutain SDK?

The Docutain SDK brings functionalities for automatic document scanning, data capture, image processing, OCR text recognition, intelligent data extraction, PDF creation and photo payment to your apps.

It works 100% offline, which ensures maximum data safety.

It contains individually licensable modules:

For more details visit our website https://sdk.Docutain.com

If you like to test the functionality without writing any lines of code, check out our Showcase Apps.

Plugin Versions

| Capacitor version | Plugin version | |-------------------|----------------| | 7.x | 7.x | | 6.x | 6.x | | 5.x | 1.x |

Usage

The following shows a minimum example to use the document scanner. For all available features and theming possibilities, please check out our documentation.

Initialize

In order to use any functionality of the SDK, you must initialize it first.

try{
    await DocutainSDK.initSDK({licenseKey: "<YOUR-LICENSE-KEY>"})
} catch (error) {
    //init of Docutain SDK failed, get the last error message
    console.error(error);
    //your logic to deactivate access to SDK functionality
}

For testing purposes, you can leave the license key empty. However, the SDK will stop working after 1 minute. You can get a free extended trial license on our website.

Start the scanner to scan documents

On iOS, make sure to add a camera usage description in the Info.plist. If you don't, the app will crash.

NSCameraUsageDescription - "In order to scan documents, you need to grant permission to access the camera."

To start the document scanner, you only have to call DocutainSDK.startDocumentScanner and wait for it to return.

Check out the documentation for possible scan configurations.

try{
    await DocutainSDK.startDocumentScanner({
        //customize the scanner config according to your needs
    });
} catch (error) {
    if ((error as { code?: string })?.code === 'CANCELED') {
        //user canceled scan process
        console.log(`user canceled`);
    } else {
        console.error(error);
    }
}

Generate a PDF document

Once the user finished the scan, you can generate a PDF document out of the scanned pages. The PDF document will include the recognized text, making it searchable and selectable.

Check out the documentation for more details.

try{    
    const pdfUri = (await DocutainSDK.writePDF({
        fileUri: destinationUri,
        overWrite: true,
    })).fileUri 
} catch (error) {
    console.error(error);
}  

Image Export

It is also possible to get the scanned pages as single image files.

Check out the documentation for more details.

try{
    const pageCount = (await DocutainSDK.pageCount()).count;
    for(let i = 1; i <= pageCount; i++){
        const imageUri = (await DocutainSDK.writeImage({
            pageNumber: i,
            fileUri: destinationUri
        })).fileUri
    }
}catch (error) {
    console.error(error);
} 

Text Recognition

With a single line of code, you can get the recognized text of the scanned document or single pages.

Check out the documentation for more details.

try{
    const text = (await DocutainSDK.getText()).text
}catch (error) {
    console.error(error);
} 

Data Extraction

It is also possible to run data extraction on the scans to extract certain values, like Address, Amount, IBAN, Date and more.

Check out the documentation for more details.

try{
    const analyzeData = (await DocutainSDK.analyze()).data;
}catch (error) {
    console.error(error);
} 

Photo Payment

Integrate Photo Payment into your banking app within minutes with just a few lines of code. It works 100% offline on device. No data at all is transfered to any external server or cloud service, ensuring 100% data protection.

Check out the documentation for more details.

try{
    const result = await DocutainSDK.startPhotoPayment({
        //customize the photo payment process according to your needs
    });
    if(result.data !== ""){
        //payment information has been extracted
        //result.data is a JSON string containing the information
        //extract the fields you need and pass it on to your payment sheet
    } else{
        //no data was extracted at all
        //Note: this case is only reachable, if you disabled the Empty Result Screen
    }
} catch (error) {
    if ((error as { code?: string })?.code === 'CANCELED') {
        //user canceled scan process
        console.log(`user canceled`);
    } else {
        console.error(error);
    }
}    

Documentation of the Docutain SDK

The documentation includes everything you need to know to integrate the Docutain SDK into your Capacitor application. If you prefer sample projects over documentation, check out our Docutain SDK Capacitor sample app on Github.

Changelog

All changes included in each version can be found here: Changelog

License and Support

The Docutain SDK is a commercial product and requires a paid license for production use. In order to get a trial license, please visit our website via https://sdk.docutain.com/TrialLicense to generate a trial license key.

If you need technical support of any kind, please contact us via [email protected].