Copying barcodes

If in my template I cut and paste a barcode in svg format (I want 2 copies of the barcode on the page), the new barcode can appear in the source in “expanded” format. This code should show what I mean. Here is the original barcode

> <div id="barcode" anchor="page_media_0"
> data-params="{&quot;textPosition&quot;:&quot;BOTTOM&quot;,&quot;fontFamily&quot;:&quot;Arial&quot;,&quot;backColor&quot;:&quot;#FFFFFF&quot;,&quot;codeSet&quot;:&quot;A&quot;,&quot;showText&quot;:true,&quot;moduleWidth&quot;:0.03,&quot;processTilde&quot;:true,&quot;scale&quot;:0,&quot;fontSize&quot;:8,&quot;barColor&quot;:&quot;#000000&quot;,&quot;outputFormat&quot;:&quot;SVG&quot;}"
> style="width: 269px; height: 58px; position: absolute; left: 299.966px; top: 65.8976px; text-align: right;"
> type="com.objectiflune.connect.addin.barcodes.code128" offset-x="318.8659996185303" offset-y="84.79759961853027">
>     <br>
> </div>

And here is the copy

<div id="barcode" anchor="page_media_0"
data-params="{&quot;textPosition&quot;:&quot;BOTTOM&quot;,&quot;fontFamily&quot;:&quot;Arial&quot;,&quot;backColor&quot;:&quot;#FFFFFF&quot;,&quot;codeSet&quot;:&quot;A&quot;,&quot;showText&quot;:true,&quot;moduleWidth&quot;:0.03,&quot;processTilde&quot;:true,&quot;scale&quot;:0,&quot;fontSize&quot;:8,&quot;barColor&quot;:&quot;#000000&quot;,&quot;outputFormat&quot;:&quot;SVG&quot;}"
style="width: 269px; height: 58px; position: absolute; left: 299.966px; top: 65.8976px; text-align: right;"
type="com.objectiflune.connect.addin.barcodes.code128" offset-x="318.8659996185303" offset-y="84.79759961853027">
    <svg xmlns="http://www.w3.org/2000/svg" width="233"
    style="fill-opacity:1; color-rendering:auto; color-interpolation:auto; text-rendering:auto; stroke:black; stroke-linecap:square; stroke-miterlimit:10; shape-rendering:auto; stroke-opacity:1; fill:black; stroke-dasharray:none; font-weight:normal; stroke-width:1; font-family:'Dialog'; font-style:normal; stroke-linejoin:miter; font-size:12; stroke-dashoffset:0; image-rendering:auto;" height="58" xlink="http://www.w3.org/1999/xlink">
        <defs id="genericDefs"></defs>
        <g>
            <g style="fill:white; stroke:white;"><rect width="233" x="0" y="0" style="stroke:none;" height="58"></rect></g>
            <g style="font-family:'Arial'; font-size:10;">
                <rect width="2" x="0" y="0" style="stroke:none;" height="40"></rect>
                <rect width="1" x="3" y="0" style="stroke:none;" height="40"></rect>
                <rect width="1" x="8" y="0" style="stroke:none;" height="40"></rect>
                <rect width="1" x="11" y="0" style="stroke:none;" height="40"></rect>
                <rect width="3" x="13" y="0" style="stroke:none;" height="40"></rect>
                <rect width="2" x="19" y="0" style="stroke:none;" height="40"></rect>
                <rect width="1" x="22" y="0" style="stroke:none;" height="40"></rect>
                <rect width="3" x="25" y="0" style="stroke:none;" height="40"></rect>
                <rect width="2" x="29" y="0" style="stroke:none;" height="40"></rect>
                <rect width="1" x="33" y="0" style="stroke:none;" height="40"></rect>
                <rect width="3" x="36" y="0" style="stroke:none;" height="40"></rect>
                <rect width="2" x="41" y="0" style="stroke:none;" height="40"></rect>
                <rect width="1" x="44" y="0" style="stroke:none;" height="40"></rect>
                <rect width="3" x="47" y="0" style="stroke:none;" height="40"></rect>
                <rect width="2" x="52" y="0" style="stroke:none;" height="40"></rect>
                <rect width="2" x="55" y="0" style="stroke:none;" height="40"></rect>
                <rect width="3" x="59" y="0" style="stroke:none;" height="40"></rect>
                <rect width="1" x="64" y="0" style="stroke:none;" height="40"></rect>
                <rect width="1" x="66" y="0" style="stroke:none;" height="40"></rect>
                <rect width="3" x="69" y="0" style="stroke:none;" height="40"></rect>
                <rect width="2" x="73" y="0" style="stroke:none;" height="40"></rect>
                <rect width="3" x="77" y="0" style="stroke:none;" height="40"></rect>
                <rect width="1" x="82" y="0" style="stroke:none;" height="40"></rect>
                <rect width="2" x="84" y="0" style="stroke:none;" height="40"></rect>
                <rect width="1" x="88" y="0" style="stroke:none;" height="40"></rect>
                <rect width="3" x="91" y="0" style="stroke:none;" height="40"></rect>
                <rect width="2" x="96" y="0" style="stroke:none;" height="40"></rect>
                <rect width="3" x="99" y="0" style="stroke:none;" height="40"></rect>
                <rect width="1" x="104" y="0" style="stroke:none;" height="40"></rect>
                <rect width="2" x="106" y="0" style="stroke:none;" height="40"></rect>
                <rect width="1" x="110" y="0" style="stroke:none;" height="40"></rect>
                <rect width="3" x="113" y="0" style="stroke:none;" height="40"></rect>
                <rect width="2" x="117" y="0" style="stroke:none;" height="40"></rect>
                <rect width="1" x="121" y="0" style="stroke:none;" height="40"></rect>
                <rect width="3" x="124" y="0" style="stroke:none;" height="40"></rect>
                <rect width="2" x="128" y="0" style="stroke:none;" height="40"></rect>
                <rect width="1" x="132" y="0" style="stroke:none;" height="40"></rect>
                <rect width="3" x="135" y="0" style="stroke:none;" height="40"></rect>
                <rect width="2" x="139" y="0" style="stroke:none;" height="40"></rect>
                <rect width="2" x="143" y="0" style="stroke:none;" height="40"></rect>
                <rect width="3" x="147" y="0" style="stroke:none;" height="40"></rect>
                <rect width="1" x="152" y="0" style="stroke:none;" height="40"></rect>
                <rect width="1" x="154" y="0" style="stroke:none;" height="40"></rect>
                <rect width="3" x="157" y="0" style="stroke:none;" height="40"></rect>
                <rect width="2" x="161" y="0" style="stroke:none;" height="40"></rect>
                <rect width="1" x="165" y="0" style="stroke:none;" height="40"></rect>
                <rect width="3" x="168" y="0" style="stroke:none;" height="40"></rect>
                <rect width="2" x="172" y="0" style="stroke:none;" height="40"></rect>
                <rect width="2" x="176" y="0" style="stroke:none;" height="40"></rect>
                <rect width="3" x="180" y="0" style="stroke:none;" height="40"></rect>
                <rect width="1" x="185" y="0" style="stroke:none;" height="40"></rect>
                <rect width="2" x="187" y="0" style="stroke:none;" height="40"></rect>
                <rect width="3" x="191" y="0" style="stroke:none;" height="40"></rect>
                <rect width="1" x="195" y="0" style="stroke:none;" height="40"></rect>
                <rect width="2" x="198" y="0" style="stroke:none;" height="40"></rect>
                <rect width="3" x="201" y="0" style="stroke:none;" height="40"></rect>
                <rect width="1" x="206" y="0" style="stroke:none;" height="40"></rect>
                <rect width="1" x="209" y="0" style="stroke:none;" height="40"></rect>
                <rect width="4" x="211" y="0" style="stroke:none;" height="40"></rect>
                <rect width="1" x="216" y="0" style="stroke:none;" height="40"></rect>
                <rect width="2" x="220" y="0" style="stroke:none;" height="40"></rect>
                <rect width="3" x="225" y="0" style="stroke:none;" height="40"></rect>
                <rect width="1" x="229" y="0" style="stroke:none;" height="40"></rect>
                <rect width="2" x="231" y="0" style="stroke:none;" height="40"></rect>
                <text x="62" y="54" style="font-size:10px; stroke:none;" xml:space="preserve">N01120919000200265</text>
            </g>
        </g>
    </svg>
