You can set it to output to canvas
then use something like this to save it as image:
HTML:
<a id="download" download="barcode.png">Download as image</a>
And in your Javascript:
function download() {
var dt = canvas.toDataURL();
this.href = dt;
}
var canvas = document.getElementById('myCanvasId');
document.getElementById('download').addEventListener('click', download, false);
When you now click the download as image button it will generate a PNG image file that you can save to disk.