How to hide text under QR Code image

chanikya
Tera Guru

Hi,

i would like to hide text under QR Code image

1.can i hide text under barcode image????   

2.Can i change QR code type to BAR Code type (||||) format??

find_real_file.png

If you please check it in my PDI, if you are with that

UI Action: Show Barcode   ,  UI Script:prototype-barcode       UI Page: barcode_gen

https://dev64572.service-now.com,

Test  /  123

 

 

Thanks.

1 ACCEPTED SOLUTION

David Ramirez
Kilo Guru

Hi!

 

Based on the documentation of the plugin you are using, you need to configure the type of barcode you wish to use on the UI Page client script along with settings such as bar size, color, positioning and whether you wish to see the text under the barcode.

 

the correct line would be something like this:

$("bcTarget").barcode( $('mydata').value, "code128",{"barWidth":1, "barHeight":50, "showHRI":false});

 

Please note that not all barcode readers can read all barcode standards, and some of them are numeric-only, try to experiment with the actual barcode readers you intend to use.

 

To see the full set of settings:

http://barcode-coder.com/en/barcode-jquery-plugin-201.html

 

To experiment with how you wish your barcode to look like:

http://barcode-coder.com/en/barcode-online-generator-2.html

 

I took the liberty to implement this in your test instance with the original setting commented out

 

Regards,

 

David

View solution in original post

7 REPLIES 7

You can only send the parameter "sysparm_data" once, so I would actually do it like this:

 

function generateBar() {

var myBarcodeText = g_form.getValue('serial_number') + " - "+g_form.getValue('asset_tag')+" - "+g_form.getValue('manufacture');
// you should add something like a dash or semicolon to separate each value
var w = new GlideDialogWindow('barcode_gen');
w.setTitle('Barcode Information');
w.setPreference('sysparm_data',myBarcodeText);
w.render(); 
}

Just applied the text to your instance, final code on the UI Action looks like this:

function generateBar() {	
	var myBarcodeText = g_form.getValue('serial_number') + " - "+g_form.getValue('asset_tag')+" - "+g_form.getDisplayBox('manufacturer').value;
	// you should add something like a dash or semicolon to separate each value
	var w = new GlideDialogWindow('barcode_gen');
	w.setTitle('Barcode Information');
	w.setPreference('sysparm_data',myBarcodeText);
	w.render();
}

and the result looks like this (I'm showing text underneath to validate easier):

find_real_file.png

 

it is very wonderful information here.

 

Thanks a lot David