Dynamically Change Label When Text Too Small

Label printing integration (NiceWatch middleware and ActiveX programming interface)

Moderators: Georges, milos, NiceLabel Support Team

Post Reply
ryanp
Enthusiast
Posts: 6
Joined: Thu Dec 20, 2018 1:00 pm

Dynamically Change Label When Text Too Small

Post by ryanp » Thu Dec 20, 2018 1:35 pm

We are evaluating software to replace our internally developed application for printing food labels. We have over 2000 products that we translate into 5+ languages. We have 4 different label sizes S, M, L , XL and dynamically calculate which size works for a specific product in a specific language and makes sure that the font size is not too small or too large.

In simplified terms we do the following:
- send data (translated ingredients, nutrition data, ..) to label software with label size (name of label) and largest font size
- label is filled and formatted in the background (basically print preview)
- the size of the text box (expands to fit text) with the ingredients is measured
- if the box has expanded too much then throw label size error
- if a label size error is returned repeat with the next smaller font
- if the label size error is returned and the smallest font was used then repeat with the next largest label and the largest font size
- iterate until a label and font is found where the text box does not expand beyond the dimensions of the label

Not extremely elegant but it works. Is something similar possible in Nice? It does not need to be this exact approach.

We have a simple MS Access front end where our users scan the barcode of the product, select the language and enter how many cartons of the product need to be labeled. We would like to continue using this and then send an Api call (.Net) to Nice.

We have some internal experience with vbscript but if python is required we should be able to manage.

Thanks in advance for any input.

User avatar
Kyleodonnell
NiceLabel Support
NiceLabel Support
Posts: 204
Joined: Mon Aug 28, 2017 3:07 pm

Re: Dynamically Change Label When Text Too Small

Post by Kyleodonnell » Thu Dec 20, 2018 3:04 pm

RyanP

It may be possible to check on the size of an object then switch to a different label file, or use the variable label size option here https://www.nicelabel.com/resources/fil ... ide-en.pdf on page 99. It would allow for a labels length to change depending on the size of the objects. You would need to speak with our sales team at Sales.americas@nicelabel.com as they can put you in touch with a pre sales engineer who can see if this is possible.

ryanp
Enthusiast
Posts: 6
Joined: Thu Dec 20, 2018 1:00 pm

Re: Dynamically Change Label When Text Too Small

Post by ryanp » Thu Dec 20, 2018 3:44 pm

Thanks for the quick reply. The variable labe size might help for our L and XL as the XL is only longer with more space for ingredients. Our S and M labels are not as wide so the nutrition table is positioned differently bottom vs. side of label.

Is it possible in NiceLabel to check the font size of an object? For example if I understand correctly the Text Box can scale the font to fit the size of the box (Fit content by adjusting font size). Would it be possible to check the font size and then if it is too small throw an error, or maybe this is already standard.

On page 111
"NOTE: If the content amount exceeds the object size, an error message appears. The label is
not printed. To suppress such error and print the text box, enable Ignore excessive
content at print."

If this error can be caught and returned to the program calling NiceLabel I could then advance to the next larger size and call NiceLabel with the next size?

Edit: had wrong parameter Fit content by scaling font:

User avatar
Kyleodonnell
NiceLabel Support
NiceLabel Support
Posts: 204
Joined: Mon Aug 28, 2017 3:07 pm

Re: Dynamically Change Label When Text Too Small

Post by Kyleodonnell » Thu Dec 20, 2018 10:59 pm

Ryanp,

You can use our SDK to be able to tap into all of the object's properties to get font sizes and such. The SDK samples get installed here C:\Users\Public\Documents\NiceLabel 2017\SDK\Samples, the SDK help file is located here C:\Program Files\NiceLabel\NiceLabel 2017\Help\SDK

ryanp
Enthusiast
Posts: 6
Joined: Thu Dec 20, 2018 1:00 pm

Re: Dynamically Change Label When Text Too Small

Post by ryanp » Wed Jan 02, 2019 12:34 pm

Thanks for the info! I was looking for more info on the SDK. Guess it's time to get at test license and start "playing" around.

User avatar
Kyleodonnell
NiceLabel Support
NiceLabel Support
Posts: 204
Joined: Mon Aug 28, 2017 3:07 pm

Re: Dynamically Change Label When Text Too Small

Post by Kyleodonnell » Wed Jan 02, 2019 2:10 pm

Ryan,

The demo of the software comes with a free 30 day trial of the SDK

ryanp
Enthusiast
Posts: 6
Joined: Thu Dec 20, 2018 1:00 pm

Re: Dynamically Change Label When Text Too Small

Post by ryanp » Fri Jan 18, 2019 2:26 pm

We're still testing but have a working Beta Version from what we wanted to achieve.

Basically we set the limits we want in the Text Fit font size then using the SDK we preview the label sending the contents in the request. The SDK throws an error that the text is too long so then we then close the preview and try the next larger sized label and repeat until no error is thrown.

Maybe that helps someone with a similar requirement.

Post Reply