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!

Sending Fonts Programmtically to an HP printer

Status
Not open for further replies.

barno

Programmer
May 27, 2002
10
How do i set print fonts programatically(using code) in Visual Foxpro to an Hp printer without using report generator?
 
A couple ways right off hand. You can use the printer's own control/escape codes:

???CHR(27) + CHR(nnn) + ...

Or you can print the text using fonts:

???'Last Name: ' + MyTable.LastName FONT 'Arial' STYLE 'BI'
where 'BI' = Bold Italic



Dave S.
[cheers]
 
Barno.. do you really reallywant to do this ?

I spent an absolute age learning to program PCL5 for HP.... for VFP2.6...

It works and works well, but it makes learning VFP look like a cake walk.

If youstill wanna go through with escape codes and "1p1s100c250r" etc etc ... then I suggest you start low dose Prozac now... it dulls the pain.

JF


 
If you're need is to generate reports that don't fit the Report Writer's design, then Dave's suggestion should do it for you.

If you want to preview the report, too, you might find WinPrint useful:
With it, you generate text file reports (including font directives) using whatever method (filetostr() and textmerge are good) you want, then just hand off to WinPrint, which previews and can print it. It supports lines, shapes, images, and colors too.
 
I've been using pcl code for years. It works fine, but has limitations.

I assign the font descriptor to a variable, which makes it easier to select the font..

??? fab8 && font Arial point size 8

I could never get the following to work.
???'Last Name: ' + MyTable.LastName FONT 'Arial' STYLE 'BI'
where 'BI' = Bold Italic

You are using printer fonts, not truetype, so forget about pdf files.

Michael
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top