Tag: code

How can I calculate week number and year in Python in NiceForm?

Sometimes you need to have a year and/or week number on a label or in a form. The following script calculates both. import sys if sys.platform == ‘silverlight’: import System from System.Globalization import * culture = System.Globalization.CultureInfo.CurrentCulture; dt = System.DateTime.Now

Posted in NiceForm, NiceLabel Breeze, NiceLabel Portal Tagged with: , , , ,

Chaining comparison operators in Python

One of the little known facts about Python that can come handy is a possibility to chain comparison operators like this: x = 5; print 3 < x < 10; print x < 10 < x*10; or x == y

Posted in Misc Tagged with: , ,

How can I automate NiceLabel from a scripting language like VBScript or Python?

You can find two examples of automating NiceLabel from a scripting language. The first one is in VBScript and the other one in Python. Both samples do the same thing: run NiceLabel, open label file, iterate through a list of

Posted in NiceLabel, SDK Tagged with: , , , , ,

How can I programmatically get a preview of a label from NiceLabel?

Getting a preview of a label from NiceLabel is quite easy. All you have to do is call GetLabelPreviewEx method of the INiceLabel interface. GetLabelPreviewEx has 6 parameters: file name: full path to the file where NiceLabel will generate image

Posted in NiceLabel, SDK Tagged with: , , , ,

How can I programmatically get a list of variables from NiceLabel?

The following piece of code shows how you can programmatically get a list of variables from a label (.lbl) file. For this sample to work you will have to add reference to “niceengine5wr.dll” that is usually installed in the “c:\Program

Posted in NiceLabel, SDK Tagged with: , , , ,