Skip to content

Commit

Permalink
Other output formats in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
finwe committed Jan 6, 2022
1 parent aa8a0d3 commit b3c35ac
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,17 @@ use Mpdf\QrCode\Output;

$qrCode = new QrCode('Lorem ipsum sit dolor');

// Save black on white PNG image 100 px wide to filename.png. Colors are RGB arrays.
$output = new Output\Png();

// Save black on white PNG image 100px wide to filename.png
$data = $output->output($qrCode, 100, [255, 255, 255], [0, 0, 0]);
file_put_contents('filename.png', $data);

// Echo a SVG file, 100 px wide, black on white.
// Colors can be specified in SVG-compatible formats
$output = new Output\Svg();
echo $output->output($qrCode, 100, 'white', 'black');

// Echo an HTML table
$output = new Output\Html();
echo $output->output($qrCode);
```

0 comments on commit b3c35ac

Please sign in to comment.