I have written many apps which print forms, textboxes,etc., but his latest app has me bouncing off the walls. I have an automated ticket generator for a truck scale. Imagine this: an Okidata Dot Matrix printer, which feedsthe paper via carriage wheel. Each 8.5 x 11 carbon-copy paper is actually divided into three carbon-copy tickets separated by perforations.
My problem is this: I have drawn a form which fits on each ticket(1/3 of the page) quite well. However, I cannot figure out how to make the printer feed ONLY 1/3 OF THE PAGE after each spool. What ends up happening is a whole page is fed in, and two tickets are wasted each print. Of course, I could just tell the guy to feed the paper backout after every ticket, but then he would have to worry about lining it up correctly every time.
If anyone has any ideas, I would really appreciate it
Thanks For Your Tiime
What I would probably do in such a case is to use the printer's Escape codes to control printing, and send ASCII text. You can send it graphics, but that's quite a bit more work.
If you have the codes, or if you know what printers it emulates, you should be able to do it. I have usually ended up using the codes from an Epson LQ series, which is supported by many brands.
Here is an example:
Open "LPT1:" For Output Access Write As #1
Print #1, Chr(27); Chr(64); 'reset
Print #1, Chr(27); Chr(107); Chr(3); 'font
Print #1, Chr(27); Chr(77); 'pitch 12
Print #1, Chr(27); Chr(120); Chr(1); 'letter quality
Print #1, "Hello World"
This will simply leave the paper where it stops printing. There are codes to move the paper up and down if you need to, so as long as you know the height of what you are printing, you can make sure each begins at the proper position.
Please remember to rate the posts and threads that you find useful.
How can something be both new and improved at the same time?