Barcode.jar ver 5.0.0
Java 開発者向け バーコード作成ライブラリ(SVG出力・Base64出力対応)
読み取り中…
検索中…
一致する文字列を見つけられません
pao.barcode.Pdf417 クラス

クラス

enum  SIZE_KIND

公開メンバ関数

 Pdf417 (Graphics2D g)
 Pdf417 (String filepath)
 Pdf417 ()
 Pdf417 (String imgFormat, boolean useStream)
String getStringEncoding () throws Exception
void setStringEncoding (String value) throws Exception
float getRotateAngle ()
int getImgMargin ()
void setImgMargin (int value)
ByteArrayOutputStream getImageStream ()
void setImageStream (ByteArrayOutputStream value)
String getImageBase64 ()
String getImageFormat ()
void setImageFormat (String value)
Color getForeColor ()
void setForeColor (Color value)
Color getBackColor ()
void setBackColor (Color value)
SIZE_KIND getSizeKind ()
void setSizeKind (SIZE_KIND sizeKind)
int getCodeRows ()
void setCodeRows (int codeRows)
int getCodeColumns ()
void setCodeColumns (int codeColumns)
int getErrorLevel ()
void setErrorLevel (int errorLevel)
boolean getUseAutoErrorLevel ()
void setUseAutoErrorLevel (boolean useAutoErrorLevel)
float getAspectRatio ()
void setAspectRatio (float aspectRatio)
void paintCode ()
void draw (String code, float x, float y, float width, float height) throws Exception
void draw (String code, float x, float y, float width, float height, String filePath) throws Exception
void draw (byte code[], float x, float y, float width, float height) throws Exception
void drawDelicate (String code, float x, float y, float minLinePitch) throws Exception
void drawDelicate (String code, float x, float y, float minLinePitch, String filePath) throws Exception
void drawDelicate (byte code[], float x, float y, float minLinePitch) throws Exception
void drawDirect (String code, float x, float y, float width, float height) throws Exception
void drawDirect (String code, float x, float y, float width, float height, String filePath) throws Exception
void drawDirect (byte code[], float x, float y, float width, float height) throws Exception
void WriteSVG (String code, float x, float y, float minLinePitch, String filePath) throws Exception
void WriteSVG (byte code[], float x, float y, float minLinePitch, String filePath) throws Exception
float getDrawDelicateWidth (String code, float minLinePitch) throws Exception
float getDrawDelicateWidth (byte code[], float minLinePitch) throws Exception
float getDrawDirectWidth (String code, float width) throws Exception
float getDrawDirectWidth (byte code[], float width) throws Exception
String writeSVGToString (String code, float x, float y, float width, float height) throws Exception
String writeSVGToString (byte[] code, float x, float y, float width, float height) throws Exception

限定公開メンバ関数

byte[] getOutBits ()
int getBitColumns ()
int[] getCodewords ()
int getLenCodewords ()
void setLenCodewords (int lenCodewords)
byte[] getText ()
void setText (byte[] text)
void setText (String s) throws UnsupportedEncodingException
int getOptions ()
void setOptions (int options)
float getYHeight ()
void setYHeight (float yHeight)
boolean checkSegmentType (Segment segment, char type)
int getSegmentLength (Segment segment)
void outCodeword17 (int codeword)
void outCodeword18 (int codeword)
void outCodeword (int codeword)
void outStopPattern ()
void outStartPattern ()
void outPaintCode ()
void calculateErrorCorrection (int dest)
int getTextTypeAndValue (int maxLength, int idx)
void textCompaction (int start, int length)
void basicNumberCompaction (int start, int length)
void numberCompaction (int start, int length)
void byteCompaction6 (int start)
void assemble ()
void dumpList ()
int getMaxSquare ()

静的限定公開メンバ関数

static int maxPossibleErrorLevel (int remain)

限定公開変数類

int bitPtr
int cwPtr
SegmentList segmentList

