Qr Demo
Item QR/Barcode Generator & Printor
- Author: Omar25Muhammad
- Repository: https://github.com/Omar25Muhammad/qr_demo
- GitHub stars: 1
- Forks: 2
- License: MIT
- Category: Other
- Maintenance: Unmaintained
Install Qr Demo
bench get-app https://github.com/Omar25Muhammad/qr_demo
Add the Frappe Gems badge to your README
Maintain Qr Demo? Paste this into your README:
[](https://frappegems.com/gems/apps/Omar25Muhammad/qr_demo)
About Qr Demo
## QR Demo
Demo app for printing QR Codes.
This app contains a DocType **QR Demo**. You can create a new **QR Demo**, fill the _Title_ field and save.
In the backend, the title is converted to a QR code image with these steps:
1. Create QR code, using https://pypi.org/project/qrcode/
2. Convert the raw bytes of QR code to a base64 encoded string
3. Add info about filetype and encoding for the browser
4. Save the QR Code data in the field _QR Code_

The **QR Demo** DocType also has a field _QR Image_, which just displays the data stored in _QR Code_.
> Note: In a production application, you'll want to set the field _QR Code_ as hidden, so the user doesn't see the raw data.
Try to print the document, using the print format "QR Demo". The QR code will work flawlessly in print preview and PDF. The print format is very simple. It uses the data from _QR Code_ like this:
```jinja
```
For cases when we need dynamic QR codes, that are not stored in the document, we can generate them ad-hoc by calling `get_qr_code` in the print format:
```jinja
```
We achieved this by adding the `get_qr_code()` method to the `jinja` configuration in our `hooks.py` file, like this:
```python
jinja = {
"methods": [
"qr_demo.qr_code.get_qr_code"
],
}
```
### Print Preview

### Print PDF

QR Code stored in field QR Code:
QR Code generated ad-hoc:
Related Other apps for Frappe & ERPNext
- Erpnext — Free and Open Source Enterprise Resource Planning (ERP)
- Helpdesk — Modern, Streamlined, Free and Open Source Customer Service Software
- Print Designer — Visual print designer for Frappe / ERPNext
- Ctr — CTR模型代码和学习笔记总结
- Whitelabel — Whitelabel ERPNext
- Fossunited — fossunited.org
- Helm — Helm Chart Repository for Frappe/ERPNext
- Frappe Attachments S3 — A frappe app to upload file attachments in doctypes to s3.