PNG JPG BMP TIFF SVG
Aspose.BarCode  for Android via Java
Codablock-F

สร้างป้ายกำกับ Codablock-F ด้วย Android via Java

สร้าง บาร์โค้ด Codablock-F และ GS1 Codablock-F ใน Java โดยใช้ Aspose.BarCode ฝั่งเซิร์ฟเวอร์สำหรับ Android via Java API

How to Generate บาร์โค้ด Codablock-F Using Android via Java

ลองใช้ Aspose.BarCode สำหรับ Android ผ่าน Java เพื่อสร้าง บาร์โค้ด Codablock-F ภายในแอปพลิเคชัน Android ได้อย่างง่ายดาย เป็นไลบรารีบาร์โค้ดอเนกประสงค์ แข็งแกร่ง และใช้งานง่ายซึ่งออกแบบมาโดยเฉพาะสำหรับแอปพลิเคชัน Android คุณสามารถ Aspose.BarCode สำหรับ Android ผ่าน Java ได้โดยตรงจากโครงการที่ใช้ Maven โดยใส่การกำหนดค่าต่อไปนี้ลงใน build.gradle:

Command

  maven { url "http://repository.aspose.com/repo/" }

Command

  implementation group: 'com.aspose', name: 'aspose-barcode', version: '23.XX', ext: 'aar'      
  implementation group: 'com.aspose', name: 'aspose-barcode', classifier: 'control.android.via.java-javadoc', version: '23.XX' 

ขั้นตอนในการสร้าง บาร์โค้ด Codablock-F ใน Java

Aspose.BarCode ช่วยให้นักพัฒนาสร้างภาพ บาร์โค้ด Codablock-F ได้ง่ายด้วยโค้ดไม่กี่บรรทัด

  • สร้างตัวอย่างใหม่ของคลาส BarCodeGenerator
  • ส่งประเภทบาร์โค้ด บาร์โค้ด Codablock-F เป็นพารามิเตอร์ EncodeTypes
  • กำหนดข้อความบาร์โค้ดโดยใช้เมธอด setCodeText
  • เปิดเมธอด createBarCodeImage() เพื่อบันทึกภาพบาร์โค้ด บาร์โค้ด Codablock-F และ GS1 Codablock-F

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

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

  • Microsoft Windows, Linux หรือระบบปฏิบัติการใดๆ ที่เข้ากันได้กับสภาพแวดล้อม Android Runtime
  • Android SDK v.30
  • ระบบ Android ที่ใช้ Android OS 2.0 หรือใหม่กว่า

Code to be executed - Java


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

// 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