静的限定公開変数類

static final int START_PATTERN = 0x1fea8
static final int STOP_PATTERN = 0x3fa29
static final int START_CODE_SIZE = 17
static final int STOP_SIZE = 18
static final int MOD = 929
static final int ALPHA = 0x10000
static final int LOWER = 0x20000
static final int MIXED = 0x40000
static final int PUNCTUATION = 0x80000
static final int ISBYTE = 0x100000
static final int BYTESHIFT = 913
static final int PL = 25
static final int LL = 27
static final int AS = 27
static final int ML = 28
static final int AL = 28
static final int PS = 29
static final int PAL = 29
static final int SPACE = 26
static final int TEXT_MODE = 900
static final int BYTE_MODE_6 = 924
static final int BYTE_MODE = 901
static final int NUMERIC_MODE = 902
static final int ABSOLUTE_MAX_TEXT_SIZE = 5420
static final int MAX_DATA_CODEWORDS = 926

詳解

PDF417を生成する2次元バーコードライブラリです。数字、英数字、漢字、かな、ひらがな、記号、バイナリ、制御コードなど、あらゆる種類のデータを扱えます。

著者
PAO

構築子と解体子

◆ Pdf417() [1/4]

pao.barcode.Pdf417.Pdf417 ( Graphics2D g)

PDF417のインスタンスを作成します。

引数
gバーコードを描画するGraphics2D

◆ Pdf417() [2/4]

pao.barcode.Pdf417.Pdf417 ( String filepath)

PDF417のインスタンスを作成します。

引数
filePath出力画像ファイルパス

◆ Pdf417() [3/4]

pao.barcode.Pdf417.Pdf417 ( )

PDF417のインスタンスを作成します。 画像形式はデフォルトでPNGが設定されます。

このコンストラクタは以下の用途で使用できます:

  • SVG出力(writeSVGToStringメソッド等)
  • Base64形式での画像データ取得(getImageBase64メソッド)
  • メモリストリームでの画像データ取得(getImageStreamメソッド)

Graphics2Dやファイルパスを指定せずに、シンプルにバーコードを生成できます。

◆ Pdf417() [4/4]

pao.barcode.Pdf417.Pdf417 ( String imgFormat,
boolean useStream )

PDF417のインスタンスを作成します(メモリストリーム出力用)。

このコンストラクタは、ファイルに保存せずにメモリ上で画像データを取得したい場合に使用します。 生成後、以下のメソッドで画像データを取得できます:

引数
imgFormat出力画像フォーマット("png", "jpeg", "bmp"など)。 nullや空文字、または無効な形式が指定された場合は"png"が使用されます。
useStreamストリーム出力を使用する場合はtrue。 falseの場合はストリーム機能は無効となり、getImageBase64等は空を返します。

メソッド詳解

◆ draw() [1/3]

void pao.barcode.Pdf417.draw ( byte code[],
float x,
float y,
float width,
float height ) throws Exception

バーコードを描画します。

引数
codeバーコードとして生成するバイト配列
xバーコードのX座標
yバーコードのY座標
widthバーコードの幅
heightバーコードの高さ
例外
Exception例外

◆ draw() [2/3]

void pao.barcode.Pdf417.draw ( String code,
float x,
float y,
float width,
float height ) throws Exception

バーコードを描画します。

引数
codeバーコードとして生成するテキスト
xバーコードのX座標
yバーコードのY座標
widthバーコードの幅
heightバーコードの高さ
例外
Exception例外

◆ draw() [3/3]

void pao.barcode.Pdf417.draw ( String code,
float x,
float y,
float width,
float height,
String filePath ) throws Exception

バーコードを描画します。

引数
codeバーコードとして生成するテキスト
xバーコードのX座標
yバーコードのY座標
widthバーコードの幅
heightバーコードの高さ
filePath画像ファイルパス
例外
Exception例外

