Class PDF417Writer

  • All Implemented Interfaces:
    Writer

    public final class PDF417Writer
    extends java.lang.Object
    implements Writer
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static int DEFAULT_ERROR_CORRECTION_LEVEL
      default error correction level
      private static int WHITE_SPACE
      default white space (margin) around the code
    • Constructor Summary

      Constructors 
      Constructor Description
      PDF417Writer()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private static BitMatrix bitMatrixFromBitArray​(byte[][] input, int margin)
      This takes an array holding the values of the PDF 417
      private static BitMatrix bitMatrixFromEncoder​(PDF417 encoder, java.lang.String contents, int errorCorrectionLevel, int width, int height, int margin, boolean autoECI)
      Takes encoder, accounts for width/height, and retrieves bit matrix
      BitMatrix encode​(java.lang.String contents, BarcodeFormat format, int width, int height)
      Encode a barcode using the default settings.
      BitMatrix encode​(java.lang.String contents, BarcodeFormat format, int width, int height, java.util.Map<EncodeHintType,​?> hints)  
      private static byte[][] rotateArray​(byte[][] bitarray)
      Takes and rotates the it 90 degrees
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • WHITE_SPACE

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

        private static final int DEFAULT_ERROR_CORRECTION_LEVEL
        default error correction level
        See Also:
        Constant Field Values
    • Constructor Detail

      • PDF417Writer

        public PDF417Writer()
    • Method Detail

      • encode

        public BitMatrix encode​(java.lang.String contents,
                                BarcodeFormat format,
                                int width,
                                int height,
                                java.util.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​(java.lang.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,
                                                      java.lang.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