For Programmers: Free Programming Magazines  


Home > Archive > Clipper > April 2006 > Printing graphics & text









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Printing graphics & text
Robert J. Stuart

2006-04-04, 6:55 pm

In one of my applications, I tally all the monies each of my participants
have won and have an on demand check printing system. Now I have no
problems printing the checks, but the checks are not signed. So what I do
right now is pre-print the signatures on a bunch of checks and then load
them in the check printer attached to my on demand system.

So not to have to run these checks thru the printer twice, has anyone
experience with printing a graphics file with text. Basically I have a scan
of the authorizing signature that I place in a blank word doc and then print
it on the checks. Now I would like to take this graphic, jpg, bmp, etc,
doesn't matter and print it along with the @say routine I have for check
printing.

Bob S.


E. Fridman

2006-04-04, 6:55 pm

Robert,

We use only HP PCL5 - compatible check printers. So we created PCL
output of the check and signature together and send it to the printer
first and then send properly formatted PCL strings with the field
values.

HTH, Eugene

Robert J. Stuart

2006-04-04, 6:55 pm

Eugene, I am using an HP4000. So that uses PCL5e or PCL6. How do you
create the PCL output of both the graphic file signature and the text field
data? That is the step I am missing.

Bob S.

"E. Fridman" <pm771.am@gmail.com> wrote in message
news:1144169801.422190.80970@g10g2000cwb.googlegroups.com...
> Robert,
>
> We use only HP PCL5 - compatible check printers. So we created PCL
> output of the check and signature together and send it to the printer
> first and then send properly formatted PCL strings with the field
> values.
>
> HTH, Eugene
>



E. Fridman

2006-04-04, 6:55 pm

<<< How do you create the PCL output of both the graphic file signature
and the text field data? >>>

Permanent part (including signature) can be created in a graphical
editor and saved to a file using HP PCL driver. You will need to edit
the resulting file somewhat to eliminate PageBreak and/or Ctrl-E
(Reset) commands at the end.

When printing a check first send this saved file to a printer and then
do your printing (apparently you know how to do it). Eject a page at
the end.

Davide Guolo

2006-04-04, 6:55 pm

Dear Mr. Stuart,

> Basically I have a scan
> of the authorizing signature that I place in a blank word doc and then
> print
> it on the checks. Now I would like to take this graphic, jpg, bmp, etc,
> doesn't matter and print it along with the @say routine I have for check
> printing.


you may want to have a look at Printfil, which allows you to add a standard
Windows BMP file as background for your print jobs by adding 1 single line
of code to your Clipper source.

You can find more info and a free trial version at http://www.printfil.com

Kind regards,
Davide Guolo
--------------------------------------------------------------
Printfil - Windows Printing System for Applications
http://www.printfil.com
Odbc4All - Connection to ODBC Data Sources for any Application
http://www.guolo.com/odbc4all
--------------------------------------------------------------


ReIncarnated

2006-04-04, 6:55 pm

Yes - I routinely generate reports with different signatures based on
settings in a configuration file - no problems with page breaks etc
etc.

Depends entirely on what packages you have included in your
application as to how you print them but, in my case, I am using
PageScript so I have the signatures saved as PCX files (BMP will also
work) and then, using PageScript page location controls, place the PCX
image on the printed page exactly where I want it.

So far, in the years this has been running, the only time there has
been a problem is when the signature file has been 'moved' - in those
cases I simply get - well nothing.


On Tue, 04 Apr 2006 14:13:38 GMT, "Robert J. Stuart"
<rjstuart@earthlink.net> wrote:

>In one of my applications, I tally all the monies each of my participants
>have won and have an on demand check printing system. Now I have no
>problems printing the checks, but the checks are not signed. So what I do
>right now is pre-print the signatures on a bunch of checks and then load
>them in the check printer attached to my on demand system.
>
>So not to have to run these checks thru the printer twice, has anyone
>experience with printing a graphics file with text. Basically I have a scan
>of the authorizing signature that I place in a blank word doc and then print
>it on the checks. Now I would like to take this graphic, jpg, bmp, etc,
>doesn't matter and print it along with the @say routine I have for check
>printing.
>
>Bob S.
>

