New ConvertBarcodeSplit Web API Method for LEADTOOLS Cloud Services

Posted on 2018-10-12 Greg

Since releasing LEADTOOLS Cloud Services only a few months ago, we have seen a lot of usage from customers as well as some feedback. It's a product we look forward to supporting and improving by making additional LEADTOOLS imaging functionality available in an easy-to-consume Web API. Today marks the first update to LEADTOOLS Cloud Services and are happy to announce a new method endpoint for the service: ConvertBarcodeSplit.

Batch scanning with barcode separators is not a new concept, but is typically a low-level process built into a scanner itself or buried within a desktop scanning application. Typically, a barcode signals to the scanner how and where to split the document. More advanced scenarios can even use barcodes to signal changes to the scanner settings, such as scanning in color instead of black and white.

With many applications moving towards containerized microservices, this kind of workflow isn't necessarily becoming out-dated, but is harder to compartmentalize. In modern application environments and workflows, it makes far more sense to scan large batches of documents into a single multipage file, then split it with another microservice after the scanning batch is completed. This workflow also opens up the application to use mobile device capture rather than traditional scanners. The new ConvertBarcodeSplit is perfect for that kind of task, allowing you to upload a large file and split the document up into multiple documents based on where it finds a barcode. It is highly configurable, allowing you to search for a specific barcode type (e.g., QR Code, Patch Code, etc.), and how to split the pages (barcode is on first page, last page, or a page on its own to be discarded).

Example

Here's a quick .NET example of how to use the new method. For examples in additional languages, visit the API Reference for ConvertBarcodeSplit.


public async void ConvertFile()
{
   //The first page in the file to mark for processing
   int firstPage = 1;

   //Sending a value of -1 will indicate to the service that all pages in the file should be processed.
   int lastPage = -1;

   string fileURL = "https://demo.leadtools.com/images/lcs/barcode_split.tif";

   //Enum corresponding to the output format for the file. For the purposes of this script, we will be converting to tif.
   int fileFormat = 3; // TIFF

   string conversionUrl = string.Format("Conversion/ConvertBarcodeSplit?firstPage={0}&lastPage={1}&fileurl={2}&format={3}", firstPage, lastPage, fileURL, fileFormat);

   var client = InitClient();
   var result = await client.PostAsync(conversionUrl, null);
   if (result.StatusCode == HttpStatusCode.OK)
   {
      //Unique ID returned by the services
      string id = await result.Content.ReadAsStringAsync();
      Console.WriteLine("Unique ID returned by the services: " + id);
   }
   else
      Console.WriteLine("Request failed with the following response: " + result.StatusCode);

}

The idea for this function came from a customer request. If you have checked out LEADTOOLS Cloud Services and you wished there was additional functionality, or if you're just starting your hunt for a high-level web API for document and raster imaging tasks, don't hesitate to contact us!

LEADTOOLS Blog

LEADTOOLS Powered by Apryse,the Market Leading PDF SDK,All Rights Reserved