PNG JPG BMP TIFF SVG
Aspose.BarCode  for Node.js via Java
EAN

สร้างป้ายกำกับ EAN ด้วย Node.js via Java

สร้าง บาร์โค้ด EAN (หมายเลขบทความระหว่างประเทศ) ใน JavaScript โดยใช้ Aspose.BarCode ฝั่งเซิร์ฟเวอร์สำหรับ Node.js via Java API

How to Generate บาร์โค้ด EAN (หมายเลขบทความระหว่างประเทศ) Using Node.js via Java

หากต้องการสร้างบาร์โค้ด บาร์โค้ด EAN (หมายเลขบทความระหว่างประเทศ) ภายในแอปพลิเคชัน Node.js ให้ซื้อ Aspose.BarCode สำหรับ Node.js ผ่าน Java ซึ่งเป็น API บาร์โค้ดขั้นสูง ที่มีศักยภาพ และเป็นมิตรกับผู้ใช้ซึ่งออกแบบมาสำหรับแพลตฟอร์มที่เน้น Java คุณสามารถติดตั้ง aspose.barcode สำหรับ Javascript ได้ง่ายๆ จาก NPM:

Command

  > npm i aspose.barcode

ขั้นตอนในการสร้าง บาร์โค้ด EAN (หมายเลขบทความระหว่างประเทศ) ใน JavaScript

Aspose.BarCode ช่วยให้นักพัฒนาสร้างภาพ บาร์โค้ด EAN (หมายเลขบทความระหว่างประเทศ) ได้ง่ายด้วยโค้ดไม่กี่บรรทัด

  • สร้างอินสแตนซ์ของคลาส BarCodeGenerator
  • ตั้งค่า บาร์โค้ด EAN (หมายเลขบทความระหว่างประเทศ) เป็นพารามิเตอร์ EncodeTypes
  • กำหนดข้อความที่จะเข้ารหัสเป็นพารามิเตอร์ที่สอง
  • กำหนดขนาดและตำแหน่งบาร์โค้ดหากจำเป็น
  • เรียกใช้เมธอด BarCodeGenerator.save เพื่อรับภาพบาร์โค้ดที่สร้างขึ้น

ความต้องการของระบบ

API บาร์โค้ด Aspose รองรับโดยแพลตฟอร์มและระบบปฏิบัติการหลักทั้งหมด ก่อนดำเนินการตามตัวอย่างโค้ดด้านล่าง โปรดตรวจสอบว่าคุณได้เปิดใช้งานข้อกำหนดเบื้องต้นต่อไปนี้ในระบบของคุณแล้ว

  • Microsoft Windows, Linux หรือระบบปฏิบัติการใดๆ ที่เข้ากันได้กับ Node.js
  • Node.js และ Node.js/Java Bridge ติดตั้ง
  • Oracle JDK เวอร์ชัน 7 ขึ้นไป

Code to be executed - JavaScript


const barcode_ = require("aspose.barcode");
const aspose_barcode = barcode_.AsposeBarcode

let BarcodeGenerator = aspose_barcode.BarcodeGenerator;
let EncodeTypes = aspose_barcode.EncodeTypes;

// Create an instane of the BarcodeGenerator class
let generator = new BarcodeGenerator(EncodeTypes.QR, "");

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

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

// Generate and save image
generator.save("example.png", aspose_barcode.BarCodeImageFormat.PNG);
Generation result