I want to create a barcode using a script "Traditional Web" (I don't want to use Forge components) What is the best way?
As I suspected, the JS resource isn't being loaded, hence the error "JsBarcode is not defined".
Please check that the path in the JS resource matches the path of the script src.
Hi Raquel,
This is an easy to use JS library that generates bar codes https://lindell.me/JsBarcode/.
Cheers
Hi David !!
I created the script below, in my personal environment it is working perfectly, however in the business environment the barcode does not appear.
Do you have any idea what's going on?
"
"<script src='../BarcodeGenerator/js/BarcodeGenerator.JS' type='text/javascript'></script> <svg id ='barcodeSvg'></svg> <script type='text/javascript'> JsBarcode('#" + BarcodeContainer.Id + " #barcodeSvg', '" + EncodeJavaScript(BarcodeValue) + "', { format: '" + Format + "', width: " + Width + ", height: " + Height + ", displayValue: " + ToLower(BooleanToText(DisplayValue)) + ", text: '" + Text + "', fontOptions: '" + FontOptions + "', font: '" + Font + "', textAlign: '" + TextAlign + "', textPosition: '" + TextPosition + "', textMargin: " + TextMargin + ", fontSize: " + FontSize + ", background: '" + Background + "', lineColor: '" + LineColor + "', margin: " + Margin + ", marginTop: " + MarginTop + ", marginBottom: " + MarginBottom + ", marginLeft: " + MarginLeft + ", marginRight: " + MarginRight + ", valid: " + Valid + " }); </script>"
Hi again,
Please doublecheck the following:
1) Do you have any errors in the browser console?
2) Is the script source correct in the business environment? Does the JS resource have the correct deploy action?
Another thing I noticed is that if you are already adding a SVG element in the script, you don't need to have another container to render the barcode.
Hope it helps you sort the problem!
Google Chrome returned these errors
I modified the path of the script src and it worked
Thanks
Hi i am looking for something like this , can someone share with me how do you implement this.
Thank you in advance :)