PNG JPG BMP TIFF SVG
Aspose.BarCode  for Python via Java
Singapore Post

อ่านบาร์โค้ด Singapore Post ด้วย Python via Java

อ่าน บาร์โค้ด Singapore Post ใน Python โดยใช้ Aspose.BarCode ฝั่งเซิร์ฟเวอร์สำหรับ Python via Java API

How to Read บาร์โค้ด Singapore Post Using Python via Java

หากต้องการสแกนและถอดรหัส บาร์โค้ด Singapore Post ให้ติดตั้ง Aspose.BarCode for Python ผ่าน Java API ซึ่งเป็น API อเนกประสงค์ ทรงพลัง และใช้งานง่าย ใช้ไลบรารีบาร์โค้ดสำหรับแอปพลิเคชันที่ใช้ Python รับเวอร์ชันล่าสุดโดยตรงจากพอร์ทัล Aspose releases หรือติดตั้ง ‘aspose-barcode’ จาก pip โดยเรียกใช้คำสั่งต่อไปนี้:

Command

  pip install aspose-barcode 

ขั้นตอนในการสแกน บาร์โค้ด Singapore Post ใน Python

Aspose.BarCode ช่วยให้นักพัฒนาสามารถอ่านบาร์โค้ด บาร์โค้ด Singapore Post จากสตรีมหรือรูปภาพด้วยโค้ดไม่กี่บรรทัด

  • สร้างวัตถุของคลาส Aspose.BarCode.BarCodeReader
  • กำหนดเส้นทางไฟล์ต้นฉบับที่มี บาร์โค้ด Singapore Post เป็นพารามิเตอร์
  • กำหนดประเภทบาร์โค้ดที่ต้องการใน DecodeType เป็นพารามิเตอร์ที่สอง
  • วนซ้ำผลลัพธ์การถอดรหัส
  • รับข้อความบาร์โค้ดโดยใช้คุณสมบัติ CodeText

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

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

  • Microsoft Windows, Linux หรือระบบปฏิบัติการใดๆ ที่เข้ากันได้กับสภาพแวดล้อมการพัฒนาที่ใช้ Python
  • Java 8 หรือสูงกว่า
  • Python 3.6 หรือสูงกว่า
  • ติดตั้ง PHP/Java Bridge แล้ว
  • FastCGI และ Tomcat Server 8.0 ขึ้นไป
Ready to recognize ตระหนัก วางไฟล์ที่นี่หรือคลิกเพื่อเรียกดู *

* โดยการอัปโหลดไฟล์ของคุณหรือใช้บริการ แสดงว่าคุณยอมรับข้อกำหนดในการให้บริการ ใช้และนโยบายความเป็นส่วนตัว

Code to be executed - Python

    
import os
import base64
from asposebarcode import Recognition

class BarcodeReaderExamples():
    def readBarcodeImage(self):
        image_data_base64 = ta.load_image_base64_from_path("<file name>")
        reader = Recognition.BarcodeReader(image_data_base64, None, Recognition.DecodeType.SingaporePost)
        recognized_results = reader.readBarCodes()
        for x in recognized_results:
            print(x.getCodeText())
            print(x.getCodeTypeName())

    def load_image_base64_from_path(filePath):
        try:
            image_file = open(filePath, "rb")
            image_data_binary = image_file.read()
            return (base64.b64encode(image_data_binary)).decode('ascii')
        except Exception as ex:
            print('Failed to save image\\n ' + str(ex))
        
barcodeReaderExamples = BarcodeReaderExamples()
barcodeReaderExamples.readBarcodeImage()

ผลการรับรู้

Other Supported Barcode Recognition Symbologies

Using Python via Java, One can also read barcode of different symbologies including the following.

2D:

Linear:

Postal: