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

قراءة الرموز الشريطية لـ QR باستخدام Python via Java

اقرأ QR الرمز ، GS1 QR الرمز في Python باستخدام Aspose.BarCode من جانب الخادم لواجهة برمجة تطبيقات Python via Java

How to Read QR الرمز Using Python via Java

لمسح وفك تشفير QR الرمز ، ثبّت [Aspose.BarCode for Python via Java] ( https://products.aspose.com/barcode/python-java/ ) واجهة برمجة تطبيقات ، متعددة الاستخدامات وقوية وسهلة الاستخدام استخدام مكتبة الباركود للتطبيقات المستندة إلى Python. احصل على أحدث إصدار مباشرة من بوابة [Aspose release] ( https://releases.aspose.com/barcode/python-java/ ) أو ثبّت “aspose-barcode” من النقطة عن طريق تشغيل الأمر التالي:

Command

  pip install aspose-barcode 

خطوات فحص QR الرمز في Python

Aspose.BarCode يسمح للمطورين بقراءة الرموز الشريطية QR الرمز من الدفق أو الصورة مع بضعة أسطر من التعليمات البرمجية

  • أنشئ كائنًا من فئة Aspose.BarCode.BarCodeReader
  • حدد مسار الملف المصدر الذي يحتوي على QR الرمز كمعامل
  • حدد أنواع الرموز الشريطية المطلوبة في DecodeType كمعامل ثاني
  • تكرار نتائج فك التشفير
  • الحصول على نص الرمز الشريطي باستخدام خاصية CodeText

متطلبات النظام

يتم دعم واجهات برمجة التطبيقات Aspose على جميع المنصات وأنظمة التشغيل الرئيسية. قبل تنفيذ نموذج التعليمات البرمجية أدناه ، يرجى التأكد من أن نظامك يتوافق مع المتطلبات التالية.

  • 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.QR)
        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: