We are creating price labels to be printed and then scanned at the POS.
We've found that if we scale the barcode down to fit onto the label it can become unscannable.
This depends on the length of the SKU, but it appears that the first and last lines of the barcode are either clipped or scaled in such a way that they become too thin so that the scanner doesn't recognise them as the start and end of the barcode.
Is there a minimum width we need to enforce when the user is scaling the barcode element to fit on the label?
We've spotted this with the XamCode128Barcode which is the one used by most of our customers.
Hi Chris,
Thank you for contacting us.
As you are using the XamBarcode for printing it is recommended to have set its BarsFillMode property to EnsureEqualSize. Regarding the scaling of the control, I suggest you to have set Stretch=Uniform so it could fill its container dimensions. If the Stretch is set to None, the barcode will take its nominal size for its specified data and will not regret its parent container size, so if the parent container has smaller size, the barcode will be cut. You could play with the XDimension property value (the width of the thinnest bar) to achieve your desired behavior as have in mind that its default value is the nominal one and if set to smaller value, you could achieve unreadable barcode symbol by POS.
I suggest you to look at the dimensions sample at https://ko.infragistics.com/samples/silverlight/barcode/#/dimensions where you could see all this properties and their connections.
Let me know if this helps or you need a further assistance.
Regards,
Petia
Infragistics, Inc.
https://ko.infragistics.com/support
Thanks for the reply, but I'm finding that if I have any scaling on the barcode it becomes unscannable.
As an experiment I changed the code that defines the barcode so I could see the effect in the designer and used a barcode reader app on my phone, rather than having to run my application each time.
<ig:XamCode128Barcode CodeType="Standard" Data="{Binding Sku}" ErrorMessageText="" BarsFillMode="EnsureEqualSize" Background="Transparent"> <ig:XamCode128Barcode.RenderTransform> <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="0.9" ScaleY="0.9"/> </ig:XamCode128Barcode.RenderTransform> </ig:XamCode128Barcode>
With this code any value in the ScaleX and ScaleY properties rendered the barcode unscannable. If I took the scale out then the barcode would scan.
We need to be able to scale the barcode so that it can fit on the 1" x 2" labels our customer uses.
I have tested with the following code at my side and all barcode symbols are readable. Note that I have set UseLayoutRounding="True" too.
<Grid x:Name="LayoutRoot" Background="White"> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <Slider x:Name="Slider1" Minimum="0.4" Maximum="1" Value="0.9" /> <ig:XamCode128Barcode Data="Lorem ipsum dolor" Grid.Row="1" x:Name="XamBarcode1" UseLayoutRounding="True"> <ig:XamCode128Barcode.RenderTransform> <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="{Binding ElementName=Slider1, Path=Value}" ScaleY="{Binding ElementName=Slider1, Path=Value}"/> </ig:XamCode128Barcode.RenderTransform> </ig:XamCode128Barcode></Grid>
Give me some data to test with? Do you have some size of the parent container of the barcode?
It will be best if you could send me some sample project with your specific scenario.
Setting UseLayoutRounding="True" along with BarsFillMode="EnsureEqualSize" and Stretch="Uniform" seems to have done the trick.
Hello Chris,
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.