PNG JPG BMP TIFF SVG
Aspose.BarCode  for Java
ISBN

Java で ISBN ラベルを生成します

Java API のサーバー側 Aspose.BarCode を使用して、Java に ISBN バーコード を作成します。

How to Generate ISBN バーコード Using Java

ISBN バーコード を生成するには、 Aspose.BarCode for Java API を入手します。これは、豊富で強力で使いやすい Java 用バーコード API です。ベースのプラットフォーム。 Maven から最新バージョンを直接ダウンロードし、Maven 内にインストールします。次の構成を pom.xml に追加して、ベースのプロジェクトを作成します。

Repository

<repository>
    <id>AsposeJavaAPI</id>
    <name>Aspose Java API</name>
    <url>https://repository.aspose.com/repo/</url>
</repository>

Dependency

<dependency>
    <groupId>com.aspose</groupId>
    <artifactId>aspose-barcode</artifactId>
    <version>version of aspose-barcode API</version>
    <classifier>jdk17</classifier>
</dependency>

Java で ISBN バーコード を生成する手順

Aspose.BarCode を使用すると、開発者は数行のコードで ISBN バーコード 画像を簡単に作成できます。

  • BarCodeGenerator クラスの新しいオブジェクトを作成します
  • ISBN バーコード およびその他の必要なバーコード タイプを EncodeTypes パラメータとして定義します
  • setCodeText メソッドを使用して入力テキストを指定します
  • BarCodeGenerator.save メソッドを使用して、生成されたバーコード画像を保存します

システム要求

Aspose バーコード API は、すべての主要なプラットフォームとオペレーティング システムでサポートされています。以下のコード サンプルを実行する前に、システムで次の前提条件が有効になっていることを確認してください。

  • Microsoft Windows、Linux、または JSP/JSF およびデスクトップ アプリケーション用の Java ランタイム環境と互換性のある任意の OS
  • JRE 1.6 以降などの Java 開発環境
  • Java 開発バージョン JSE2 7.0 以降

Code to be executed - Java


// Create an instane of the BarcodeGenerator class
BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.ISBN);

// Specify the code text
generator.setCodeText("");

// Specify the X-dimension 
// the smallest width of the unit of BarCode bars or spaces
generator.getParameters().getBarcode().getXDimension().setMillimeters(2);

// Set codetext position
generator.getParameters().getBarcode().getCodeTextParameters().setLocation(CodeLocation.Below);

// Generate image
generator.generateBarCodeImage();
Generation result