dymosoftware / dymo-connect-framework

DYMO Connect Framework for Javascript.
Other
88 stars 54 forks source link

Changing images with LabelSetBuilder doesn't work! #25

Open erkens opened 3 years ago

erkens commented 3 years ago

I have "upgraded" to Dymo Connect Framework for Javascript (coming from Dymo Label Framework) but using the LabelSetBuilder to change an image in the label doesn't work.

let dymoLabel = dymo.label.framework.openLabelXml(labelXml);
let labelSetBuilder = new dymo.label.framework.LabelSetBuilder();

// for multiple labels I need to change text and a photo, so next part is in a loop to change labelImageBase64 and labelText
let labelRecord = labelSetBuilder.addRecord();
labelRecord.setBase64Image('PHOTO', labelImageBase64));
labelRecord.setText('TEXT', labelText);

dymoLabel.print(printersSelect.val(), '', labelSetBuilder.toString());

For one label I can just change the label ietself with the setters, but printing will be slow because then there are multiple print calls instead of one. In the old system it did work and the documentation is not clear...

fubaristic commented 2 years ago

I too am having trouble changing the image with setBase64Image().

A simple test is as follows, using DYMO Connect 1.3.2. I load the label from a file and use dymo.label.framework.printLabel(printerName, printParamsXml, labelXml, labelSetXml).

Note that I am using the same javascript with DLS and labels created in v8.7.2 and the replacement image has always worked fine.