Thanks Woody

That seems to behave the same as me using ...

STRTOFILE(label1.mlabel,"c:\batch\testlabel.txt")
TYPE c:\batch\testlabel.txt TO PRINTER

If I do this with the example label from labelary it works fine, if I use it 
with my own label where I have an embedded image it doesn't.  The embedded 
image command is long as it contains the data in hex format.

If I paste my own label into labelary it works, if I send me label to the 
printer via TCPIP socket using Chilkat it works.  It just doesn't work when 
sending it via set printer to

Make sense?

-----Original Message-----
From: ProfoxTech <profoxtech-boun...@leafe.com> On Behalf Of 
juer...@wondzinski.de
Sent: Monday, November 13, 2023 11:59 AM
To: profoxt...@leafe.com
Subject: RE: ZPL

Hi Chris,

You connect to the printer with a regular cPrinterName = GETPRINTER() SET 
PRINTER TO NAME (cPrinterName)

Then you open the printer
SET PRINTER ON

And all commandlines starting with ??? get sent directly, without conversion of 
the Windows drivers.
thus:

#DEFINE CR CHR(13)+CHR(10)

??? "^XA" + CR
??? "^CF0,60" + CR
??? "^FO50,50^GB100,100,100^FS" + CR

SET PRINTER OFF
SET PRINTER TO


One caveat: The ??? command also translates embedded strings between curly 
braces:

??? "This is a printer control string: {27}Q{100} to set the right margin"

If you need to print that left curly bracket in real, then you need to do a 
"{{}"

wOOdy





-----Original Message-----
From: ProFox <profox-boun...@leafe.com> On Behalf Of Chris Davis
Sent: Monday, November 13, 2023 12:27 PM
To: ProFox Email List <profox@leafe.com>
Subject: ZPL

Hi All

Would anyone have any suggestions of how best to approach sending ZPL commands 
to a compatible printer?

If the printer is on the network I can get this to work using ChilKat such as 
https://www.example-code.com/foxpro/socket_connect.asp

But I have also found that you can get ZPL to a printer that is connected via 
USB or network using the Generic / Text Only Driver ... this works with a 
simple example from

https://labelary.com/viewer.html

but if the commands become more extensive (maybe because an image has been 
included) then this method goes wrong I think because the driver is doing 
something relating to page size? But not sure.

If possible I would like a native VFP method of connecting to either a USB or 
Network connected ZPL printer and be able to send whatever I like ... thoughts?

TIA


Chris Davis




--- StripMime Report -- processed MIME parts --- multipart/alternative
  text/plain (text body -- kept)
  text/html
---

[excessive quoting removed by server]

_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: https://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: https://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: https://leafe.com/archives
This message: 
https://leafe.com/archives/byMID/lo0p123mb4988293ae9b23511e2d35e4f8f...@lo0p123mb4988.gbrp123.prod.outlook.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to