John.
Klas Engwall

2006-04-04, 6:55 pm

Bob,

>I am using an HP4000. So that uses PCL5e or PCL6. How do you
>create the PCL output of both the graphic file signature and the text field
>data? That is the step I am missing.


You can embed the graphic file in a macro and download it into the
printer before you start printing. Then you only have to send a string
of around ten characters to call the macro for each check you print.
This is the technique I use for all kinds of form based printing on
PCL5 printers.

On my web site (se sig below) there is a small example of macro
printing that I once put together to help printing the Euro character
on older laser printers that do not support it natively. Your
signature file can be handled in a similar way.

I can also help you with a small tutorial and a complete macro example
if you like. The graphic file itself is easily converted to PCL if you
first convert it to PCX. Then run it through a utility called PCX2PCL
that can be downloaded from various places on the web.

Regards,
Klas

-------
klas dot engwall at engwall dot com

http://www.engwall.com/clipper/

The LFN Library for Clipper
The LanMan Library for Clipper
The NFPAT1A Timeslice release patch for the Nanforum Toolkit
Mike

2006-04-05, 6:55 pm

I had to do something similar to sign Railroad Commission forms a long
time ago.

It used their scanned signature. That was run through a PCXtoPCL
utility. Then I used R&R for DOS version 5. I think I signed it XXX
and then set the font to the converted file. If this is close to what
you might want to do, I can find it and send it to you.

Mike

Robert J. Stuart

2006-04-05, 6:55 pm

Thanks for the help guys. Mike, I would love to look at the way you are
doing it. I would appreciate it if you would send me examples. Please
contact me at rjstuart@earthlink.net.

Klas, I would also like to look at the macro style that you suggested. I
will go to your site and check out your examples you have posted there, then
ask questions once I get an idea.

Thanks again to everyone

Bob S.


"Mike" <mgmurch@yahoo.com> wrote in message
news:1144267713.094295.278420@z34g2000cwc.googlegroups.com...
> I had to do something similar to sign Railroad Commission forms a long
> time ago.
>
> It used their scanned signature. That was run through a PCXtoPCL
> utility. Then I used R&R for DOS version 5. I think I signed it XXX
> and then set the font to the converted file. If this is close to what
> you might want to do, I can find it and send it to you.
>
> Mike
>



Robert J. Stuart

2006-04-05, 6:55 pm

Thanks guys for the help

Mike I would love to see some examples of how you are doing this. Please
contact me at rjstuart@earthlink.net

Klas, I get the macro thing and downloaded pcx2pcl v1.62. But it does not
seem to be converting the pcx image correctly. At least when I download it
to my printer and then call the macro for printing, I get a very pixel image
and only about 1/4 of the front end of the signature. I have tried several
attempts a resizing the image and re-converting, but still with little
success. I get an image to print but it will not pass as a signature. Is
there a better pcl converter?

Bob S.


"Mike" <mgmurch@yahoo.com> wrote in message
news:1144267713.094295.278420@z34g2000cwc.googlegroups.com...
> I had to do something similar to sign Railroad Commission forms a long
> time ago.
>
> It used their scanned signature. That was run through a PCXtoPCL
> utility. Then I used R&R for DOS version 5. I think I signed it XXX
> and then set the font to the converted file. If this is close to what
> you might want to do, I can find it and send it to you.
>
> Mike
>



Klas Engwall

2006-04-05, 6:55 pm

Bob,

>Klas, I get the macro thing and downloaded pcx2pcl v1.62. But it does not
>seem to be converting the pcx image correctly. At least when I download it
>to my printer and then call the macro for printing, I get a very pixel image
>and only about 1/4 of the front end of the signature. I have tried several
>attempts a resizing the image and re-converting, but still with little
>success. I get an image to print but it will not pass as a signature. Is
>there a better pcl converter?


I suspect that there is a greyscale in your PCX file. Reduce it to
just black and white and try again. You will of course get a better
result if the signature is written in black ink and not in blue.