◆ drawDelicate() [1/3]

void pao.barcode.Pdf417.drawDelicate ( byte code[],
float x,
float y,
float minLinePitch ) throws Exception

最小ピッチを指定してバーコードを描画します。

引数
codeバーコードとして生成するバイト配列
xバーコードのX座標
yバーコードのY座標
minLinePitchバーコードの最小ラインピッチ
例外
Exception例外

◆ drawDelicate() [2/3]

void pao.barcode.Pdf417.drawDelicate ( String code,
float x,
float y,
float minLinePitch ) throws Exception

最小ピッチを指定してバーコードを描画します。

引数
codeバーコードとして生成するテキスト
xバーコードのX座標
yバーコードのY座標
minLinePitchバーコードの最小ラインピッチ
例外
Exception例外

◆ drawDelicate() [3/3]

void pao.barcode.Pdf417.drawDelicate ( String code,
float x,
float y,
float minLinePitch,
String filePath ) throws Exception

最小ピッチを指定してバーコードを描画します。

引数
codeバーコードとして生成するテキスト
xバーコードのX座標
yバーコードのY座標
minLinePitchバーコードの最小ラインピッチ
filePath画像ファイルパス
例外
Exception例外

◆ drawDirect() [1/3]

void pao.barcode.Pdf417.drawDirect ( byte code[],
float x,
float y,
float width,
float height ) throws Exception

ピクセル単位で直接バーコードを描画します。

引数
codeバーコードとして生成するバイト配列
xバーコードのX座標
yバーコードのY座標
widthバーコードの幅
heightバーコードの高さ
例外
Exception例外

◆ drawDirect() [2/3]

void pao.barcode.Pdf417.drawDirect ( String code,
float x,
float y,
float width,
float height ) throws Exception

ピクセル単位で直接バーコードを描画します。

引数
codeバーコードとして生成するテキスト
xバーコードのX座標
yバーコードのY座標
widthバーコードの幅
heightバーコードの高さ
例外
Exception例外

◆ drawDirect() [3/3]

void pao.barcode.Pdf417.drawDirect ( String code,
float x,
float y,
float width,
float height,
String filePath ) throws Exception

ピクセル単位で直接バーコードを描画します。

引数
codeバーコードとして生成するテキスト
xバーコードのX座標
yバーコードのY座標
widthバーコードの幅
heightバーコードの高さ
filePath画像ファイルパス
例外
Exception例外

◆ getAspectRatio()

float pao.barcode.Pdf417.getAspectRatio ( )

Gets the barcode aspect ratio.

戻り値
the barcode aspect ratio

◆ getBackColor()

Color pao.barcode.Pdf417.getBackColor ( )

背景色を取得します。

戻り値
背景色(デフォルト: null = 透明)

◆ getBitColumns()

int pao.barcode.Pdf417.getBitColumns ( )
protected

Gets the number of X pixels of outBits.

戻り値
the number of X pixels of outBits

◆ getCodeColumns()

int pao.barcode.Pdf417.getCodeColumns ( )

バーコードデータ列数を取得します。

戻り値
バーコードデータ列数

◆ getCodeRows()

int pao.barcode.Pdf417.getCodeRows ( )

バーコード行数を取得します。

戻り値
バーコード行数

◆ getCodewords()

int[] pao.barcode.Pdf417.getCodewords ( )
protected

Gets the codeword array. This array is always 928 elements long. It can be writen to if the option PDF417_USE_RAW_CODEWORDS is set.

戻り値
the codeword array

◆ getErrorLevel()

int pao.barcode.Pdf417.getErrorLevel ( )

エラー訂正レベルを取得します。

戻り値
エラー訂正レベル

◆ getForeColor()

Color pao.barcode.Pdf417.getForeColor ( )

バーの色(前景色)を取得します。

戻り値
バーの色(デフォルト: 黒)

◆ getImageBase64()

