Has anyone successfully printed a QR barcode using...
# advancedpdf
c
Has anyone successfully printed a QR barcode using BFO barcode tag? I've tried SA: 38499 and it just prints a big wall of text for me and no QR code. Still says the barcode and qrcode property are valid on the BFO site.
Copy code
<?xml version="1.0"?>
<!DOCTYPE pdf PUBLIC "-//big.faceless.org//report" "report-1.1.dtd">
<pdf>
    <body padding="0.5in 0.5in 0.5in 0.5in" size="Letter">
		<barcode codetype="qrcode" showtext="false" height="150" width="150" value="123456"/>
    </body>
</pdf>
I load the contents, set w/ renderer and render as pdf. What i get is a wall of text that isn't a qr code. Should be a super simple example but it doesn't work
Copy code
var templateFile = file.load({
                id: 8861
            });

            var renderer = render.create();

            renderer.templateContent = templateFile.getContents();
            
            var palletPDF = renderer.renderAsPdf();
            
            context.response.writeFile(palletPDF);
w
I have created a QR-code on a standard transaction-print with success with the following code:
Copy code
<#assign qrcode=
'{' +  
'"uqr":1,' +  
'"tp":1,' + 
'"nme":"' + record.subsidiary + '",' +  
'"cid":"' + subsidiary.federalidnumber + '",' +  
'"iref":"' + record.tranid + '",' +  
'"ddt":"' + record.duedate?string["yyyyMMdd"] + '",' + 
'"due":' + record.total?string.computer + ',' +  
'"pt":"BG",' + 
'"acc":"' + subsidiary.custrecord_sub_bankgiro + '"' + 
'}' 
/>
<p>${qrcode}</p>
<barcode codetype="qrcode" width="100px" height="100px" value='${qrcode}'/>
message has been deleted
c
Thanks @Watz. I wound up using a qrcode js library instead which worked well. I'll try this again maybe I just failed somewhere in syntax.
I tried this again with your code (and just some test data for qrcode) and its still printing out text.
Not sure whats going on there. Going to just use the JS library approach and avoid it
must have had a typo somewhere. Its working now w/ native <barcode> tag
👍 1
w
It's always those pesky typos