Regards,
Klas

-------
klas dot engwall at engwall dot com

http://www.engwall.com/clipper/

The LFN Library for Clipper
The LanMan Library for Clipper
The NFPAT1A Timeslice release patch for the Nanforum Toolkit
Robert J. Stuart

2006-04-05, 9:55 pm

Klas, Hot damn it works............ Thank you Thank you. And thank you
to everyone that offered help. This is going to save me a bunch of time. I
have to print over 3000 checks a w. And I have been running them thru
first time for the signature, then again for the actual check. And if I
over print the number I needed for signatures, I then had all those pre
signed checks hanging around until the next run.

Now I just need to play a little to get the size of the graphic just right.
I have 12 different signatures I need to use for the different department
heads that need to sign the checks. But once I get the first one, I can use
it as a template for the others.

Thanks again Klas, it worked exactly like your Euro Macros white pages
describes.

Bob S.



"Klas Engwall" <klas.engwall@nospam.please> wrote in message
news:44344476.422114889@news.wineasy.se...
> Bob,
>
not[color=darkred]
it[color=darkred]
image[color=darkred]
several[color=darkred]
Is[color=darkred]
>
> I suspect that there is a greyscale in your PCX file. Reduce it to
> just black and white and try again. You will of course get a better
> result if the signature is written in black ink and not in blue.
>
> Regards,
> Klas
>
> -------
> klas dot engwall at engwall dot com
>
> http://www.engwall.com/clipper/
>
> The LFN Library for Clipper
> The LanMan Library for Clipper
> The NFPAT1A Timeslice release patch for the Nanforum Toolkit



Robert J. Stuart

2006-04-06, 6:55 pm

Klas, I have everything working quite well now. But I am using the
"download" and "unload" routines that I downloaded with pcx2pcl. Of course
the problem with this is that it works for the LPT1 port and I have to do a
swpruncmd to execute. I would love to now write my own function call to
download the macro to the printer and also to unload the macro. Can you
point me in the right direction of ESC sequence codes to do this.

I have downloaded the HP Macro Commands Programming Hints but some where I
am screwing up

I have read my .pcl file as a variable data=memoread("file.pcl"). Then I
set device to print, set printer to lpt1, and start sending the following
sequence:

@0,0 say chr(27)+"&f1Y"+chr(27)+"&f0X"+data+chr(27)+"f1X"

then I try to run the macro with @10,50 say chr(27)+"&fs1y3x1S"

but I am getting gibberish on the printout.

I must have the escape sequence wrong....

Bob S.


"Klas Engwall" <klas.engwall@nospam.please> wrote in message
news:44344476.422114889@news.wineasy.se...
> Bob,
>
not[color=darkred]
it[color=darkred]
image[color=darkred]
several[color=darkred]
Is[color=darkred]
>
> I suspect that there is a greyscale in your PCX file. Reduce it to
> just black and white and try again. You will of course get a better
> result if the signature is written in black ink and not in blue.
>
> Regards,
> Klas
>
> -------
> klas dot engwall at engwall dot com
>
> http://www.engwall.com/clipper/
>
> The LFN Library for Clipper
> The LanMan Library for Clipper
> The NFPAT1A Timeslice release patch for the Nanforum Toolkit



Klas Engwall

2006-04-06, 9:55 pm

Bob,

>Klas, I have everything working quite well now. But I am using the
>"download" and "unload" routines that I downloaded with pcx2pcl. Of course
>the problem with this is that it works for the LPT1 port and I have to do a
>swpruncmd to execute. I would love to now write my own function call to
>download the macro to the printer and also to unload the macro. Can you
>point me in the right direction of ESC sequence codes to do this.
>
>I have downloaded the HP Macro Commands Programming Hints but some where I
>am screwing up
>
>I have read my .pcl file as a variable data=memoread("file.pcl"). Then I
>set device to print, set printer to lpt1, and start sending the following
>sequence:


The first thing to look out for is that "file.pcl" must be less than
64KB in size in order to memoread()ing it successfully. I would
recommend fread()ing and fwrite()ing it in chunks of a few KB instead,
or it will come back and bite you in a while.

