#barcode #hub3 #pdf417 #croatia

pdf417-hub3-rs

A 2D barcode generator of PDF417 HUB3 based on rxing

3 releases

0.2.3 Aug 9, 2024
0.2.2 May 5, 2024
0.2.1 May 5, 2024
0.2.0 May 1, 2024
0.1.0 May 1, 2024

#22 in #barcode

Download history 81/week @ 2024-08-03 32/week @ 2024-08-10 1/week @ 2024-08-17 12/week @ 2024-09-14 11/week @ 2024-09-21 8/week @ 2024-09-28 1/week @ 2024-10-05

314 downloads per month

GPL-3.0-or-later

21KB
536 lines

PDF417 HUB3 in Rust

pdf417-hub3-rs is a 2D barcode generator of PDF417 HUB3 written in Rust and based on rxing - cRustacean Crossing. The barcode format / specification is defined here.

// data required for the barcode payment
let data = PaymentOrder::new(
        "EUR".into(), // currency
        Decimal::from(10 * 100), // total amount in cents
        Sender::new(
            "JOHN SMITH".into(), // name, surname
            "SOMEWHERE OVER THE RAINBOW".into(), // address
            "KRIŽEVCI".into(), // city
            ),
        Receiver::new(
            "UNKNOWN ENTITY".into(), // name, surname
            "TRG SV. FLORIJANA 16".into(), // address
            "48260 KRIŽEVCI".into(), // city
            "HR000000000000000000".into(), // IBAN
            "HR00".into(), // model
            ),
        "0001".into(), // check/call number
        "OTHR".into(), // type
        "Some reason for the payment".into(), // description
);

let barcode = generate(data).unwrap();

// save it to multiple formats
let _ = save("barcode.pdf", &barcode);
let _ = save("barcode.svg", &barcode);
let _ = save("barcode.png", &barcode);

Alternative implementations

Dependencies

~12–18MB
~302K SLoC