बारकोड जेनरेशन उपयोग मामले
Aspose.BarCode FOSS for Python सात सिम्बोलॉजीज़ का समर्थन करता है: Code 128, Code 39, EAN-13, EAN-8, QR Code, UPC-A, और UPC-E. यह लेख प्रत्येक के लिए व्यावहारिक परिदृश्य दिखाता है।
इन्वेंटरी प्रबंधन
Code 128 इन्वेंटरी लेबल के लिए एक सामान्य विकल्प है क्योंकि यह अल्फ़ान्यूमेरिक डेटा को विशेष अक्षरों सहित एन्कोड करता है। प्रत्येक आइटम को एक लेबल पर मुद्रित एक अनूठा पहचानकर्ता मिलता है।
from aspose_barcode_foss import BarcodeService, RenderOptions
service = BarcodeService()
# Generate a Code 128 barcode for an inventory SKU
barcode = service.generate("code128", "SKU-2026-A1234")
svg_content = barcode.to_svg(RenderOptions(scale=2.0, show_text=True))
with open("inventory_label.svg", "w") as f:
f.write(svg_content)शिपिंग लेबल
Code 128 और Code 39 शिपिंग और लॉजिस्टिक्स में व्यापक रूप से उपयोग किए जाते हैं। Code 39 सरल है (बड़े अक्षर, अंक, और कुछ प्रतीक) और पुराने सिस्टम में उपयोग होता है। Code 128 व्यापक अक्षर सेट का समर्थन करता है।
from aspose_barcode_foss import BarcodeService, RenderOptions
service = BarcodeService()
# Code 39 for a tracking number
barcode = service.generate("code39", "SHIP2026071234")
png_bytes = barcode.to_png(RenderOptions(dpi=300, show_text=True))
with open("shipping_label.png", "wb") as f:
f.write(png_bytes)रिटेल पॉइंट ऑफ़ सेल
EAN-13 और UPC-A रिटेल उत्पादों के लिए मानक सिम्बोलॉजीज़ हैं। EAN-13 अंतरराष्ट्रीय स्तर पर उपयोग होता है; UPC-A 12-अंकीय उत्तर अमेरिकी संस्करण है।
from aspose_barcode_foss import BarcodeService, RenderOptions
service = BarcodeService()
# EAN-13 for a product barcode (12 digits; check digit auto-computed)
barcode = service.generate("ean13", "590123412345")
svg_content = barcode.to_svg(RenderOptions(scale=3.0, show_text=True))
# UPC-A for a North American product
barcode_upc = service.generate("upca", "01234567890")
svg_upc = barcode_upc.to_svg(RenderOptions(scale=3.0, show_text=True))दस्तावेज़ ट्रैकिंग
Code 128 दस्तावेज़ ट्रैकिंग सिस्टम के लिए अच्छी तरह काम करता है जहाँ प्रत्येक दस्तावेज़ को एक अद्वितीय अल्फ़ान्यूमेरिक पहचानकर्ता मिलता है।
from aspose_barcode_foss import BarcodeService, RenderOptions
service = BarcodeService()
# Generate barcodes for a batch of documents
doc_ids = ["DOC-2026-001", "DOC-2026-002", "DOC-2026-003"]
for doc_id in doc_ids:
barcode = service.generate("code128", doc_id)
svg = barcode.to_svg(RenderOptions(scale=1.5, show_text=True))
filename = f"{doc_id.lower().replace('-', '_')}.svg"
with open(filename, "w") as f:
f.write(svg)URL और संपर्क एन्कोडिंग QR कोड्स के साथ
QR Code URLs, संपर्क जानकारी, और Wi-Fi क्रेडेंशियल सहित मनमाना टेक्स्ट डेटा एन्कोड करता है।
from aspose_barcode_foss import BarcodeService, RenderOptions
service = BarcodeService()
# QR Code for a URL
barcode = service.generate("qrcode", "https://products.aspose.org/barcode/")
png_bytes = barcode.to_png(RenderOptions(scale=4.0))
with open("url_qrcode.png", "wb") as f:
f.write(png_bytes)EAN-8 और UPC-E के साथ छोटे-आइटम लेबल
EAN-8 और UPC-E वे संक्षिप्त सिम्बोलॉजी हैं जो उन वस्तुओं के लिए हैं जहाँ स्थान सीमित है। EAN-8 7 या 8 अंकों का उपयोग करता है; UPC-E UPC-A का संकुचित संस्करण है।
from aspose_barcode_foss import BarcodeService, RenderOptions
service = BarcodeService()
# EAN-8 for a small product (7 digits; check digit auto-computed)
barcode = service.generate("ean8", "1234567")
svg = barcode.to_svg(RenderOptions(scale=2.0, show_text=True))अक्सर पूछे जाने वाले प्रश्न
मुझे कौन सी सिम्बोलॉजी चुननी चाहिए?
- अल्फ़ान्यूमेरिक डेटा (कोई भी अक्षर): Code 128
- केवल बड़े अक्षर, पुरानी प्रणालियाँ: Code 39
- रिटेल उत्पाद (अंतरराष्ट्रीय): EAN-13 या EAN-8
- रिटेल उत्पाद (उत्तरी अमेरिका): UPC-A या UPC-E
- URL, टेक्स्ट, बाइनरी डेटा: QR Code
क्या मैं बैच में बारकोड जेनरेट कर सकता हूँ?
हाँ। एक बार BarcodeService इंस्टेंस बनाएं और लूप में generate() को कॉल करें। प्रत्येक कॉल एक Barcode ऑब्जेक्ट लौटाता है जिसे आप स्वतंत्र रूप से to_svg() या to_png() के साथ रेंडर कर सकते हैं।
कौन से आउटपुट फॉर्मेट उपलब्ध हैं?
लाइब्रेरी to_svg() के माध्यम से SVG में रेंडर करती है और to_png() के माध्यम से PNG में। PDF रेंडरिंग अभी तक लागू नहीं हुई है।