Saditi
July 24, 2019, 6:48am
1
Qrcode not displaying.
I am using HTML, Jinja,JS.
For more clarification , you can check:
QRious is a simple, dependency-free JavaScript library which uses HTML5 canvas to generate QR codes with variable colors, sizes and error correction levels.
Est. reading time: 1 minute
HTML code:
<script type="text/javascript">
var qr = new QRious({
element: document.getElementById('qr'),
value: 'HEELO WORLD',
background: 'white', // background color
foreground: 'black', // foreground color
size: 100, // Size of the QR code in pixels.
padding: null // padding in pixels
});
</script>
Thanks in advance…
1 Like
Saditi
July 24, 2019, 9:20am
3
Thanks @hrwx for replying,
<td><div id="qrcode" width="200" height="200">hi</div></td>
<script src="qrcode.js"></script>
<script type="text/javascript">
var qrcode = new QRCode(document.getElementById("qrcode"), {
text: "Hello",
width: 50,
height: 50,
colorDark : "#000000",
colorLight : "#ffffff",
correctLevel : QRCode.CorrectLevel.H
});
</script>
I am trying to use this now, it is printing if I use html.
But if I use this with jinja, it will not display bar code…
Help with this.
Saditi
July 24, 2019, 9:41am
5
@hrwx , I tried first one but not working
Saditi
July 25, 2019, 7:47am
7
Thanks @hrwx ,
But can you explain this,
I mean which type of field to be included…
I am trying trying this code in html and jinja.
hrwx
July 25, 2019, 9:35am
8
Hey @Saditi
Do not change any code in html and jinja, itll break updates.
Follow the steps to add QR Code:
Lets consider you want to add QR Code in Item
.
Go to Customize Form → Item
Add QR Code
custom field and select HTML
as Type and Save it.
Now you need to add Custom Script to display the QR Code generated by qrious
.
I hope this resolves your doubt.
Regards
hrwX
Saditi
July 25, 2019, 10:35am
9
Thanks for replying @hrwx ,
But it didn’t work in my case…
Check this one, I have written my problem in detail
Hello everyone,
I am trying to print multiple qrcode label in print format.
I got labels between two given range but qrcode is not displaying in print format.
It should be displayed on the place of “hi”
Please help me if anything is wrong or how I can display qrcode…
[Screenshot_2019-07-25%209740ec2076(1)]
{% set c = frappe.get_doc("Hello", doc.hello) %}
{% set d = frappe.get_doc("Item",doc.item) %}
{% for i in range(doc.from_range,doc.to_range) %}
<!DOCTYPE html>
<html>
…