String pao.barcode.Pdf417.getImageBase64 ( )

画像をBase64エンコードした文字列を取得します。

戻り値
Base64エンコードされた画像データ

◆ getImageFormat()

String pao.barcode.Pdf417.getImageFormat ( )

画像フォーマットを取得します。

戻り値
画像フォーマット

◆ getImageStream()

ByteArrayOutputStream pao.barcode.Pdf417.getImageStream ( )

画像ストリームを取得します。

戻り値
画像ストリーム

◆ getImgMargin()

int pao.barcode.Pdf417.getImgMargin ( )

画像マージンのピクセル数を取得します。

戻り値
画像マージンのピクセル数

◆ getLenCodewords()

int pao.barcode.Pdf417.getLenCodewords ( )
protected

Gets the length of the codewords.

戻り値
the length of the codewords

◆ getOptions()

int pao.barcode.Pdf417.getOptions ( )
protected

Gets the options to generate the barcode.

戻り値
the options to generate the barcode

◆ getOutBits()

byte[] pao.barcode.Pdf417.getOutBits ( )
protected

Gets the raw image bits of the barcode. The image will have to be scaled in the Y direction by yHeight.

戻り値
The raw barcode image

◆ getRotateAngle()

float pao.barcode.Pdf417.getRotateAngle ( )

バーコードの回転角度を取得します。

戻り値
バーコードの回転角度

◆ getSizeKind()

SIZE_KIND pao.barcode.Pdf417.getSizeKind ( )

データ列数・行数決定方法を取得します。

戻り値
データ列数・行数決定方法

◆ getStringEncoding()

String pao.barcode.Pdf417.getStringEncoding ( ) throws Exception

文字エンコーディングを取得します。

戻り値
文字エンコーディング

◆ getText()

byte[] pao.barcode.Pdf417.getText ( )
protected

Gets the bytes that form the barcode. This bytes should be interpreted in the codepage Cp437.

戻り値
the bytes that form the barcode

◆ getUseAutoErrorLevel()

boolean pao.barcode.Pdf417.getUseAutoErrorLevel ( )

自動エラーレベルを使用するかどうかを取得します。

戻り値
自動エラーレベルを使用する場合はtrue

◆ getYHeight()

float pao.barcode.Pdf417.getYHeight ( )
protected

Gets the Y pixel height relative to X.

戻り値
the Y pixel height relative to X

◆ paintCode()

void pao.barcode.Pdf417.paintCode ( )

Paints the barcode. If no exception was thrown a valid barcode is available.

◆ setAspectRatio()

void pao.barcode.Pdf417.setAspectRatio ( float aspectRatio)

Sets the barcode aspect ratio. A ratio or 0.5 will make the barcode width twice as large as the height.

引数
aspectRatiothe barcode aspect ratio

◆ setBackColor()

void pao.barcode.Pdf417.setBackColor ( Color value)

背景色を設定します。 画像データ保存時のみ有効です。nullを指定すると透明になります。

引数
value背景色

◆ setCodeColumns()

void pao.barcode.Pdf417.setCodeColumns ( int codeColumns)

バーコードデータ列数を設定します。

引数
codeColumnsバーコードデータ列数

◆ setCodeRows()

void pao.barcode.Pdf417.setCodeRows ( int codeRows)

バーコード行数を設定します。

引数
codeRowsバーコード行数

◆ setErrorLevel()

void pao.barcode.Pdf417.setErrorLevel ( int errorLevel)

エラー訂正レベルを設定します。

引数
errorLevelエラー訂正レベル

◆ setForeColor()

void pao.barcode.Pdf417.setForeColor ( Color value)

バーの色(前景色)を設定します。

引数
valueバーの色

◆ setImageFormat()

void pao.barcode.Pdf417.setImageFormat ( String value)

画像フォーマットを設定します。

引数
value画像フォーマット ("png", "jpeg", "bmp"など)

