QRForge
QRForge is a QR code generator written in Rust. It supports generating QR codes in both raster (PNG) and vector (SVG) formats. The library provides a flexible builder pattern for creating QR codes with various parameters such as version, error correction level, and data segments.
Features
- Generate QR codes in PNG and SVG formats
- Support for different QR code versions and error correction levels
- Structured append for splitting data across multiple QR codes
- Optional parallel processing with Rayon
Installation
Add the following to your Cargo.toml:
[]
= "0.1.0"
To enable optional features:
[]
= { = "0.1.0", = ["image", "svg", "parallel"] }
Usage
Basic Usage
use ;
let qr = builder
.add_segment
.error_correction
.version
.build
.unwrap;
Generating a PNG Image
qr.image_builder
.set_width
.set_height
.set_border
.build_image_file
.unwrap;
Generating an SVG Image
qr.svg_builder
.set_width
.set_height
.set_border
.build_svg_file
.unwrap;
Structured Append
let qr_codes = builder
.add_segment
.add_segment
.error_correction
.version
.build_with_structual_append
.unwrap;
Examples
Examples can be found in the examples directory. To run an example, use the following command:
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contributing
Contributions are welcome! Please open an issue or submit a pull request.