Specifying Printer, Label Template, Serialization, And Data From Trigger File
Hello,
We have a Linux program that submits files containing data to print labels on Zebra printers.
Each file targets one printer, has multiple label templates, and contains about 300 records.
I have the following setup:
- Bartender Automation 10.0 SR2
- Label templates for various label formats (Label1.btw, Lebel2.btw, label3.btw, etc.)
- Fields in the label templates have share names (Field1, Field2, Field3, etc.)
- One file, LABELDEFS.TXT contains all the label template names and share names as follows:
LABEL1,1, Field1, Field2, Field3
LABEL2, 1, Field1, Field2, Field3, Field4
LABEL3, 0, Field1 Field2
etc.
- a "1" after LABELx indicates a serialization on a specific Fieldx (i.e. box 1 of Qty, Box 2 of Qty, etc.)
- a "0" after LABELx indicates single print copy only
- The Linux application produces a data file DATAxxxx.txt where "xxxx" is different everytime
- The DATAxxxx.txt file is TAB-delimited and looks like:
Printer1 LABEL1 data1 data2 data3
Printer1 LABEL3 data1 data2
Printer1 LABEL1 data1 data2 data3
Printer1 LABEL2 data1 data2 data3 data4
- The printer name in a DATAxxxx.txt file is always the same, but can be different in another DATAxxxx.txt file
My questions are:
- Using Commander Script to print the DATAxxxx.txt, how can I pass the printer name and label template name to Commander by reading them from the DATAxxxx.txt?
- Is BTXML better fit for this scenario?
- The files need to print fast, so how do I load all the label formats into Bartender before printing starts?
Thank you for your time and help.
-
Can the Linux application produce a "DATAxxxx.txt" trigger file with either a Commander Script header or by using BTXML-Script?
With Commander Script you can indeed include more than print job to be printed (different BT documents per print job), but each print job / document needs to share the same set of variable data. You can workaround this limitation by e.g. performing a database query prompt, but BTXML-Script (only in Enterprise Automation Edition) is better at performing multiple print jobs than what you could achieve with Commander Script. An example of sending multiple print jobs using BTXML-Script is:
<?xml version="1.0" encoding="utf-8"?>
<XMLScript Version="2.0">
<Command Name="Job1">
<Print>
<Format CloseAtEndOfJob="true">Document1.btw</Format>
<PrintSetup>
<IdenticalCopiesOfLabel>5</IdenticalCopiesOfLabel>
</PrintSetup>
</Print>
</Command>
<Command Name="Job2">
<Print>
<Format CloseAtEndOfJob="true">Document2.btw</Format>
<PrintSetup>
<IdenticalCopiesOfLabel>5</IdenticalCopiesOfLabel>
</PrintSetup>
</Print>
</Command>
<Command Name="Job3">
<Print>
<Format CloseAtEndOfJob="true">Document3.btw</Format>
<PrintSetup>
<IdenticalCopiesOfLabel>5</IdenticalCopiesOfLabel>
</PrintSetup>
</Print>
</Command>
</XMLScript>
For setting the variable data for a print job, you would use:
<?xml version="1.0" encoding="utf-8"?>
<XMLScript Version="2.0">
<Command Name="Job1">
<Print>
<Format>c:\BarTender\Document1.btw</Format>
<RecordSet Name="Text File 1" Type="btTextFile">
<Delimitation>btDelimQuoteAndComma</Delimitation>
<UseFieldNamesFromFirstRecord>true</UseFieldNamesFromFirstRecord>
<TextData>
<![CDATA[
"FirstName","LastName","City","Zip Code"
"Adam","Jones","Bellevue","98008",
"John","Smith","Kirkland","98293"
]]>
</TextData>
</RecordSet>
</Print>
</Command>
</XMLScript>
Commander, in newer versions (this includes v10.0) supports document caching by default, so the BT documents you open in the first print job will remain cached until you use them again. You can take a look at these advanced features by accessing the "Detection > BarTender Command Handler" Setup dialog in Commander.
0 -
Legacy Poster
★ BarTender Hero ★
Thank you Domingo for the detailed reply.
My Linux application can produce a BTXML file for each job.
When using the BTXML script, my problem is the repetitive content.
That is why I created the DATAxxxx.TXT and LABELDEFS.TXT hoping I could read and evaluate data from them.
So, in the BTXML file for a job, can I out code to,
<Format> Read the btw format from the current record in DATAxxxx.TXT </Format>
...
<Printer> Read the printer name from the record in DATAxxxx.TXT </Printer>
...
<TextData> Read the "FiledNames" for the btw format from LABELDEFS.TXT, and read the "LabelData" from the current record in DATAxxxX.TXT </TextData>
This way, I can use the same generic BTXML and loop it until the whole DATAxxxx.TXT has been read.
Maybe a long shot, but I'd appreciate your feedback.
0 -
As far as I know, such references to data from other files are not directly possible.
There is a "Transform" command type in Commander that will allow you to make use of "Search & Replace" actions on the original trigger file (even using regular expressions), but it won't let you replace existing data with data from an external source.
There is another command called "Operating System" will allow you to execute any command you can run via "Start > Run" in BarTender, and this includes e.g. a VB program which would reformat the original trigger file. However, writing this VB program to transform the original trigger files would end up being more complex than making repetitive data entry.
0 -
Legacy Poster
★ BarTender Hero ★
Ok, that makes sense.
I will build the BTXML file from the Linux application with the proper variable values.
I appreciate the help you've extended.
0 -
Legacy Poster
★ BarTender Hero ★
I have a similar question/challenge. I have a comma delimited file that I don't have the ability to change. I have a customer field in the file that I would like to use to decide what label template to choose. Is this possible?
0 -
Legacy Poster
★ BarTender Hero ★
Disregard my previous post. I found reference to this functionality on a separate topic thread.
0 -
Legacy Poster
★ BarTender Hero ★
Disregard my previous post. I found reference to this functionality on a separate topic thread.
Could you please share how or what you found out about the 'template choosing' dilemma?
0
Iniciar sesión para dejar un comentario.
Comentarios
7 comentarios