>@0,0 say chr(27)+"&f1Y"+chr(27)+"&f0X"+data+chr(27)+"f1X"


The last part is missing the ampersand: chr(27)+"&f1X"
You may also want to add chr(27)+"&f10X" at the very end to make the
macro permanent. That means that it will not be deleted from the
printer's memory until you send a delete command or turn off the
printer.

>then I try to run the macro with @10,50 say chr(27)+"&fs1y3x1S"


I don't do it quite like that, but it looks valid: Push the cursor,
call the macro, pop the cursor.

>but I am getting gibberish on the printout.
>
>I must have the escape sequence wrong....


Not necessarily, except for the ampersand above. The big difference
between what you do now and what you did with the download and unload
utilities is that download puts the printer port in raw mode (the same
as copy with the /B switch on the command line). You are printing with
the @ say command without first telling the port to expect binary
data. Sometimes that will work and sometimes it will not. It depends
on what happens to be in the individual bytes in the pcl file.

You need a pair of low level functions to manipulate the port. And by
coincidence that is exactly what I have here :-).

Then you fopen() the printer port, pass the port's file handle to my
ioraw() function, fopen() the pcl file, fread() from the file and
fwrite() to the port until ready, fclose() the pcl file, pass the
port's file handle to iocooked() to reset it to text mode and finally
fclose() the port. Stir well for five minutes, and don't forget the
baking powder :-)

Is that your real email address in the headers?

Regards,
Klas

-------
klas dot engwall at engwall dot com

http://www.engwall.com/clipper/

The LFN Library for Clipper
The LanMan Library for Clipper
The NFPAT1A Timeslice release patch for the Nanforum Toolkit
Robert J. Stuart

2006-04-07, 7:55 am

Klas, I did have the "&f1X" correct in my code, it was a typo error in my
message. I will try and use fopen(), fread(), fwrite(), for the data
instead of memoread() as you suggest. I think the problem is a you said,
setting the printer to "raw" to move the binary data to it. Two of my
signature files seem to work with my download code and the rest does not.
Yet they all work with the pcx2pcl download program. So the pcl image looks
like it is valid, just that my download function has a flaw, and that looks
like the binary data is not being download to the printer correctly.

Yes my email address is rjstuart@earthlink.net . I also use
rjstuart@shootata.com as my business address.

Thanks for all the help Klas.

Bob S.


"Klas Engwall" <klas.engwall@nospam.please> wrote in message
news:4435b4f1.516445939@news.wineasy.se...
> Bob,
>
course[color=darkred]
a[color=darkred]
I[color=darkred]
I[color=darkred]
>
> The first thing to look out for is that "file.pcl" must be less than
> 64KB in size in order to memoread()ing it successfully. I would
> recommend fread()ing and fwrite()ing it in chunks of a few KB instead,
> or it will come back and bite you in a while.
>
>
> The last part is missing the ampersand: chr(27)+"&f1X"
> You may also want to add chr(27)+"&f10X" at the very end to make the
> macro permanent. That means that it will not be deleted from the
> printer's memory until you send a delete command or turn off the
> printer.
>
>
> I don't do it quite like that, but it looks valid: Push the cursor,
> call the macro, pop the cursor.
>
>
> Not necessarily, except for the ampersand above. The big difference
> between what you do now and what you did with the download and unload
> utilities is that download puts the printer port in raw mode (the same
> as copy with the /B switch on the command line). You are printing with
> the @ say command without first telling the port to expect binary
> data. Sometimes that will work and sometimes it will not. It depends
> on what happens to be in the individual bytes in the pcl file.
>
> You need a pair of low level functions to manipulate the port. And by
> coincidence that is exactly what I have here :-).
>
> Then you fopen() the printer port, pass the port's file handle to my
> ioraw() function, fopen() the pcl file, fread() from the file and
> fwrite() to the port until ready, fclose() the pcl file, pass the
> port's file handle to iocooked() to reset it to text mode and finally
> fclose() the port. Stir well for five minutes, and don't forget the
> baking powder :-)
>
> Is that your real email address in the headers?
>
> Regards,
> Klas
>
> -------
> klas dot engwall at engwall dot com
>
> http://www.engwall.com/clipper/
>
> The LFN Library for Clipper
> The LanMan Library for Clipper
> The NFPAT1A Timeslice release patch for the Nanforum Toolkit



