javascriptdymo

pass variable to function: var image = dymo.label.framework.loadImageAsPngBase64(variable);


How can I pass a filename variable into the following line?

var image = dymo.label.framework.loadImageAsPngBase64("http://www.example.com/label.png");

The following obviously doesn't work, tried single quotes and several different variations but none of it worked.

var file_name = "label.png";
var image = dymo.label.framework.loadImageAsPngBase64("http://www.example.com/" + file_name + ");

Solution

  • Solved: issue was with the variable in the script. It was an object so I had to add .value to obtain to obtain the value.