Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Printing to a Generic Text Printer
Message
From
16/09/2011 08:06:15
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01523715
Message ID:
01523719
Views:
64
This message has been marked as a message which has helped to the initial question of the thread.
The thing is that Windows want to be smart, which in this case is not so smart, to put it that way. What I do, is first "print" to a text file, and then copy the file to printer, COPY FILE MyFile.TXT TO LPT1:

>Hi
>
>
>We are trying to print directly to Zebra label printer using the ZPL language.
>
>We’re using a VFP9 System and i am trying to use values from the database in the output.
>
>At present the code i am using looks like this:
>
>SET PRINTER TO DEFAULT
>
>??? ' ^xa'
>
>??? ' ^lh30,80'
>
>??? ' ^FO20,10^AS,90,90^FDfoxprofield^FS'
>
>??? ' ^FO20,110^AS,35^FDfoxprofield^FS'
>
>??? ' ^FO20,160^AS,35^FDfoxprofield^FS'
>
>??? ' ^FO20,210^AS,35^FDfoxprofield^FS'
>
>??? ' ^FO20,260^AS,35^FDfoxprofield^FS'
>
>??? ' ^FO20,400^AS,35^FDfoxprofieldY^FS'
>
>??? ' ^FO20,480^AS,90,90^FDfoxprofield^FS'
>
>??? ' ^FO120,650^BC,60^FDfoxprofield^FS'
>
>??? ' ^XZ'
>
>However this does not do anything! (please note the text “foxprofield” is dummy and just an example.
>
>The printer is installed as a generic/text printer and also will print when using notepad.
>
>Where are we going wrong? How do we force VFP9 to write to the printer using the correct method?
>
>When coding this in notepad it looks like this:
>
>^xa
>
>^lh30,80
>
>^FO20,10^AS,90,90^FDfoxprofield^FS
>
>^FO20,110^AS,35^FDfoxprofield^FS
>
>^FO20,160^AS,35^FD1foxprofield^FS
>
>^FO20,210^AS,35^FDfoxprofield^FS
>
>^FO20,260^AS,35^FDfoxprofield^FS
>
>^FO20,400^AS,35^FDfoxprofield^FS
>
>^FO20,480^AS,90,90^FDfoxprofield^FS
>
>^FO120,650^BC,60^FDfoxprofield^FS
>
>^XZ
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform