Re: Educate me on Printing
- Posted by Bernie Ryan <xotron at blue??og.com> Oct 17, 2007
- 520 views
George Walters wrote: > > Bernie, what is wrong with the code I showed? I'd like to understand what > is going on.... why do I need to use PCL code... some printers don't > understand > PCL code and I would like my code to be printer independent. George: There is nothing wrong with your code. Your original printer had a line distance spacing that just worked out without changing printer settings. The problem is because all impact printers had a fixed mechanical distance between lines and inside they had switches that the user could set to change this distance between lines but it require opening the printer's case to change theses settings. So manufactures decided to make the printers programmable with escape sequences so the customer didn't need to open the printers case to change settings. HP came out with a PRINTER CONTROL LANGAUGE ( PCL ) and allot of manufactures decided to have something similar to it. If a printer does not support PCL they will still have someway of printer control codes. The codes for specific printers can be found your customer's manual. You can find the codes for most printers out on the WEB. HERE is something you can do to try using the laser printer. NOTE: you have to send the sequence to tell the printer how change settings but I don't remember if you have to use puts or print or wputs you will have to experiment.
constant -- LINES PER INCH SEQUENCES lns_per_inch_2 = {#027,#038,#108,#050,#068}, lns_per_inch_3 = {#027,#038,#108,#050,#068}, lns_per_inch_4 = {#027,#038,#108,#052,#068}, lns_per_inch_6 = {#027,#038,#108,#054,#068}, lns_per_inch_8 = {#027,#038,#108,#056,#068}, lns_per_inch_12 = {#027,#038,#108,#049,#050,#088}, lns_per_inch_16 = {#027,#038,#108,#049,#050,#088}, lns_per_inch_24 = {#027,#038,#108,#050,#052,#088}, lns_per_inch_48 = {#027,#038,#108,#052,#056,#088}, -- Setup laser printer's LINES PER INCH by measuring labels. -- and then print your labels. -- this sequence sets a one inch label to have 8 lines -- or a two inch label to 16 lines. -- Send this command once then print a label. print(printer,lns_per_inch_8) -- Then print label.
Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan