All Projects → endroid → Qr Code

endroid / Qr Code

Licence: mit
QR Code Generator

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to Qr Code

qrrs
CLI QR code generator and reader written in rust
Stars: ✭ 29 (-99.18%)
Mutual labels:  qrcode, reader
Qreader
🔳 [Android Library] Read QR codes using google's mobile vision api, but without the hassle
Stars: ✭ 358 (-89.83%)
Mutual labels:  reader, qrcode
Qr Code Bundle
Bundle for generating QR codes in Symfony
Stars: ✭ 169 (-95.2%)
Mutual labels:  qrcode, factory
barcode scan2
[reborned barcode_scan] A flutter plugin for reading 2D barcodes and QR codes.
Stars: ✭ 43 (-98.78%)
Mutual labels:  qrcode, reader
Esp Rfid Tool
A tool for logging data/testing devices with a Wiegand Interface. Can be used to create a portable RFID reader or installed directly into an existing installation. Provides access to a web based interface using WiFi in AP or Client mode. Will work with nearly all devices that contain a standard 5V Wiegand interface. Primary target group is 26-37bit HID Cards. Similar to the Tastic RFID Thief, Blekey, and ESPKey.
Stars: ✭ 262 (-92.55%)
Mutual labels:  reader
rqrcode core
A Ruby QRCode encoding library
Stars: ✭ 34 (-99.03%)
Mutual labels:  qrcode
qrencode.cr
Crystal bindings for libqrencode (qrencode), a library for QR code generation
Stars: ✭ 28 (-99.2%)
Mutual labels:  qrcode
covidpass
Scan your vaccination, test and recovery certificates in QR code representation and save them to your Apple Wallet
Stars: ✭ 137 (-96.11%)
Mutual labels:  qrcode
Swiftscan
A barcode and qr code scanner( 二维码/条形码扫描、生成,仿微信、支付宝)
Stars: ✭ 293 (-91.67%)
Mutual labels:  qrcode
Friendbook
📕 "友书" 小说阅读app
Stars: ✭ 275 (-92.19%)
Mutual labels:  reader
Xreader
XML, NEWS, RSS & Scrapping Reader maked in Xamarin, for educational purpose.
Stars: ✭ 259 (-92.64%)
Mutual labels:  reader
UniqR
Yet another QR art library for Java
Stars: ✭ 22 (-99.37%)
Mutual labels:  qrcode
Rewtro
Papercraft videogame cartridges you can print and pirate with a copy machine.
Stars: ✭ 267 (-92.41%)
Mutual labels:  qrcode
valid-data-url
Detect if a string is a data URL
Stars: ✭ 17 (-99.52%)
Mutual labels:  data-uri
Angularx Qrcode
Angular4/5/6/7/8/9/10/11 QRCode generator component library for QR Codes (Quick Response) with AOT support based on node-qrcode
Stars: ✭ 281 (-92.01%)
Mutual labels:  qrcode
ZATCA
An unofficial package maintained by Salla to help developers to implement ZATCA (Fatoora) QR code easily which required for e-invoicing
Stars: ✭ 77 (-97.81%)
Mutual labels:  qrcode
Duareader
电子书阅读器,支持txt,e-pub(图文混排),纯swift编写,支持OC混编。 An e-book reader that supports TXT and e-pub formats. This project is written in swift and supports hybrid compilation with objective OC
Stars: ✭ 258 (-92.67%)
Mutual labels:  reader
Asmresolver
A library for editing PE files with full .NET metadata support
Stars: ✭ 267 (-92.41%)
Mutual labels:  reader
React Reader
An ePub-reader for React, powered by Epub.js
Stars: ✭ 256 (-92.73%)
Mutual labels:  reader
Mimanganu
*ES - Lector de Manga online / offline, gratuito y de código abierto. *EN - Manga reader online / offline, free and open source. *FR - Lecteur de manga en ligne / hors ligne, gratuit et open source. *DE - Eine App um Manga zu lesen. Man kann damit Manga online und offline lesen. Es ist kostenlos und quelloffen. *IT - Manga lettore online / offline, gratuito e open source. *RU - В России Манга читает вас. Попробуйте MiMangaNu прямо сейчас.
Stars: ✭ 255 (-92.75%)
Mutual labels:  reader

QR Code

By endroid

Latest Stable Version Build Status Total Downloads Monthly Downloads License

Buy Me A Coffee

This library helps you generate QR codes in a jiffy. Makes use of bacon/bacon-qr-code to generate the matrix and khanamiryan/qrcode-detector-decoder for validating generated QR codes. Further extended with Twig extensions, generation routes, a factory and a Symfony bundle for easy installation and configuration. Different writers are provided to generate the QR code as PNG, SVG, EPS or in binary format.

Installation

Use Composer to install the library. Also make sure you have enabled and configured the GD extension if you want to generate images.

$ composer require endroid/qr-code

Usage: using the builder

