GD-Barcode-1.13 > GD::Barcode::Industrial2of5

名前

GD::Barcode::Industrial2of5 - GDでIndustrial2of5バーコード・イメージを作成します

概要

ex. CGI

  use GD::Barcode::Industrial2of5;
  binmode(STDOUT);
  print "Content-Type: image/png\n\n";
  print GD::Barcode::Industrial2of5->new('1234567890')->plot->png;

エラーチェック付き

  my $oGdBar = GD::Barcode::Industrial2of5->new('A12345678');
  die $GD::Barcode::Industrial2of5::errStr unless($oGdBar); #文字が不正
  $oGdBar->plot->png;

説明

GD::Barcode::Industrial2of5はGD::Barcodeのサブクラスで、 GDでIndustrial2of5バーコードイメージを作成することを可能にします。

new

$oGdBar = GD::Barcode::Industrial2of5->new($sTxt);

コンストラクタ。 $sTxtのためのGD::Barcode::Industrial2of5のオブジェクトを作成します。 $sTxtは数字([0-9])です。

plot()

$oGd = $oGdBar->plot([Height => $iHeight, NoText => 0 | 1]);

newメソッドで指定された$sTxtのバーコードイメージを持った GDオブジェクトを作成します。$iHeightはイメージの高さです。 もしNoTextが1であればイメージには$sTxtのテキストのイメージは入りません。

 例.
  my $oGdB = GD::Barcode::Industrial2of5->new('12345678');
  my $oGD = $oGdB->plot(NoText=>1, Height => 20);
  # $sGDはHeight=>20ピクセルでテキストなしのGDイメージになります

barcode()

$sPtn = $oGdBar->barcode();

'1'と'0'の文字列でバーコードのパターン返します。 '1'は黒、'0'は白を意味します。

 例.
  my $oGdB = GD::Barcode::Industrial2of5->new('12345678');
  my $sPtn = $oGdB->barcode();

$errStr

$GD::Barcode::Industrial2of5::errStr

エラーメッセージが入ります。

$text

$oGdBar->{$text}

newメソッドで指定された$sTxtをベースにしたバーコードのテキストが入ります。

作者

Kawai Takanori GCD00051@nifty.ne.jp

著作権(COPYRIGHT)

The GD::Barocde::Industrial2of5 module is Copyright (c) 2000 Kawai Takanori. Japan. All rights reserved.

You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file.

参考資料

GD::Barcode