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 <[email protected]> On Behalf Of Chris Davis
Sent: Monday, November 13, 2023 12:27 PM
To: ProFox Email List <[email protected]>
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: [email protected]
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/[email protected]
** 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.