title: How to use Barcode4J to get the barcode number?
body: <p>I am using barcode4j to generate some barcode image, which works fine.</p>
  
  <p>But the UI team wanna me to write some service to return the barcode number in String for them for some strange reasons. I can't figure out how to do this.</p>
  
  <p>Below is the code snippet for how to generate the Barcode Image.</p>
  
  <pre><code>final File outputFile = new File(folderPath + "/" + TgtCoreConstants.TARGET_BARCODE_FILE_PREFIX
              + orderId + BARCODE_FILENAME_EXTENSION);
      OutputStream out = null;
      try {
          out = new FileOutputStream(outputFile);
          final BitmapCanvasProvider canvas = new BitmapCanvasProvider(
                  out, BARCODE_MIME_TYPE, cncBarcodeDpi, BufferedImage.TYPE_BYTE_BINARY, false, 0);
          bean.generateBarcode(canvas, (storeNumber + orderId));
          canvas.finish();
      }
      catch (final FileNotFoundException e) {
          LOG.error("Error while generating the barcode file for order: " + orderId, e);
          throw new GenerateBarCodeFailedException(e);
      }
      catch (final IOException e) {
          LOG.error("Error while generating the barcode file for order: " + orderId, e);
          throw new GenerateBarCodeFailedException(e);
      }
  </code></pre>