I would like to print to a Zebra TLP2844 barcode printer texts and images
too from PB.
Zebra has own language: EPL2. I have to create a special string, which is
OK,
I know the control codes and letters, so I can handle it.
But I have to concatenate/add an image as a string or something else at a
given position if i want to print a logo.
I have the image in blob, or in char array too, but I don't know how to add
an image or blob or characters to a string variable
The main problem is: image/blob contains 0 characters, and if I try to add
it to a string variable, then this will the end of the string.
A part of the string can be:
[...]
s_text += "R136,0"
s_text += "N"
s_text += "GW50,50,14,112, __raw data is needed here continuously___ "
s_text += "P1"
Image in hexa can be: 0A 10 01 01 00 00 FF FF 00 00 6C......... in
s_data[]
I can't do this:
s_text += Char( s_data[i] ) -- incompatible types in assignment:
character, string
or this:
s_text += String( s_data[i] ) -- because s_data[5] will terminate
the string.
Thanks in advance,
Mario
On 22 Jul 2008 00:48:19 -0700, "Szabó Márió" <szabo...@hungexpo.hu>
wrote:
//////////////////////////////////////////////////////////////
//
// Function string of_blob2hex(blob ablb)
//
// Description: convert a blob to a hex string
//
// Argument: ablb - blob to convert
//
// Return: a hex string
//
//////////////////////////////////////////////////////////////
string ls
long ll
byte lb
for ll=Len(ablb) to 1 step -1
GetByte(ablb,ll,lb)
ls=of_byte2hex(lb)+ls
next
RETURN ls
//////////////////////////////////////////////////////////////
//
// Function string of_byte2hex(byte ab)
//
// Description: convert a byte value to a hex string
//
// Argument: ab - byte value to convert
//
// Return: a hex string (1 byte)
//
//////////////////////////////////////////////////////////////
string ls[0 to
15]={"0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"}
if IsNull(ab) then RETURN ""
if ab=0 then
RETURN "00"
elseif ab=255 then
RETURN "FF"
elseif ab<16 then
RETURN "0"+ls[ab]
else
RETURN ls[Int(ab/16)]+ls[Mod(ab,16)]
end if
"Szab¨® M¨¢ri¨®" <szabo...@hungexpo.hu> wrote in message
news:488590c3@forums-1-dub...
"Szabó Márió" <szabo...@hungexpo.hu> wrote in message
news:48889308$1@forums-1-dub...
> Hi!
>
>
> Unfortunatelly I have to build a string type variable not a blob, because
> the printer can receive only string type rows.
> So I have to convert the blob to string.
>
> I used the Blobmid to get an individual byte, but I can't convert a hexa
> 00
> to string.
>
> Any ideas?
>
> Thanks,
> Mario
>
>
> "Bruce Armstrong [TeamSybase]" <NOCANSPAM_br...@teamsybase.com>
> az alábbiakat írta a következo hírüzenetben:
> 5plb849qj9dao9f4h...@4ax.com...
Unfortunatelly I have to build a string type variable not a blob, because
the printer can receive only string type rows.
So I have to convert the blob to string.
I used the Blobmid to get an individual byte, but I can't convert a hexa 00
to string.
Any ideas?
Thanks,
Mario
"Bruce Armstrong [TeamSybase]" <NOCANSPAM_br...@teamsybase.com> az
alábbiakat írta a következo hírüzenetben:
5plb849qj9dao9f4h...@4ax.com...
>
I use these functions:
l_ret = PrintSetPrinter (p_printerv)
long Job
// Open a print job.
Job = PrintOpen()
PrintSend( Job, s_text )
PrintClose( Job )
where s_text can be the string which is needed for the printer (for example)
s_text += "R136,0"
s_text += "N"
s_text += "GW50,50,14,112, __raw data is needed here continuously___
"
s_text += "P1"
I tried to separate the core printer control rows and the data also
The control rows with the mentioned method: PrintSend( Job, s_text )
The data was sent in hexa also with PrintSend( Job, s_text ) in a separate
block.
It didn't work. :-(
Thanks,
Mario
"Bruce Armstrong [TeamSybase]" <NOCANSPAM_br...@teamsybase.com> az
alábbiakat írta a következő hírüzenetben: 48889916$1@forums-1-dub...
It's actually explained fairly clearly in the Usage section of the help:
"As with any string, the number zero terminates the string argument. If the
printer code you want to send includes a zero, you can use another character
for zero in string and specify the character that represents zero in
zerochar. The character you select should be a character you do not usually
use. When PowerBuilder sends the string to the printer it converts the
substitute character to a zero."
"Szabó Márió" <szabo...@hungexpo.hu> wrote in message
news:48889ffd@forums-1-dub...