Table of Contents

Class ScanServer

Namespace
NAPS2.Remoting.Server
Assembly
NAPS2.Sdk.dll

Allows scanning devices to be shared across the network. Clients can connect by using Driver.Escl when scanning.

public class ScanServer : IDisposable
Inheritance
ScanServer
Implements
Inherited Members

Constructors

ScanServer(ScanningContext, IEsclServer)

public ScanServer(ScanningContext scanningContext, IEsclServer esclServer)

Parameters

scanningContext ScanningContext
esclServer IEsclServer

Properties

Certificate

The certificate to be used for TLS connections to the server. If not specified, a self-signed certificate will be generated when the server starts (unless prevented by the security policy).

public X509Certificate2? Certificate { get; set; }

Property Value

X509Certificate2

InstanceId

A unique ID that is used to help derive the UUIDs for shared scanners. If you expect to have multiple shared scanners with the same name/model on the same network it may be useful to set this to a unique value.

public Guid InstanceId { get; set; }

Property Value

Guid

SecurityPolicy

The security policy to use for the ESCL server.

public EsclSecurityPolicy SecurityPolicy { get; set; }

Property Value

EsclSecurityPolicy

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

RegisterDevice(ScanDevice, string?, int, int)

public void RegisterDevice(ScanDevice device, string? displayName = null, int port = 0, int tlsPort = 0)

Parameters

device ScanDevice
displayName string
port int
tlsPort int

SetDefaultIcon(IMemoryImage)

public void SetDefaultIcon(IMemoryImage icon)

Parameters

icon IMemoryImage

SetDefaultIcon(byte[])

public void SetDefaultIcon(byte[] iconPng)

Parameters

iconPng byte[]

Start()

public Task Start()

Returns

Task

Stop()

public Task Stop()

Returns

Task

UnregisterDevice(ScanDevice, string?)

public void UnregisterDevice(ScanDevice device, string? displayName = null)

Parameters

device ScanDevice
displayName string