Initialization

This page covers the description of the initialization process

The DocumentReader initialization works fully offline. It simply use license file, which you can get here: licensing.regulaforensics.com. You should add the regula.license file to your project.

Xamarin.Android
Xamarin.iOS
Xamarin.Android
public class MainActivity : DocumentReader.IDocumentReaderInitCompletion
{
protected void initReader()
{
var bytes = default(byte[]);
using (var streamReader = new StreamReader(Assets.Open("regula.license")))
{
using (var memstream = new MemoryStream())
{
streamReader.BaseStream.CopyTo(memstream);
bytes = memstream.ToArray();
}
}
DocumentReader.Instance().InitializeReader(this, bytes, this);
}
public void OnInitCompleted(bool success, string error)
{
if (success)
{
// initialization successful
}
else
{
// initialization was not successful
}
}
}
Xamarin.iOS
public partial class ViewController : UIViewController
{
void InitializationReader()
{
// license initialization
var licenseData = NSData.FromFile(NSBundle.MainBundle.PathForResource("regula.license", null));
if (licenseData == null)
{
return;
}
}
void DocReaderInitCompleted(bool successful, string error)
{
if (successfull)
{
// initialization successful
}
else
{
// initialization was not successful
}
}
}