內容簡介
Barcodegen 是一款能在 WordPress 中生成條碼的外掛。使用者只需輸入數值並選擇格式,即可獲得清晰的向量條碼,適用於產品頁面、包裝單、發票等多種用途。
【主要功能】
• 支援六種條碼格式生成
• 生成的條碼為清晰的向量圖形
• 無需外部請求,保護隱私與性能
• 可使用短碼或區塊輕鬆插入條碼
• 自動計算檢查碼,減少錯誤
外掛標籤
開發者團隊
② 後台搜尋「Barcodegen – Barcode Generator」→ 直接安裝(推薦)
原文外掛簡介
Barcodegen adds real barcodes to WordPress. Type a value, pick a format, and you get a clean vector barcode that prints sharply at any size — product pages, packing slips, invoices, tickets, shelf labels, asset tags, anything.
Six formats, generated locally
EAN-13 — retail products worldwide (12 or 13 digits, check digit calculated for you)
EAN-8 — small retail packages
UPC-A — retail products in the US and Canada
Code 128 — the all purpose format for internal codes, tickets and documents, with automatic code set selection (A/B/C) and the correct check digit
Code 39 — still common on older industrial equipment
ITF-14 — cartons and shipping labels, with the GTIN-14 check digit
How it renders
Every barcode is written as inline SVG by PHP. There is no image file to manage, no JavaScript, and no canvas: the bars stay sharp on retina screens and come out of a laser printer perfectly. Guard bars extend below the digit row and the number system digits sit in the quiet zones, so EAN-13 and UPC-A output looks like a real retail label, not a screenshot.
Three ways to add one
The [barcodegen] shortcode, with attributes for every option.
The Barcode block, with a live preview in the editor.
Tools → Barcode Generator in your dashboard, which also hands you a ready made shortcode.
Privacy and performance
Nothing is sent anywhere. There are no external requests, no trackers, no cookies and no third party libraries — the encoders are about a thousand lines of PHP written for this plugin. Barcodes render on the server, so they work in feeds and emails and add nothing to your page weight budget.
Shortcode
[barcodegen format="ean13" value="5901234123457"]
Every attribute is optional except the value:
format — code128 (default), code39, ean13, ean8, upca or itf14. The advanced values code128a, code128b, code128c and itf are accepted too
scale — module width in pixels, 0.5 to 10 (default 2)
height — bar height in pixels (default 60)
text — print the value under the bars, “yes” or “no”
bar_color — any CSS colour, default #000000
bg_color — any CSS colour, or “transparent”
padding — extra space around the bars, in pixels
class — extra CSS class on the SVG
align — left, center or right
Enclosed content also works, which is handy when the value contains quotes:
[barcodegen format="code39"]HELLO WORLD[/barcodegen]
If a value cannot be encoded — a five digit EAN-13, a lower case letter in Code 39 — you will see the reason while editing and visitors will see nothing at all.
Formats
What each format accepts, so you get it right the first time.
code128 — ASCII 0-127, any length. The check digit is calculated for you. The default, and the best choice for internal codes.
code39 — digits, A-Z and – . space $ / + %. Lower case is converted to upper case for you.
ean13 — 12 digits, or 13 with the check digit. A wrong check digit is corrected rather than printed.
ean8 — 7 digits, or 8 with the check digit.
upca — 11 digits, or 12 with the check digit.
itf14 — 13 digits, or 14 with the check digit. Cartons and shipping labels.
Non-digit characters are stripped from EAN, UPC and ITF values, so 590-1234-123457 encodes exactly like 5901234123457. Values with accents or non-Latin characters are rejected by Code 128 and accepted by Code 39 only if they are in the Latin-1 range.
