How Can I Control the Number of Copies and the Printer Tray in CUPS?

Since CUPS version 2.2.1 it may happen that the number of job copies in the generated PostScript header is not recognized correctly. As a remedy, you can pass the number of copies directly as a CUPS option - and you can also control the printer tray (InputSlot).

The available CUPS options will be listed with this command

lpoptions -l

TFPrint Option:

-SDK " cupsoptions='copies=3 InputSlot=Manual' " 

TFORMer Library API:

TFormer_SetPrintOptions (hTForm, "cupsoptions='copies=3 InputSlot=Upper'");

Error "CUPS was not found. CUPS support disabled..."

TFORMer SDK (Linux) tries to open the libcups.so during runtime. If the file is not found you will get the following error message when you start TFPrint:

Warning: Cups was not found.
Cups support will be disabled.
No cups printer named XXX was found on your system.
SetPrinterName caused error!

If you have libcups.so.2 or libcups.so.1 on your system then it should work if you set a symbolic link to one of these files called libcups.so.

Empty Sheet with Label Printers (CUPS)

One reason for this problem could be related to the page size. If so the problem could be located in the PPD file.

*PageSize A4/A4: "<</PageSize[595 842]/ImagingBBox null>>setpagedevice"

May be you must also change

*DefaultPageSize: w288h432 --> *DefaultPageSize: A4/A4

How Can I Use Label Printers?

Simply install CUPS on your Linux system if you haven't done so yet.

With CUPS you can use specific drivers for your label printer. Major printer manufacturers like Zebra or Dymo offer CUPS drivers - please check out their home page for actual drivers.

Wrong Output (Fonts) with TFORMer on Linux

In most cases the Arial TTF font is missing.

Thanks to fontconfig you can easily install new TrueType fonts.

Install the fonts for a specific user

Just copy the TrueType files to $HOME/.fonts/ and run:

fc-cache

You must do this under the (all) user account(s), which finally will use TFORMer SDK.

Install the fonts for all users

Just copy the TrueType files to /usr/share/fonts and run (as root!):

fc-cache

Get more infos

You can cache all fonts with verbose output:

fc-cache -v -f

ZLP-II Generation Slow on UNIX/Linux Systems

You can improve the speed of ZPL-II output generation by disabling “Dithering” in the TFORMer.xml configuration file. Set dither-mode=”2”.

<ZEBRA form="A4" orientation="portrait" compression="rle" scaling="0" 
    dont-dither-text="1" dither-mode="2" resolution="203">
<Header>^MMT</Header>
</ZEBRA>

Output Direct To Printer (TFPrint)

The following shell script (AIX, HP-UX) shows you how to generate a print file with tfprint and send this file immediately to the printer.

#!/bin/sh

# Test if enough command-line arguments where specified
if test $# != 3
    then
    echo "To few command-line arguments specified"
    echo "Usage:"
    echo " $0 TFF DATAFILE PRINTER"
    exit 1
fi

# make a temporary file name
PRINTFILE=`mktemp /tmp/tfprint.$$.XXXXXX`
OUTFILE=`mktemp /tmp/tfprint.$$.XXXXXX`
ERRFILE=`mktemp /tmp/tfprint.$$.XXXXXX`

# generate output to the temp file
tfprint -F "$1" -d "$2" -dt xml -o $PRINTFILE -ot ps 1> $OUTFILE 2> $ERRFILE

RETCODE=$?
if test $RETCODE -ne 0
    then 
    echo "TFPrint reported an error: $RETCODE"
    # print tfprint stderr
    cat $ERRFILE
    exit $RETCODE
fi

# print tfprint stdout
cat $OUTFILE

# print output file
lp -d$3 $PRINTFILE

# remove temporary print file
rm $PRINTFILE
rm $OUTFILE
rm $ERRFILE

LANG System Variable Has No Effect on Number Formatting

On Linux TFORMer ignores the system locale (LANG, LC_ALL...) to determine the number format, thus the Format (..) function always uses US format. As a workaround use the following expression to convert the US number format to German or European format.

IIF (
Format (1111.1, "#,##0.0") = "1,111.1",
Replace(Replace(Replace(Format(float_value, "+#,###,##0.00"), ".", "*"), ",", "."), "*", ","),
Format(float_value, "+#,###,##0.00")
)
Starting with V7.5.26 there is an SDK option Locale to control the locale (number and date formatting) for the current job.