ScanDeviceManager CreateScanDocument
Creates an instance of ScanDocument binded with the given device.
Overloads
public ScanDocument CreateScanDocument(string deviceUniqueName, DistanceUnit distanceUnits, bool keepScanShapes) |
public ScanDocument CreateScanDocument(string deviceUniqueName, byte[] storedDocumentData, bool keepScanShapes) |
public ScanDocument CreateScanDocument(string deviceUniqueName, byte[] storedDocumentData) |
public ScanDocument CreateScanDocument(string deviceUniqueName, DistanceUnit distanceUnits) |
Return value
ScanDocument | Instance of a ScanDocument attached to the given device |
Parameters
string | deviceUniqueName | The unique name of the device. |
DistanceUnit | distanceUnits | Units to use with laser marking |
bool | keepScanShapes | Keep shapes in editable form for future changes |
byte[] | storedDocumentData | A stream of serialized document data feed to create the document. |
Note: The ScanDocument will convert all the shapes to suit the marking environment as they get added to the document automatically. If the keepScanShapes parameter set to TRUE, the ScanDocument will keep an extra copy of the shapes in editable form for future changes. This operation may increase the size of the ScanDocument due to the extra space reserved for the editable shapes.
The storedDocumentData can be from a device specific job file, device independent job file OR ScanMaster Designer generated job file. Depending on the type of the file the resulting ScanDocument DataType wil be changed.
Exceptions
DeviceNotFoundException | Throws when the device with the given name is not found |
DeviceAlreadyInUseException | Throws when the device is already connected to another client |
Example
try
{
scanDocument = scanDeviceManager.CreateScanDocument(DeviceUniqueName, DistanceUnit.Millimeters, false);
}
catch (DeviceNotFoundException)
{
MessageBox.Show("Device could not be found", "Custom Canvas");
}
catch (DeviceAlreadyInUseException)
{
MessageBox.Show("Device already in use", "Custom Canvas");
}