Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Print text file with no page eject
Message
From
15/05/2009 11:22:34
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
15/05/2009 10:56:18
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01399818
Message ID:
01400145
Views:
71
>>We are using multiple size stationeries for the printing. So, it is very difficult to change the paper size of the printer
>
>Why would this be "very difficult"? If you are printing on a certain stationary that is 4" (4 inches) high, send the commands to change the page size, then immediately print the reports. The command for the page size should be part of the program that produces the report.

For Epson dot-matrix printers, the code to change the page length are ESC "C" n, where n is the number of lines.

For exaple, if you need 4 inches, with the normal 6 lines per inch that would be 24 lines, and you send the code chr(27) + "C" + chr(24), where chr(27) is the ESC code, and chr(24) sends the number 24, converted to character, as a parameter.

My printing codes, for printing in text mode, are normally something like this (simplified, I am trying to give you the main idea):
* Here: Codes to prepare a text file, with "?" and "??" commands; or perhaps with "@...say"
local lcReportInMemory
lcReportInMemory = FileToStr("myreport.txt")
lcPrinterCodes = chr(27) + "C" + chr(24) && And any other setup code which the report might require
??? lcPrinterCodes + lcReportInMemory
Of course, instead of naming the report file "myreport.txt" a random filename is used, to avoid problems with multiple users.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform