←Select platform

BarcodeExceptionCode Enumeration

Summary

Identifies the barcode exception error code

Syntax

C#
VB
Java
Objective-C
WinRT C#
C++
[SerializableAttribute()] 
public enum BarcodeExceptionCode   
<SerializableAttribute()> 
Public Enum BarcodeExceptionCode  
    
    
[SerializableAttribute()] 
public enum BarcodeExceptionCode    
typedef NS_ENUM(NSInteger, LTBarcodeError) 
public enum BarcodeExceptionCode 
Leadtools.Barcode.BarcodeExceptionCode = function() { }; 
Leadtools.Barcode.BarcodeExceptionCode.prototype = { 
 
  InvalidXModule = -1481, 
    DllNotFound = -1382, 
    QrWriteLocked = -1381, 
    QrReadLocked = -1380, 
    MicroQrWriteLocked = -1375, 
    MicroQrReadLocked = -1374, 
    MaxiWriteLocked = -1373, 
    MaxiReadLocked = -1372, 
    AztecWriteLocked = -1371, 
    AztecReadLocked = -1370, 
    DatamatrixWriteLocked = -433, 
    DatamatrixReadLocked = -432, 
    PdfWriteLocked = -430, 
    PdfReadLocked = -429, 
    Barcode2dWriteLocked = -428, 
    Barcode2dReadLocked = -427, 
    Barcode1dLocked = -426, 
    InvalidBounds = -425, 
    InvalidStringLength = -424, 
    InvalidGroup = -420, 
    InvalidMaximumCount = -419, 
    InvalidUnits = -418, 
    InvalidBarcodeString = -416, 
    ToSmall = -415, 
    InvalidHeight = -414, 
    InvalidWidth = -413, 
    InvalidTextOut = -412, 
    InvalidType = -411, 
     
 }; 
[SerializableAttribute()] 
public enum class BarcodeExceptionCode   

Members

ValueMemberDescription
-1481InvalidXModule

Barcode Module size should be greater or equal to 0.

-1382DllNotFound

Barcode Engine assembly not found.

-1381QrWriteLocked

Barcode Write QR is locked.

-1380QrReadLocked

Barcode Read QR is locked.

-1375MicroQrWriteLocked

Barcode Write Micro QR is locked

-1374MicroQrReadLocked

Barcode Read Micro QR is locked

-1373MaxiWriteLocked

Barcode Write Maxi is locked

-1372MaxiReadLocked

Barcode Read Maxi is locked

-1371AztecWriteLocked

Barcode Write Aztec is locked

-1370AztecReadLocked

Barcode Read Aztec is locked.

-433DatamatrixWriteLocked

Barcode Write Datamatrix is locked.

-432DatamatrixReadLocked

Barcode Read Datamatrix is locked.

-430PdfWriteLocked

Barcode Write PDF is locked.

-429PdfReadLocked

Barcode Read PDF is locked.

-428Barcode2dWriteLocked

Barcode Write 2D is locked.

-427Barcode2dReadLocked

Barcode Read 2D is locked.

-426Barcode1dLocked

Barcode 1D is locked.

-425InvalidBounds

Invalid barcode bounds.

-424InvalidStringLength

Invalid barcode data string length.

-420InvalidGroup

Invalid barcode group.

-419InvalidMaximumCount

Invalid maximum count.

-418InvalidUnits

Invalid barcode measurement unit.

-416InvalidBarcodeString

Invalid barcode string for a specified barcode symbology.

-415ToSmall

Barcode string is too small.

-414InvalidHeight

Invalid barcode height.

-413InvalidWidth

Invalid barcode width.

-412InvalidTextOut

Invalid barcode text out option.

-411InvalidType

Invalid barcode symbology.

Remarks

Used as the type of the BarcodeException.Code property which can be used to get extra details about the LEADTOOLS barcode exception being thrown.

Example

C#
VB
Silverlight C#
Silverlight VB
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.Forms; 
using Leadtools.Barcode; 
using Leadtools.ImageProcessing; 
 
public void BarcodeExceptionCode_Example() 
{ 
   // Example of values passed by the user for the barcode width and height 
   int barcodeWidth = 30; 
   int barcodeHeight = 60; 
 
   // These values are too small to write a UPCA barcode and will throw an exception below 
 
   // Create a Barcode engine 
   BarcodeEngine engine = new BarcodeEngine(); 
 
   // Get the Barcode writer 
   BarcodeWriter writer = engine.Writer; 
 
   // Create an image 
   using (RasterImage image = RasterImage.Create(1000, 1000, 1, 300, RasterColor.FromKnownColor(RasterKnownColor.White))) 
   { 
      // Create the barcode 
      BarcodeData barcode = BarcodeData.CreateDefaultBarcodeData(BarcodeSymbology.UPCA); 
      barcode.Bounds = new LogicalRectangle(0, 0, barcodeWidth, barcodeHeight, LogicalUnit.Pixel); 
 
      // Try to write it, this will throw an exception if the barcode is too smalle 
      try 
      { 
         writer.WriteBarcode(image, barcode, null); 
      } 
      catch (BarcodeException ex) 
      { 
         // Show the error message, should be BarcodeExceptionCode.InvalidWidth 
         Console.WriteLine(ex.Code); 
         Debug.Assert(ex.Code == BarcodeExceptionCode.InvalidWidth); 
      } 
   } 
} 
Imports Leadtools 
Imports Leadtools.Codecs 
Imports Leadtools.Forms 
Imports Leadtools.Barcode 
Imports Leadtools.ImageProcessing 
 