use Endroid\QrCode\Builder\Builder;
use Endroid\QrCode\Encoding\Encoding;
use Endroid\QrCode\ErrorCorrectionLevel\ErrorCorrectionLevelHigh;
use Endroid\QrCode\Label\Alignment\LabelAlignmentCenter;
use Endroid\QrCode\Label\Font\NotoSans;
use Endroid\QrCode\RoundBlockSizeMode\RoundBlockSizeModeMargin;
use Endroid\QrCode\Writer\PngWriter;

$result = Builder::create()
    ->writer(new PngWriter())
    ->writerOptions([])
    ->data('Custom QR code contents')
    ->encoding(new Encoding('UTF-8'))
    ->errorCorrectionLevel(new ErrorCorrectionLevelHigh())
    ->size(300)
    ->margin(10)
    ->roundBlockSizeMode(new RoundBlockSizeModeMargin())
    ->logoPath(__DIR__.'/assets/symfony.png')
    ->labelText('This is the label')
    ->labelFont(new NotoSans(20))
    ->labelAlignment(new LabelAlignmentCenter())
    ->build();

Usage: without using the builder

use Endroid\QrCode\Color\Color;
use Endroid\QrCode\Encoding\Encoding;
use Endroid\QrCode\ErrorCorrectionLevel\ErrorCorrectionLevelLow;
use Endroid\QrCode\QrCode;
use Endroid\QrCode\Label\Label;
use Endroid\QrCode\Logo\Logo;
use Endroid\QrCode\RoundBlockSizeMode\RoundBlockSizeModeMargin;
use Endroid\QrCode\Writer\PngWriter;

$writer = new PngWriter();

// Create QR code
$qrCode = QrCode::create('Data')
    ->setEncoding(new Encoding('UTF-8'))
    ->setErrorCorrectionLevel(new ErrorCorrectionLevelLow())
    ->setSize(300)
    ->setMargin(10)
    ->setRoundBlockSizeMode(new RoundBlockSizeModeMargin())
    ->setForegroundColor(new Color(0, 0, 0))
    ->setBackgroundColor(new Color(255, 255, 255));

// Create generic logo
$logo = Logo::create(__DIR__.'/assets/symfony.png')
    ->setResizeToWidth(50);

// Create generic label
$label = Label::create('Label')
    ->setTextColor(new Color(255, 0, 0));

$result = $writer->write($qrCode, $logo, $label);

Usage: working with results

// Directly output the QR code
header('Content-Type: '.$result->getMimeType());
echo $result->getString();

// Save it to a file
$result->saveToFile(__DIR__.'/qrcode.png');

// Generate a data URI to include image data inline (i.e. inside an <img> tag)
$dataUri = $result->getDataUri();

QR Code

Writer options

use Endroid\QrCode\Writer\SvgWriter;

$builder->setWriterOptions([SvgWriter::WRITER_OPTION_EXCLUDE_XML_DECLARATION => true]);

Encoding

If you use a barcode scanner you can have some troubles while reading the generated QR codes. Depending on the encoding you chose you will have an extra amount of data corresponding to the ECI block. Some barcode scanner are not programmed to interpret this block of information. To ensure a maximum compatibility you can use the ISO-8859-1 encoding that is the default encoding used by barcode scanners (if your character set supports it, i.e. no Chinese characters are present).

Round block size mode

By default block sizes are rounded to guarantee sharp images and improve readability. However some other rounding variants are available.

  • margin (default): the size of the QR code is shrunk if necessary but the size of the final image remains unchanged due to additional margin being added.
  • enlarge: the size of the QR code and the final image are enlarged when rounding differences occur.
  • shrink: the size of the QR code and the final image are shrunk when rounding differences occur.
  • none: No rounding. This mode can be used when blocks don't need to be rounded to pixels (for instance SVG).

Readability

The readability of a QR code is primarily determined by the size, the input length, the error correction level and any possible logo over the image so you can tweak these parameters if you are looking for optimal results. You can also check $qrCode->getRoundBlockSize() value to see if block dimensions are rounded so that the image is more sharp and readable. Please note that rounding block size can result in additional padding to compensate for the rounding difference. And finally the encoding (default UTF-8 to support large character sets) can be set to ISO-8859-1 if possible to improve readability.

Built-in validation reader

You can enable the built-in validation reader (disabled by default) by calling setValidateResult(true). This validation reader does not guarantee that the QR code will be readable by all readers but it helps you provide a minimum level of quality. Take note that the validator can consume quite amount of additional resources and it should be installed separately only if you use it.

Symfony integration

The endroid/qr-code-bundle integrates the QR code library in Symfony for an even better experience.

  • Configure your defaults (like image size, default writer etc.)
  • Support for multiple configurations and injection via aliases
  • Generate QR codes for defined configurations via URL like /qr-code//Hello
  • Generate QR codes or URLs directly from Twig using dedicated functions

Read the bundle documentation for more information.

Versioning

Version numbers follow the MAJOR.MINOR.PATCH scheme. Backwards compatibility breaking changes will be kept to a minimum but be aware that these can occur. Lock your dependencies for production and test your code when upgrading.

License

This bundle is under the MIT license. For the full copyright and license information please view the LICENSE file that was distributed with this source code.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].