Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing an image while sending straight text to a printer

Status
Not open for further replies.

thenxtgoldberg

Programmer
Dec 3, 2013
2
US
Hello all,
I hope that someone can answer this with something more than a "no", which is what I believe the answer is but I am being asked to make sure.

I have a client who wants to print an image of a signature on checks. However, when printing we need to use straight text to the printer as they already have check stock which is formatted and etc etc. Is there any way to print an image on a straight text printout?? thanks for any help.. if my question is not clear please let me know and I can try to give a better explanation or even a bit of code to help explain.
 
Well, it's not completely clear. What exactly do you mean by "straight text"?

Do you mean you want to send text to the printer without using the report writer? In other words, you want to use ? and @/SAY commands? If so, it is possible to print an image with @ SAY, but I'm afraid the exact syntax escapes me. No doubt someone else can provide it.

But really there's no reason to do that. It's perfectly straightforward to use the report generator to print checks. You just have to take care to get everything properly lined up. I've done this myself more than once.

If this doesn't answer your question, then please clarify it.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
You got it exactly correct Mike... using ? ?? or any other variation to send text straight to the printer.
I have never used the SAY command so.. that is something new for me.. I will have to look into that.

I do realize you can use a graphical report but unfortunately that doesn't seem to be something that we want to change so.. I kind of have my hands tied on that.
Thanks for the response, if someone has an example for me on the SAY stuff that would be awesome, I will be going to check that out myself when I have time.
 
Depends on what you mean with straight text printout. Even if it is, what I think, you can use it to send printer specific commands. If the printer vendor has a manual explaining escape sequences you may switch to a graphics mode and print graphics, like a signature image.

In short that means you're developing your own printer driver for that specific printer. I used to do that way bay for the commodore printer for C64 and again later for a NEC P6 printer on Atari ST. It sounds harder than it is, but I'm sure it's harder to get at a manual providing you with the needed command codes. I faintly remember they mostly started with ESC , so CHR(27) and then one or two letters and then two to four bytes telling the printer the number of bytes following being binary data of a picture. In the old cases that was each byte was 8 bits of black or white pixels, so 8 bytes would print 8x8 pixels. Etc. etc. With todays DPI you have to send a lot of data and doesn't simply mean sending over the bytes you read from a BMP or JPG file. Uncompressed data. Okay, so it's more complicated, indeed.

The easier thing to do is look out for a windows printer driver and print the checks with a FRX report or LBX label. You can use the detail band of a report to position report controls at the places you want to print text and also place an image at the place of the signature line. I's much easier to do that, than to incorporate graphics printing into straight text printing. Also an FRX can be reused for different printer, the only moment you have to change it is, when the check layout changes. If you begin coding specific printer commands, you will have to redo that for the next printer. It's less and less likely you get the needed command codes to go into graphics mode for any printer models. That's why it's the job of printer manufacturers nowadays, to provide printer drivers for their printers.

Bye, Olaf.

 
I'm pretty sure you can't print images with the ? command. And if you are not familiar with @/SAY, I would not advise starting out down that route either (if for no other reason that the lack of documentation) - unless someone can come up with the exact syntax you need.

Really, the best solution is to learn the report writer. It's not that difficult. And you can always come back here with questions if you get stuck.

Or you can do as Olaf suggests, and try to figure it out using escape sequences. But I can't help thinking you'll find the report writer easier.

Whatever you decide, good luck with it.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
By the way: Wouldn't it be easier to change from checks overall to electronic payments?

Bye, Olaf.
 
going from memory only here, so don't quote me:

@ row,col SAY filename.bmp BITMAP [ISOMETRIC]

But don't do it. The least (LEAST!) of your problems will be causing a page eject if the row,col coordinates are as much as a pixel "higher" on the page than previous ? or ?? commands.

I've used the report writer to print to pre-printed checks and it is FAR AND AWAY the preferable thing to do.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top