mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
All 181 docs markdown files translated into 20 languages (apps/docs/<locale>/**). Companion to the i18n code PR; admin-merged because the file count exceeds GitHub's per-PR CI trigger limit. Validated by pnpm i18n:check (all surfaces, 0 stale/missing) and a clean all-locale docs build.
2.1 KiB
2.1 KiB
description, i18n_source_hash, i18n_provenance, i18n_output_hash
| description | i18n_source_hash | i18n_provenance | i18n_output_hash |
|---|---|---|---|
| Hasilkan barcode dalam format Code 128, EAN-13, UPC-A, Code 39, ITF-14, dan Data Matrix. | e84b1df40c7e | human | e5c89973d5f0 |
Generator Barcode
Hasilkan gambar barcode dari input teks. Mendukung format Code 128, EAN-13, UPC-A, Code 39, ITF-14, dan Data Matrix.
API Endpoint
POST /api/v1/tools/image/barcode-generate
Menerima body application/json (bukan multipart). Barcode dihasilkan dari teks yang diberikan, bukan dari berkas yang diunggah.
Parameter
| Parameter | Tipe | Wajib | Bawaan | Deskripsi |
|---|---|---|---|---|
| text | string | Ya | - | Teks untuk dienkode dalam barcode (1-256 karakter) |
| type | string | Tidak | "code128" |
Format barcode: code128, ean13, upca, code39, itf14, datamatrix |
| scale | integer | Tidak | 3 |
Faktor skala gambar (1-8) |
| includeText | boolean | Tidak | true |
Apakah akan merender teks di bawah barcode |
Contoh Permintaan
curl -X POST http://localhost:1349/api/v1/tools/image/barcode-generate \
-H "Authorization: Bearer si_your-api-key" \
-H "Content-Type: application/json" \
-d '{"text": "5901234123457", "type": "ean13", "scale": 4}'
Contoh Respons
{
"jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"downloadUrl": "/api/v1/download/a1b2c3d4-e5f6-7890-abcd-ef1234567890/barcode.png",
"originalSize": 0,
"processedSize": 4520
}
Catatan
- Berbeda dari kebanyakan alat, endpoint ini menerima body JSON, bukan data formulir multipart, karena barcode dihasilkan dari teks alih-alih berkas yang diunggah.
- EAN-13 memerlukan tepat 12 atau 13 digit. UPC-A memerlukan tepat 11 atau 12 digit. Jika digit cek dihilangkan, digit tersebut dihitung secara otomatis.
- Code 128 adalah format paling fleksibel dan mendukung seluruh set karakter ASCII.
- Data Matrix menghasilkan barcode 2D yang cocok untuk mengenkode string yang lebih panjang dalam persegi yang kompak.