◆ setImageStream()

void pao.barcode.Pdf417.setImageStream ( ByteArrayOutputStream value)

画像ストリームを設定します。

引数
value画像ストリーム

◆ setImgMargin()

void pao.barcode.Pdf417.setImgMargin ( int value)

画像マージンのピクセル数を設定します。

引数
value画像マージンのピクセル数

◆ setLenCodewords()

void pao.barcode.Pdf417.setLenCodewords ( int lenCodewords)
protected

Sets the length of the codewords.

引数
lenCodewordsthe length of the codewords

◆ setOptions()

void pao.barcode.Pdf417.setOptions ( int options)
protected

Sets the options to generate the barcode. This can be all the PDF417_* constants.

引数
optionsthe options to generate the barcode

◆ setSizeKind()

void pao.barcode.Pdf417.setSizeKind ( SIZE_KIND sizeKind)

データ列数・行数決定方法を設定します。

引数
sizeKindデータ列数・行数決定方法

◆ setStringEncoding()

void pao.barcode.Pdf417.setStringEncoding ( String value) throws Exception

文字エンコーディングを設定します。

引数
value文字エンコーディング

◆ setText() [1/2]

void pao.barcode.Pdf417.setText ( byte[] text)
protected

Sets the bytes that form the barcode. This bytes should be interpreted in the codepage Cp437.

引数
textthe bytes that form the barcode

◆ setText() [2/2]

void pao.barcode.Pdf417.setText ( String s) throws UnsupportedEncodingException
protected

Sets the text that will form the barcode. This text is converted to bytes using the encoding Cp437.

引数
sthe text that will form the barcode
例外
UnsupportedEncodingExceptionif the encoding Cp437 is not supported

◆ setUseAutoErrorLevel()

void pao.barcode.Pdf417.setUseAutoErrorLevel ( boolean useAutoErrorLevel)

自動エラーレベルを使用するかどうかを設定します。

引数
useAutoErrorLevel自動エラーレベルを使用する場合はtrue

◆ setYHeight()

void pao.barcode.Pdf417.setYHeight ( float yHeight)
protected

Sets the Y pixel height relative to X. It is usually 3.

引数
yHeightthe Y pixel height relative to X

◆ WriteSVG() [1/2]

void pao.barcode.Pdf417.WriteSVG ( byte code[],
float x,
float y,
float minLinePitch,
String filePath ) throws Exception

SVG形式でバーコードを出力します。

引数
codeバーコードとして生成するバイト配列
xバーコードのX座標
yバーコードのY座標
minLinePitchバーコードの最小ラインピッチ
filePathSVGファイルパス
例外
Exception例外

◆ WriteSVG() [2/2]

void pao.barcode.Pdf417.WriteSVG ( String code,
float x,
float y,
float minLinePitch,
String filePath ) throws Exception

SVG形式でバーコードを出力します。

引数
codeバーコードとして生成するテキスト
xバーコードのX座標
yバーコードのY座標
minLinePitchバーコードの最小ラインピッチ
filePathSVGファイルパス
例外
Exception例外

◆ writeSVGToString() [1/2]

String pao.barcode.Pdf417.writeSVGToString ( byte[] code,
float x,
float y,
float width,
float height ) throws Exception

Writes PDF417 barcode as SVG string

引数
codeByte array to be generated as barcode
xX position
yY position
widthWidth of barcode
heightHeight of barcode
戻り値
SVG string
例外
Exceptionif resources could not be found

◆ writeSVGToString() [2/2]

String pao.barcode.Pdf417.writeSVGToString ( String code,
float x,
float y,
float width,
float height ) throws Exception

Writes PDF417 barcode as SVG string

引数
codeText to be generated as barcode
xX position
yY position
widthWidth of barcode
heightHeight of barcode
戻り値
SVG string
例外
Exceptionif resources could not be found

このクラス詳解は次のファイルから抽出されました: