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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing on preprinted forms with different fonts 2

Status
Not open for further replies.

robertcollins

Programmer
Mar 19, 2001
9
US
I am having a problem with getting my application to print preprinted form with different font size - especially aligning exactly with the assigned space.

So far I am able to print it OK if I use my printer as “generic text /only” printer. If I use it as “HP 1100” – even with a proportional font like Courier New 12 (supposed to be generic text printer font) the line spacing changes and it prints at off location.

I would like to use Courier New 9 or 10 with same spacing in between the lines to keep at proper locations.

Thanks a lot in advance.
 
I would like to use Courier New 9 or 10 with same spacing in between the lines to keep at proper locations

The trouble is that different sizes of fonts have different heights. And when printer programs are figuring out where to print the next line they add the height of the font to the spacing after a row and the spacing before the next row and start there. So you need to adjust the spacings to allow for the adjustment in font sizes.

I suppose you can play with the windows printer setup to find out what values to use and then write a program to send the proper values whenever needed. Particularly when you're only using a couple of font sizes this would be better than some more elaborate scheme of calculating the exact sizes. -- Dave
 
Robert:

There is an alternative, but it could potentially involve a lot of work. You could create an FRX that duplicates the preprinted form and includes all of your variable information. You could put a clause in the 'print when' field of all of the standard form objects - lines, text, etc. and have your program give the user the option to print data or print data and form. I did a similar task in coding death certificates for all 50 states for a project I built a few years back. Lot's of work, but as long as the end user is permited to reproduce the form the results can be outstanding.

Steve
 
Thanks for above suggestions.

Problem is how do I make micro adjustments to the line spacing which is less than 1 full height of a line ( I am outputting with '@ -,- say ...' commands)? - Actually I need 1.05 factor for adjustment.

I want to use a single font - Courier New 11 but the form's line spacing is calculated for 'courier 12' - generic printer / typewriter.

Thanks.
 
I want to use a single font - Courier New 11 but the form's line spacing is calculated for 'courier 12' - generic printer / typewriter

Not knowing the layout of your document, I can only make general suggestions. If you have at least one blank line between printed lines, you might get away with using say Courier 13 for the intermediate line and then switch back to the Courier 11 for the printed line. You might even be able to find another font with different spacing which would give you what you want.

Another possibility, which I'm not sure works, but I'd think should, would be to use more than one font in a line. Start by printing a space in Courier 12, and then switch to Courier 11 for the rest of the line. I assume the printer driver would space the line based on the maximum letter width. OTOH, maybe you can't switch fonts within a line using some printer drivers. Still, if you can do it with HTML, a rather primative text format, you'd surely think you could with printers.

Dave Dardinger
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top