mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-10-08 21:05:50 +00:00
📖
This commit is contained in:
@@ -173,7 +173,7 @@ $output = $qrcode->render();
|
||||
$qrcode->render(null, '/path/to/qrcode.svg');
|
||||
```
|
||||
|
||||
The [`QRDataModeInterface`](https://github.com/chillerlan/php-qrcode/blob/main/src/Data/QRDataModeInterface.php) offers the `validateString()` method (implemended for `AlphaNum`, `Byte`, `Hanzi`, `Kanji` and `Number`).
|
||||
The [`QRDataModeInterface`](https://github.com/chillerlan/php-qrcode/blob/main/src/Data/QRDataModeInterface.php) offers the `validateString()` method (implemented for `AlphaNum`, `Byte`, `Hanzi`, `Kanji` and `Number`).
|
||||
This method is used internally when a data mode is invoked, but it can come in handy if you need to check input data beforehand.
|
||||
|
||||
```php
|
||||
@@ -185,33 +185,6 @@ $qrcode->addHanziSegment($data);
|
||||
```
|
||||
|
||||
|
||||
### QR Code reader
|
||||
|
||||
In some cases it might be necessary to increase the contrast of a QR Code image:
|
||||
|
||||
```php
|
||||
$options->readerUseImagickIfAvailable = true;
|
||||
$options->readerIncreaseContrast = true;
|
||||
$options->readerGrayscale = true;
|
||||
|
||||
$qrcode = new QRCode($options);
|
||||
|
||||
$result = $qrcode->readFromFile('path/to/qrcode.png');
|
||||
$result = $qrcode->readFromBlob($imagedata);
|
||||
```
|
||||
|
||||
The `QRMatrix` object from the [`DecoderResult`](https://github.com/chillerlan/php-qrcode/blob/main/src/Decoder/DecoderResult.php) can be reused:
|
||||
|
||||
```php
|
||||
$matrix = $result->getQRMatrix();
|
||||
|
||||
// ...matrix modification...
|
||||
|
||||
$output = (new QRCode($options))->renderMatrix($matrix);
|
||||
|
||||
// ...output
|
||||
```
|
||||
|
||||
## Common output options
|
||||
|
||||
### Save to file
|
||||
@@ -266,16 +239,3 @@ $imagick = $qrcode->render($data);
|
||||
|
||||
echo $imagick->getImageBlob();
|
||||
```
|
||||
|
||||
|
||||
### Add a logo space
|
||||
|
||||
|
||||
```php
|
||||
$options->addLogoSpace = true;
|
||||
$options->logoSpaceWidth = 9;
|
||||
$options->logoSpaceHeight = 9;
|
||||
$options->logoSpaceStartX = 10;
|
||||
$options->logoSpaceStartY = 10;
|
||||
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user