How to implement Dynamic .NET TWAIN DLL in class library?

This page in versions:

The license authentication mechanism of Dynamic .NET TWAIN 3.x or older doesn't allow you to implement the component in a class library.You will get license error if you try to do so.
To meet our customers' requirements, an internal version of Dynamic .NET TWAIN which supports the above feature is now available!

Below please find the steps to make it work:

1. Get the FULL internal version of DynamicDotNetTWAIN.dll from Dynamsoft support team (support[at]dynamsoft.com) if you are using v3.x.

2. Remove the old DLL and add the new one as Reference in your solution.
add reference

3. Check if there is a licenses.licx file under Properties folder. If so, please remove it.

4. Add the Dynamic .NET TWAIN license in your code, and customize the location and size of the control in the form.

Below please find a C# example:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace NETTWAIN_Test_2011_12_31
{
    public partial class Form1 : Form
    {
        private Dynamsoft.DotNet.TWAIN.DynamicDotNetTwain twain = new Dynamsoft.DotNet.TWAIN.DynamicDotNetTwain("1C007F1253C878A72E36FF6BFC47F6F9");

        // Please input your Dynamic .NET TWAIN license, here "1C007F1253C878A72E36FF6BFC47F6F9" is a trial license which is good through Jan. 30th, 2012

        public Form1()
        {
            InitializeComponent();

            // Specify the location and the size of Dynamic .NET TWAIN control

            this.twain.Location = new System.Drawing.Point(45, 23);
            this.twain.Size = new System.Drawing.Size(150, 150);
            this.Controls.Add(twain);
        }

        private void button1_Click(object sender, EventArgs e)  // scan an image
        {
            twain.SelectSource();
            twain.OpenSource();
            twain.Resolution = 100;
            twain.IfShowUI = false;
            twain.IfFeederEnabled = false;
            twain.AcquireImage();
        }
    }
}

5. This way, you can implement Dynamic .NET TWAIN in your class library without having any license issue.

For any questions, please contact support[at]dynamsoft.com.

1. Check if there is a licenses.licx file under Properties folder. If so, please remove it.

2. Add the Dynamic .NET TWAIN license in your code, and customize the location and size of the control in the form.
Below please find a C# example:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace NETTWAIN_Test_2011_12_31
{
    public partial class Form1 : Form
    {
        private Dynamsoft.DotNet.TWAIN.DynamicDotNetTwain twain = new Dynamsoft.DotNet.TWAIN.DynamicDotNetTwain("1C007F1253C878A72E36FF6BFC47F6F9");

        // Please input your Dynamic .NET TWAIN license, here "1C007F1253C878A72E36FF6BFC47F6F9" is a trial license which is good through Jan. 30th, 2012

        public Form1()
        {
            InitializeComponent();

            // Specify the location and the size of Dynamic .NET TWAIN control

            this.twain.Location = new System.Drawing.Point(45, 23);
            this.twain.Size = new System.Drawing.Size(150, 150);
            this.Controls.Add(twain);
        }

        private void button1_Click(object sender, EventArgs e)  // scan an image
        {
            twain.SelectSource();
            twain.OpenSource();
            twain.Resolution = 100;
            twain.IfShowUI = false;
            twain.IfFeederEnabled = false;
            twain.AcquireImage();
        }
    }
}

3. This way, you can implement Dynamic .NET TWAIN in your class library without having any license issue.
For any questions, please contact support@dynamsoft.com.

Is this page helpful?

Leave a Reply

Your email address will not be published.