Public Sub BarcodeExceptionCode_Example() 
   ' Example of values passed by the user for the barcode width and height 
   Dim barcodeWidth As Integer = 30 
   Dim barcodeHeight As Integer = 60 
 
   ' These values are too small to write a UPCA barcode and will throw an exception below 
 
   ' Create a Barcode engine 
   Dim engine As New BarcodeEngine() 
 
   ' Get the Barcode writer 
   Dim writer As BarcodeWriter = engine.Writer 
 
   ' Create an image 
   Using image As RasterImage = RasterImage.Create(1000, 1000, 1, 300, RasterColor.FromKnownColor(RasterKnownColor.White)) 
      ' Create the barcode 
      Dim barcode As BarcodeData = BarcodeData.CreateDefaultBarcodeData(BarcodeSymbology.UPCA) 
      barcode.Bounds = New LogicalRectangle(0, 0, barcodeWidth, barcodeHeight, LogicalUnit.Pixel) 
 
      ' Try to write it, this will throw an exception if the barcode is too smalle 
      Try 
         writer.WriteBarcode(image, barcode, Nothing) 
      Catch ex As BarcodeException 
         ' Show the error message, should be BarcodeExceptionCode.InvalidWidth 
         Console.WriteLine(ex.Code) 
         Debug.Assert(ex.Code = BarcodeExceptionCode.InvalidWidth) 
      End Try 
   End Using 
End Sub 
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.Forms; 
using Leadtools.Barcode; 
using Leadtools.ImageProcessing; 
 
public void BarcodeExceptionCode_Example() 
{ 
   // Example of values passed by the user for the barcode width and height 
   int barcodeWidth = 30; 
   int barcodeHeight = 60; 
 
   // These values are too small to write a UPCA barcode and will throw an exception below 
 
   // Create a Barcode engine 
   BarcodeEngine engine = new BarcodeEngine(); 
 
   // Get the Barcode writer 
   BarcodeWriter writer = engine.Writer; 
 
   // Create an image 
   using (RasterImage image = RasterImage.Create(1000, 1000, 1, 300, RasterColor.FromKnownColor(RasterKnownColor.White))) 
   { 
      // Create the barcode 
      BarcodeData barcode = BarcodeData.CreateDefaultBarcodeData(BarcodeSymbology.UPCA); 
      barcode.Bounds = new LogicalRectangle(0, 0, barcodeWidth, barcodeHeight, LogicalUnit.Pixel); 
 
      // Try to write it, this will throw an exception if the barcode is too smalle 
      try 
      { 
         writer.WriteBarcode(image, barcode, null); 
      } 
      catch (BarcodeException ex) 
      { 
         // Show the error message, should be BarcodeExceptionCode.InvalidWidth 
         Console.WriteLine(ex.Code); 
         Debug.Assert(ex.Code == BarcodeExceptionCode.InvalidWidth); 
      } 
   } 
} 
Imports Leadtools 
Imports Leadtools.Codecs 
Imports Leadtools.Forms 
Imports Leadtools.Barcode 
Imports Leadtools.ImageProcessing 
 
Public Sub BarcodeExceptionCode_Example() 
   ' Example of values passed by the user for the barcode width and height 
   Dim barcodeWidth As Integer = 30 
   Dim barcodeHeight As Integer = 60 
 
   ' These values are too small to write a UPCA barcode and will throw an exception below 
 
   ' Create a Barcode engine 
   Dim engine As BarcodeEngine = New BarcodeEngine() 
 
   ' Get the Barcode writer 
   Dim writer As BarcodeWriter = engine.Writer 
 
   ' Create an image 
   Using image As RasterImage = RasterImage.Create(1000, 1000, 1, 300, RasterColor.FromKnownColor(RasterKnownColor.White)) 
      ' Create the barcode 
      Dim barcode As BarcodeData = BarcodeData.CreateDefaultBarcodeData(BarcodeSymbology.UPCA) 
      barcode.Bounds = New LogicalRectangle(0, 0, barcodeWidth, barcodeHeight, LogicalUnit.Pixel) 
 
      ' Try to write it, this will throw an exception if the barcode is too smalle 
      Try 
         writer.WriteBarcode(image, barcode, Nothing) 
      Catch ex As BarcodeException 
         ' Show the error message, should be BarcodeExceptionCode.InvalidWidth 
         Console.WriteLine(ex.Code) 
         Debug.Assert(ex.Code = BarcodeExceptionCode.InvalidWidth) 
      End Try 
   End Using 
End Sub 

Requirements

Target Platforms

See Also

Reference

Leadtools.Barcode Namespace

Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
Leadtools.Barcode Assembly
Click or drag to resize