</div>

This happens when I do the copy while in preview mode.
I think this is a relative of the problem in this post https://learn.objectiflune.com/discourse/t/field-selector-gets-replaced-by-field-value/2402

It’s a similar issue to the one you pointed out, but not quite the same (that other issue, by the way, is fixed in the upcoming 2019.2 release).

In this instance, the problem occurs because you’re copying the object in Preview mode, which provides you with a preview of the merged output of your template. The side effect is that objects that you copy in that mode have already been rendered (i.e. the object contains what will appear in the final output, already merged with the data).

This is a quirk of Preview mode that kinda makes sense when you think about it, but admittedly it can throw off anyone unless you know the explanation.

In this case the main effect is to fill up the html source with unnecessary code, because the barcode scripts seem to overwrite the extra code with the correct (variable) version when the page is rendered.
I’ve just realised that I’ve seen the same thing previously, when copying barcodes in png format. In that case a png source file is embedded in the html source, but overwritten when rendered. I previously thought that the png source was “part of the package”, but I now see that I can go and delete it.

This explains what is happening, but this is not the behaviour a reasonable person would expect. If I copy and paste a customer number for example, I want to get a placeholder for the customer number, not whichever customer number happens to be in that particular record at the time.

To create a new copy of variable data, I have ti remember to flip to design mode, copy and paste, flip back to preview, select and drag the new copy to where I want it. This is time consuming and I keep forgetting :roll_eyes:; meaning I have to undo everything and start again.

Point taken. I’ll raise the issue with the Designer team.

Thanks Phil__________________________
Post must be at least 20 characters!