Question

  Asked: Jun 29 2005   11:16 AM GMT
  Asked by: LinaVC


Printing a Signature Font


Graphical User Interfaces, Development, RPG

Has anyone programmed a font in a printer file that prints a signature? We have an HP4250 with a memory card containing this font. We were given by the vendor a control string to specify in the program. I think I need to customize a Work Station Customizing Object (WSCST) for the printer and for the new font, but cannot get past the syntax when specifying the vendors control string :

<esc>201Q<esc>(s0p2h72v0s0b201T

Thank you,
Lina

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0



I can't answer your question exactly, but this a rough idea of how it works. This should help you debug parts of the problem. The signature gets turned into points (like pixels) in the ASCII characters of the font. Since space is limited for mapping the image, many characters are used in the font to piece together the bitmap. For example, you could put first name in the letter A and lastname in the letter B. Then to print the font, change to the font MySignature in your word processor and print "AB" to piece toghether the image. Depending on the ascii characters they used, you have to know the codes in the font. I suspect the control string is the ascii chars they want you to use. They probably picked some uncommon ASCII codes just to keep random users from discovering the signature. Start by testing the font on the printer, go to the printer and print a test page of the font. To test your word processor try to use the font with some standard characters. If all this works, your probably having trouble with your word processor converting these uncommon ASCII codes to something else. Print the page to a file (thru the printer driver) and check the binary to make sure the right ascii codes get sent to the printer. -- Good luck
  • AddThis Social Bookmark Button

Browse more Questions and Answers on Development and AS/400.

Looking for relevant Development Whitepapers? Visit the SearchSQLServer.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register

JPLamontre  |   Jul 4 2005  1:40AM GMT

Yes, you can do this with a *WSCST, but it is not the best solution.

You have a better choice to code you hexa string directly in the PRTF (there is a keyword specialized).
AND
when CRTPRTF, add the parameter that permits the prtf to embbed hexa string (something like allow not printable char)
I have do this some years ago, it runs, I have forget the details.

 

LinaVC  |   Jul 14 2005  10:44AM GMT

Thank you all for you suggestions. I will look in to your ideas.

 

VBOTone  |   Jul 14 2005  11:17AM GMT

You will need to send the escape character using “transparency”.

First, either override the print file or change it to not replace unprintable characters.
OVRPRTF … RPLUNPRT(*NO)

Second, in you program, replace the excape character with x’03011B’.
The x’03′ indicates transparency. The x’01′ indicates how many bytes are transparent.
This will ensure that the escape character, the x’1B’, will not be translated to a space, x’40′.

The rest of the characters in the control string should be translated. Simply type them “as is”.
Concatenate the strings and place them in a printed field.
This works with all kinds of printer control strings.

Happy testing!

 

VBOTone  |   Jul 15 2005  6:51PM GMT

Here is some example code that worked for LinaVC.

d Esc c x’03011B’
d Str1 c ‘(201QX’
d Str2 c ‘(s0p2h72v0s0b201Tabcdef’

eval signature = Esc + Str1 + Esc + Str2
write record1

If you are using fixed format RPG, you will have to use the CONCAT op-code.