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

Data Matrix लेबल Node.js via Java के साथ जनरेट करें

Node.js via Java API के लिए सर्वर-साइड Aspose.BarCode का उपयोग करके JavaScript में Data Matrix कोड बनाएं।

How to Generate Data Matrix कोड Using Node.js via Java

Node.js अनुप्रयोगों के भीतर Data Matrix कोड बारकोड बनाने के लिए, जावा के माध्यम से Node.js के लिए Aspose.BarCode प्राप्त करें, जो जावा-उन्मुख प्लेटफॉर्म के लिए डिज़ाइन किया गया एक उन्नत, शक्तिशाली और उपयोगकर्ता के अनुकूल बारकोड एपीआई है। आप एनपीएम से जावास्क्रिप्ट के लिए आसानी से aspose.barcode स्थापित कर सकते हैं:

Command

  > npm i aspose.barcode

JavaScript में Data Matrix कोड जनरेट करने के चरण

Aspose.BarCode डेवलपर्स के लिए कोड की कुछ पंक्तियों के साथ Data Matrix कोड छवियां बनाना आसान बनाता है।

  • BarCodeGenerator वर्ग का एक उदाहरण बनाएं
  • Data Matrix कोड को EncodeTypes पैरामीटर के रूप में सेट करें
  • दूसरे पैरामीटर के रूप में एन्कोड करने के लिए टेक्स्ट परिभाषित करें
  • यदि आवश्यक हो तो बारकोड आयाम और स्थान निर्धारित करें
  • जेनरेट की गई बारकोड छवि प्राप्त करने के लिए BarCodeGenerator.save पद्धति को कॉल करें

सिस्टम आवश्यकताएं

Aspose बारकोड एपीआई सभी प्रमुख प्लेटफॉर्म और ऑपरेटिंग सिस्टम द्वारा समर्थित हैं। नीचे दिए गए कोड नमूने को निष्पादित करने से पहले, कृपया जांच लें कि आपके सिस्टम में निम्नलिखित पूर्वापेक्षाएँ सक्षम हैं।

  • Microsoft Windows, Linux, या Node.js के साथ संगत कोई भी OS
  • 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