Overview
LoadXMLSettings(file, silent)
LoadXMLSettings(file) (.Net Class Library)
Load settings from the specified XML file. This method can also be used to define sets of properties to be applied sequentially to an image until a barcode is located. It's also possible to specify properties that only apply to particular pages of an image. The silent parameter controls whether message message boxes will be displayed if there is a parsing error.
The simplest format for the xml is as follows:
<xml>
<SoftekBarcode>
<Properties>
<PropertyName>PropertyValue</PropertyName>
</Properties>
</SoftekBarcode>
</xml>
Example:
Set MedianFilter to 1 (True) and set ReadCode25 to 0 (False).
<xml>
<SoftekBarcode>
<Properties>
<MedianFilter>1</MedianFilter>
<ReadCode25>0</ReadCode25>
</Properties>
</SoftekBarcode>
</xml>
The xml file can also be used to apply sets of properties sequentially to an image until a barcode is found:
This example first applies default values to an image. If no barcode is found then a MedianFilter is applied.
<xml>
<SoftekBarcode>
<Properties>
</Properties>
<Properties>
<MedianFilter>1</MedianFilter>
</Properties>
</SoftekBarcode>
</xml>
This example restricts the search to the first 3 pages of an image, until a barcode is located:
<xml>
<SoftekBarcode>
<Properties>
<PageNo>1</PageNo>
</Properties>
<Properties>
<PageNo>2</PageNo>
</Properties>
<Properties>
<PageNo>3</PageNo>
</Properties>
</SoftekBarcode>
</xml>
The default set of properties is as follows:
<xml version='1.0' encoding='iso-8859-1'> <SoftekBarcode> <Properties> <AllowDuplicateValues>1</AllowDuplicateValues> <Code39Checksum>0</Code39Checksum> <Code39NeedStartStop>1</Code39NeedStartStop> <ColorThreshold>0</ColorThreshold> <ConvertUPCEToEAN13>1</ConvertUPCEToEAN13> <Despeckle>0</Despeckle> <ErrorCorrection>0</ErrorCorrection> <ExtendedCode39>0</ExtendedCode39> <LineJump>1</LineJump> <MaxLength>999</MaxLength> <MedianFilter>0</MedianFilter> <MinSeparation>180</MinSeparation> <MinLength>4</MinLength> <MinOccurrence>2</MinOccurrence> <MinSpaceBarWidth>0</MinSpaceBarWidth> <MultipleRead>0</MultipleRead> <NoiseReduction>0</NoiseReduction> <Pattern></Pattern> <PageNo>0</PageNo> <PrefOccurrence>5</PrefOccurrence> <QuietZoneSize>0</QuietZoneSize> <ReadCodabar>1</ReadCodabar> <ReadCode128>1</ReadCode128> <ReadCode25ni>0</ReadCode25ni> <ReadCode25>1</ReadCode25> <ReadCode39>1</ReadCode39> <ReadEAN13>1</ReadEAN13> <ReadNumeric>0</ReadNumeric> <ReadPatchCodes>0</ReadPatchCodes> <ReadPDF417>1</ReadPDF417> <ReadUPCA>0</ReadUPCA> <ReadUPCE>1</ReadUPCE> <ScanDirection>15</ScanDirection> <SkewTolerance>0</SkewTolerance> <ShowCheckDigit>0</ShowCheckDigit> <UseOverSampling>0</UseOverSampling> </Properties> </SoftekBarcode> </xml>
Return Value
1 on success and 0 on failure.
Visual Basic using the OCX
retval = [form.]SoftekBarcode.LoadXMLSettings(file, 0)
Visual Basic using the DLL
Private Declare Function stLoadXMLSettings Lib "SoftekBarcode" (ByVal strFile As String, ByVal silent as Boolean) As Integer
retval = stLoadXMLSettings(file, 0)
Visual Basic using COM
oBar = CreateObject("SoftekATL.Barcode")
.........
oBar.LoadXMLSettings(file, 0)
retval = oBar.XMLRetval
VB.Net using the DLL
Private Declare Function stLoadXMLSettings Lib "SoftekBarcode" (ByVal strFile As String, ByVal silent as Boolean) As Short
retval = stLoadXMLSettings(file, 0)
VB.Net using the SoftekBarcode Wrapper Class
Dim barcode As SoftekBarcode
..........
retval = barcode.LoadXMLSettings(file, 0)
VB.Net using the SoftekBarcodeLib Managed Component
Dim barcode As SoftekBarcodeLib.BarcodeReader
..........
barcode = New SoftekBarcodeLib.BarcodeReader()
..........
retval = barcode.LoadXMLSettings(file)
Visual C++ Using the OCX
short LoadXMLSettings(file, 0)
Visual C++ Using the DLL
short __stdcall stLoadXMLSettings(LPCTSTR file, unsigned char silent);



