Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
6261 มุมมอง

I used this in python file file  in onchange of a field  for code 39(another type of barcode)


from reportlab.pdfgen import canvas

from reportlab.lib.pagesizes import A4

from reportlab.lib.units import mm

#I"ll be generating code39 barcodes, others are available

from reportlab.graphics.barcode import code39

# generate a canvas (A4 in this case, size doesn"t really matter)

c=canvas.Canvas("/tmp/barcode_example.pdf",pagesize=A4)

# create a barcode object

# (is not displayed yet)

# The encode text is "123456789"

# barHeight encodes how high the bars will be

# barWidth encodes how wide the "narrowest" barcode unit is

barcode=code39.Extended39("123456789",barWidth=0.5*mm,barHeight=20*mm)

# drawOn puts the barcode on the canvas at the specified coordinates

barcode.drawOn(c,100*mm,100*mm)

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
มี.ค. 25
4388
4
ต.ค. 20
8721
1
พ.ย. 15
2650
1
ม.ค. 25
23077
3
ก.พ. 24
10196