Class BarcodeWriter

java.lang.Object
com.logicaldoc.barcode.BarcodeWriter

public class BarcodeWriter extends Object
Utility class used to produce barcode images.
Since:
7.6
Author:
Marco Meschieri - LogicalDOC
  • Method Details Link icon

    • write Link icon

      public static void write(String format, String code, int width, int height, boolean label, File file) throws IOException
      Throws:
      IOException
    • write Link icon

      public static BufferedImage write(String format, String code, int width, int height, boolean label) throws IOException
      Throws:
      IOException
    • writeEncoded Link icon

      public static String writeEncoded(String format, String code, int width, int height, boolean label) throws IOException
      Generates the barcode and returns the Base64 encode of the resulting image
      Parameters:
      format - The barcode format (CODE_128, QR_CODE ...)
      code - The content of the barcode
      width - width of the resulting image
      height - height of the resulting image
      label - If the code should also printed as plain text
      Returns:
      The barcode image base64 encoded
      Throws:
      IOException - In case of error during the rendering
    • writeQREncoded Link icon

      public static String writeQREncoded(String code, int size) throws IOException
      Generates the QR code and returns the Base64 encode of the resulting image
      Parameters:
      code - The content of the barcode
      size - dimension of the resulting square image
      Returns:
      The barcode image base64 encoded
      Throws:
      IOException - In case of error during the rendering