I have a barcode on my mastersheet but under certain circumstances I want to move it to a different position.
I am using the following script
var field, result = “”;
field = record.fields.MatchingBarcode;
if (field !== “”) result += field;
xpos = record.Matching_Barcode_XY.substr(0, 5)
ypos = record.Matching_Barcode_XY.substr(6, 5)
this.attr(“offset-x”,xpos*37.79);
this.attr(“offset-y”,ypos*37.79);
this.text(result);
When Previewing the mastersheet this works and the barcode moves according to the values but when looking at the section calling this mastersheet the barcode does not move.
Changing the position of a barcode element by changing the value of the attributes offset-x and offset-y only works for barcode elements in sections. Instead, you may need to change the values of the CSS properties top and left as for barcode elements in master pages. This can be done by code like this, for example:
this.css({"top": "100px", "left": "100px"});
Tip: Please check the OL Connect 2024.2 Help for more information about the css() method.
Marten is correct. Just to add a bit more info: Master page elements used to be affected by changes to offset-x and offset-y while a master page editor was active (preview mode), but this made no sense. This confusing bug was fixed in 2024.1.