Class PDF417Writer

java.lang.Object
com.google.zxing.pdf417.PDF417Writer
All Implemented Interfaces:
Writer

public final class PDF417Writer extends Object implements Writer
  • Field Details

    • WHITE_SPACE

      private static final int WHITE_SPACE
      default white space (margin) around the code
      See Also:
    • DEFAULT_ERROR_CORRECTION_LEVEL

      private static final int DEFAULT_ERROR_CORRECTION_LEVEL
      default error correction level
      See Also:
  • Constructor Details

    • PDF417Writer

      public PDF417Writer()
  • Method Details

    • encode

      public BitMatrix encode(String contents, BarcodeFormat format, int width, int height, Map<EncodeHintType,?> hints) throws WriterException
      Specified by:
      encode in interface Writer
      Parameters:
      contents - The contents to encode in the barcode
      format - The barcode format to generate
      width - The preferred width in pixels
      height - The preferred height in pixels
      hints - Additional parameters to supply to the encoder
      Returns:
      BitMatrix representing encoded barcode image
      Throws:
      WriterException - if contents cannot be encoded legally in a format
    • encode

      public BitMatrix encode(String contents, BarcodeFormat format, int width, int height) throws WriterException
      Description copied from interface: Writer
      Encode a barcode using the default settings.
      Specified by:
      encode in interface Writer
      Parameters:
      contents - The contents to encode in the barcode
      format - The barcode format to generate
      width - The preferred width in pixels
      height - The preferred height in pixels
      Returns:
      BitMatrix representing encoded barcode image
      Throws:
      WriterException - if contents cannot be encoded legally in a format
    • bitMatrixFromEncoder

      private static BitMatrix bitMatrixFromEncoder(PDF417 encoder, String contents, int errorCorrectionLevel, int width, int height, int margin, boolean autoECI) throws WriterException
      Takes encoder, accounts for width/height, and retrieves bit matrix
      Throws:
      WriterException
    • bitMatrixFromBitArray

      private static BitMatrix bitMatrixFromBitArray(byte[][] input, int margin)
      This takes an array holding the values of the PDF 417
      Parameters:
      input - a byte array of information with 0 is black, and 1 is white
      margin - border around the barcode
      Returns:
      BitMatrix of the input
    • rotateArray

      private static byte[][] rotateArray(byte[][] bitarray)
      Takes and rotates the it 90 degrees