Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,21 @@ QRCode.toFile(

TypeScript users: if you are using [@types/qrcode](https://www.npmjs.com/package/@types/qrcode), you will need to add a `// @ts-ignore` above the data segment because it expects `data: string`.

## How To Save The QRcode as a PNG to your local Directory
```javascript
const QRCode = require('qrcode');
const fs = require('fs');

//The png is hence generated and stored under the images directory
QRCode.toFile('./images/qrcode.png', 'I am a pony!', function (err, url) {
if (err) {
console.error(err);
return;
}
console.log('QR code image saved as qrcode.png');
});
```

## Multibyte characters
Support for multibyte characters isn't present in the initial QR Code standard, but is possible to encode UTF-8 characters in Byte mode.

Expand Down