Robert J. Stuart

2006-04-07, 7:55 am

Klas, I did have the "&f1X" correct in my code, it was a typo error in my
message. I will try and use fopen(), fread(), fwrite(), for the data
instead of memoread() as you suggest. I think the problem is a you said,
setting the printer to "raw" to move the binary data to it. Two of my
signature files seem to work with my download code and the rest does not.
Yet they all work with the pcx2pcl download program. So the pcl image looks
like it is valid, just that my download function has a flaw, and that looks
like the binary data is not being download to the printer correctly.

Yes my email address is rjstuart@earthlink.net . I also use
rjstuart@shootata.com as my business address.

Thanks for all the help Klas.

Bob S.



"Klas Engwall" <klas.engwall@nospam.please> wrote in message
news:4435b4f1.516445939@news.wineasy.se...
> Bob,
>
course[color=darkred]
a[color=darkred]
I[color=darkred]
I[color=darkred]
>
> The first thing to look out for is that "file.pcl" must be less than
> 64KB in size in order to memoread()ing it successfully. I would
> recommend fread()ing and fwrite()ing it in chunks of a few KB instead,
> or it will come back and bite you in a while.
>
>
> The last part is missing the ampersand: chr(27)+"&f1X"
> You may also want to add chr(27)+"&f10X" at the very end to make the
> macro permanent. That means that it will not be deleted from the
> printer's memory until you send a delete command or turn off the
> printer.
>
>
> I don't do it quite like that, but it looks valid: Push the cursor,
> call the macro, pop the cursor.
>
>
> Not necessarily, except for the ampersand above. The big difference
> between what you do now and what you did with the download and unload
> utilities is that download puts the printer port in raw mode (the same
> as copy with the /B switch on the command line). You are printing with
> the @ say command without first telling the port to expect binary
> data. Sometimes that will work and sometimes it will not. It depends
> on what happens to be in the individual bytes in the pcl file.
>
> You need a pair of low level functions to manipulate the port. And by
> coincidence that is exactly what I have here :-).
>
> Then you fopen() the printer port, pass the port's file handle to my
> ioraw() function, fopen() the pcl file, fread() from the file and
> fwrite() to the port until ready, fclose() the pcl file, pass the
> port's file handle to iocooked() to reset it to text mode and finally
> fclose() the port. Stir well for five minutes, and don't forget the
> baking powder :-)
>
> Is that your real email address in the headers?
>
> Regards,
> Klas
>
> -------
> klas dot engwall at engwall dot com
>
> http://www.engwall.com/clipper/
>
> The LFN Library for Clipper
> The LanMan Library for Clipper
> The NFPAT1A Timeslice release patch for the Nanforum Toolkit



Klas Engwall

2006-04-07, 6:55 pm

Bob,

>Klas, I did have the "&f1X" correct in my code, it was a typo error in my
>message.


That's what I thought.

> I will try and use fopen(), fread(), fwrite(), for the data
>instead of memoread() as you suggest. I think the problem is a you said,
>setting the printer to "raw" to move the binary data to it. Two of my
>signature files seem to work with my download code and the rest does not.
>Yet they all work with the pcx2pcl download program. So the pcl image looks
>like it is valid, just that my download function has a flaw, and that looks
>like the binary data is not being download to the printer correctly.


Some files working and some not is a sure sign of the port not being
configured correctly for the data sent to it, so setting it in raw
mode first should fix it. Check your mailbox!

>Thanks for all the help Klas.


You're welcome

Regards,
Klas

-------
klas dot engwall at engwall dot com

http://www.engwall.com/clipper/

The LFN Library for Clipper
The LanMan Library for Clipper
The NFPAT1A Timeslice release patch for the Nanforum Toolkit
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com