Barkod Generasyon Kullanım Olayları

Barkod Generasyon Kullanım Olayları

Aspose.BarCode FOSS for Python (pip install aspose-barcode-foss) yedi sembolojiyi destekler: Kod 128, Kod 39, EAN-13, Ean-8, QR Kodu, UPC-A ve U PC-E. Bu makalede her bir için pratik senaryolar gösterilir.

Inventory Yönetimi

Kod 128, etiketler için yaygın bir seçimdir çünkü özel karakterler de dahil olmak üzere alfanumerik verileri kodlar. her öğe bir etkiye yazdırılan benzersiz bir tanımlayıcı alır.

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)

Denizcilik Etiketleri

Kod 128 ve kod 39 gemi ve lojistik alanında yaygın olarak kullanılır. kod 39. daha basit (yüksek harfler, rakamlar ve birkaç sembol) ve eski sistemlerde kullanılmıştır. kodu 128 daha geniş bir karakter setini destekler.

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)


---

```python
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)

Satış noktası

EAN-13 ve UPC-A, perakende ürünleri için standart sembollerdir.EAN-13, uluslararası alanda kullanılır; U PC- A 12 sayfalık Kuzey Amerika versiyonudır.

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


---

```python
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))

Doküman izleme

Kod 128 belge izleme sistemleri için iyi çalışır, her bir belgenin benzersiz bir alfanumerik tanımlayıcı alır.

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)


---

```python
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 ve İletişim QR Kodları ile Kodu

QR Kodu, URL’ler, iletişim bilgileri ve Wi-Fi kimlikleri dahil olmak üzere arzu edilen metin verilerini kodlar.

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)


---

```python
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 ve UPC-E ile küçük öğeler etiketleri

EAN-8 ve UPC-E, alanı sınırlı olan öğeler için kompakt sembollerdir. Ean-8 7 veya 8 sayısı kullanır; U PC-A bir kompres versiyonu olan UP-a’dır.

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


```python
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))

Sıkça Sorulan Sorular

Hangi simbolu seçmeliyim?

  • Alfanumerik veriler (her karakter): Kodu 128
  • Üstelik, miras sistemleri: Kod 39
  • Küçük Ürünler (Uluslararası Ürünü): EAN-13 veya Ean-8
  • Satış ürünleri (Kuzey Amerika) : UPC-A veya UCC-E
  • URL, metin ve ikili veriler: QR Kodu

Barkodları batch olarak üretebilir miyim?

Evet. oluşturmak için a BarcodeService Bir kez ve bir çağrı generate() Her arama bir aradan sonra geri döner. Barcode Bağımsız olarak yapabileceğiniz bir şey to_svg() veya to_png().

Hangi çıkış biçimleri mevcuttur?

Kütüphane, SVG’ye teslim edildi to_svg() PNG üzerinden to_png().PDF rendering henüz uygulanmamıştır.

See Also

 Türkçe