Download a Html Encoded QR code
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2024 05:33 AM - edited ‎01-24-2024 05:37 AM
Hi i have created a Qr code using ui script and ui macro and have displayed it in the portal using widget ,now it is displaying i hvae added one button download ,my requirement is to download the qr code on clicking the button
Main point is qr code is not getting stored anywhere ,and we are unable to convert it to base 64
Need solution for downloading this dynamic qr code
HTML
<div>
<h3>
Details of Postage Label:
</h3>
<!-- your widget template -->
<div ng-if="data.show" id="qrcode"></div>
<br/>
<a target="_new" href="/{{data.f.table}}.do?PDF&sys_id={{data.sys_id}}&sysparm_view={{data.f.view}}" tabindex="-1">${Download}</a>
<script src=
"https://cdnjs.cloudflare.com/ajax/libs/qrcodejs/1.0.0/qrcode.min.js">
</script>
</div>
CLIENT SCRIPT
api.controller=function($scope,$timeout) {
/* widget controller */
var c = this;
//$j('#qrcode').qrcode('hello');
$scope.$watch('$viewContentLoaded', function() {
$timeout(function() {
new QRCode(document.getElementById("qrcode"), document.URL);
}, 2000);
});
};
SERVER SCRIPT
(function() {
/* populate the 'data' object */
/* e.g., data.table = $sp.getValue('table'); */
data.show = $sp.getParameter('sys_id') == -1 ? false : true;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-30-2024 08:13 AM
Hi abhi56 - I don't have an answer to your direct question. However, Yansa Labs offers a QR/Barcode Generator app that can expose QR Codes in any ServiceNow interface, and also allows downloading that QR Code. If you're still stuck, this could meet your requirement. The links below may be helpful. Feel free to reach out to me at ben@yansalabs.com with any questions!