Class QRCode

java.lang.Object
net.atthegate.server.service.pdf.QRCode
All Implemented Interfaces:
Drawable

public class QRCode extends Object implements Drawable
Used to create 2D QR Code barcodes. Please see Example_20.
  • Constructor Summary

    Constructors
    Constructor
    Description
    QRCode(String str, int errorCorrectLevel)
    Used to create 2D QR Code barcodes.
  • Method Summary

    Modifier and Type
    Method
    Description
    float[]
    drawOn(Page page)
    Draws this barcode on the specified page.
    protected int
     
     
    protected int
     
    protected boolean
    isDark(int row, int col)
     
    protected void
    make(boolean test, int maskPattern)
     
    void
    setLocation(float x, float y)
    Sets the location where this barcode will be drawn on the page.
    void
    setModuleLength(double moduleLength)
    Sets the module length of this barcode.
    void
    setModuleLength(float moduleLength)
    Sets the module length of this barcode.
    void
    setPosition(double x, double y)
    Sets the position where this barcode will be drawn on the page.
    void
    setPosition(float x, float y)
    Sets the position where this barcode will be drawn on the page.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • setPosition

      public void setPosition(double x, double y)
      Sets the position where this barcode will be drawn on the page.
      Parameters:
      x - the x coordinate of the top left corner of the barcode.
      y - the y coordinate of the top left corner of the barcode.
    • setPosition

      public void setPosition(float x, float y)
      Sets the position where this barcode will be drawn on the page.
      Parameters:
      x - the x coordinate of the top left corner of the barcode.
      y - the y coordinate of the top left corner of the barcode.
    • setLocation

      public void setLocation(float x, float y)
      Sets the location where this barcode will be drawn on the page.
      Parameters:
      x - the x coordinate of the top left corner of the barcode.
      y - the y coordinate of the top left corner of the barcode.
    • setModuleLength

      public void setModuleLength(double moduleLength)
      Sets the module length of this barcode. The default value is 2.0f
      Parameters:
      moduleLength - the specified module length.
    • setModuleLength

      public void setModuleLength(float moduleLength)
      Sets the module length of this barcode. The default value is 2.0f
      Parameters:
      moduleLength - the specified module length.
    • drawOn

      public float[] drawOn(Page page) throws Exception
      Draws this barcode on the specified page.
      Specified by:
      drawOn in interface Drawable
      Parameters:
      page - the specified page.
      Returns:
      x and y coordinates of the bottom right corner of this component.
      Throws:
      Exception
    • getData

      public Boolean[][] getData()
    • isDark

      protected boolean isDark(int row, int col)
      Parameters:
      row - the row.
      col - the column.
    • getModuleCount

      protected int getModuleCount()
    • getBestMaskPattern

      protected int getBestMaskPattern()
    • make

      protected void make(boolean test, int maskPattern)