Variable image in job file

Label printing integration (NiceWatch middleware and ActiveX programming interface)

Moderators: Georges, milos, NiceLabel Support Team

Post Reply
violuke
Newcomer
Posts: 2
Joined: Tue Dec 09, 2014 11:25 am

Variable image in job file

Post by violuke » Tue Dec 09, 2014 11:28 am

Hi,

Using a JOB file for NiceWatch printing, is it possible to have a variable image? Can we include, for example, base64 encoded png/gif/jpg/etc data in a variable? Or can we include a file path to an image? If so, how would I go about setting this up?

Thanks for your help.

Luke

User avatar
Saso
NiceLabel
NiceLabel
Posts: 2970
Joined: Mon Sep 04, 2006 8:09 am
Contact:

Re: Variable image in job file

Post by Saso » Tue Dec 09, 2014 11:39 am

Hi Luke,

You can do both, but base64-encoding will be more complex to set up.

It's easier to just provide the image file name. Dependent on the location of the image, you might need to include the full path to the image, not the file name alone.
See this [img=http://kb.nicelabel.com/index.php?t=faq&id=108]KB article[/img] for how NiceLabel software looks for the files.
This is natively supported in the JOB file syntax.
You would use the command:

Code: Select all

SET variable="c:\images\me.jpg"
Just make sure there is a variable with a name variable defined in the label and that it is linked with the Picture object. When the Picture object receives the file name, it "knows" to display it graphically, not as text.

You could also base64-encode the image, however:
  • You will have to extract the image data provided in the JOB file.
  • You will have to decode it yourself using some command-line utility (executed through the Open document/program action), or you would use VBScript.
  • But you will encounter another problem in NiceWatch. The maximum length of any value provided for the variables is 4096 characters. Your base64-encoded image will probably contain more data.
    Luckily, there is a solution to this with a new-generation of the "NiceWatch". It's NiceLabel Automation line of products. There is no limit on the data length in NiceLabel Automation.
    Time to upgrade? :wink:
Saso Fleiser
Senior Technical Product Specialist

violuke
Newcomer
Posts: 2
Joined: Tue Dec 09, 2014 11:25 am

Re: Variable image in job file

Post by violuke » Tue Dec 09, 2014 5:36 pm

Thanks, that's a great help. How much is the Automation Enterprise package as that does have some features that we'd find helpful? Thanks.

User avatar
Saso
NiceLabel
NiceLabel
Posts: 2970
Joined: Mon Sep 04, 2006 8:09 am
Contact:

Re: Variable image in job file

Post by Saso » Wed Dec 10, 2014 9:58 am

I'll have some colleague from the Sales team to contact you.
Saso Fleiser
Senior Technical Product Specialist

Goran
NiceLabel Sales
NiceLabel Sales
Posts: 3
Joined: Tue Oct 10, 2006 12:24 pm
Location: Kranj

Re: Variable image in job file

Post by Goran » Fri Dec 12, 2014 10:21 am

Dear Luke,

I have sent you details regarding NiceLabel Automation Enterprise to your email address.

All the best,
Goran Nedic
Key Account Manager
All's well that ends well.

Post Reply