Web services for barcode generation and recognition
In This Topic
Depending on application architecture the web service, which generates and recognizes barcodes, can be based on Web API controller or HTTP handler.
SDK provides the following ready-to-use web services:
- Vintasoft.Barcode.AspNetCore.ApiControllers.VintasoftBarcodeApiController class, from Vintasoft.Barcode.AspNetCore.ApiControllers.dll assembly, allows to create ASP.NET Core Web API controller for barcode generation and recognition.
- Vintasoft.Barcode.Web.Api2Controllers.VintasoftBarcodeApi2Controller class, from Vintasoft.Barcode.Web.Api2Controllers.dll assembly, allows to create ASP.NET Web API 2 controller for barcode generation and recognition.
- Vintasoft.Barcode.Web.HttpHandlers.VintasoftBarcodeHandler class, from Vintasoft.Barcode.Web.HttpHandlers.dll assembly, allows to create ASP.NET HTTP handler for barcode generation and recognition.
Each web service provides:
- ReadBarcodes method - allows to recognize barcodes from web image (image file or PDF document, which is stored on server).
- ReadBarcodesFromBase64 method - allows to recognize barcodes from image that is represented by a Base64-string.
- GetBarcodeAsBase64Image method - generates a barcode image and returns barcode image as a Base64-string.
Important: Vintasoft.Barcode.dll, Vintasoft.Shared.dll and Vintasoft.Shared.Web.dll assemblies are necessary for correct work of Vintasoft.Barcode.AspNetCore.ApiContoller.dll,Vintasoft.Barcode.Web.Api2Contoller.dll or Vintasoft.Barcode.Web.HttpHandlers.dll assembly.
Here is C# code of ASP.NET Core Web API controller that allows to recognize and generate barcodes:
/// <summary>
/// ASP.NET Core Web API controller that handles HTTP requests from clients and
/// allows to read barcodes from image and generate barcode image.
/// </summary>
public class BarcodeController : Vintasoft.Barcode.AspNetCore.ApiControllers.VintasoftBarcodeApiController
{
public BarcodeController()
: base()
{
}
}
Here is C# code of ASP.NET Web API controller that allows to recognize and generate barcodes:
/// <summary>
/// ASP.NET Web API 2 controller that handles HTTP requests from clients and
/// allows to read barcodes from image and generate barcode image.
/// </summary>
public class BarcodeController : Vintasoft.Barcode.Web.Api2Controllers.VintasoftBarcodeApi2Controller
{
public BarcodeController()
: base()
{
}
}
Here is C# code of ASP.NET HTTP handler that allows to recognize and generate barcodes:
/// <summary>
/// ASP.NET HTTP handler that handles HTTP requests from clients and
/// allows to read barcodes from image and generate barcode image.
/// </summary>
public class BarcodeHandler : Vintasoft.Barcode.Web.HttpHandlers.VintasoftBarcodeHandler
{
public BarcodeHandler()
: base()
{
}
}