Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 5619
  • Last Modified:

Setting Printer Font for Dot Matrix printers

I would like to know how I can set the printer fonts prior to printing via the Dot Matrix printer.
What happen is when I have changed the fonts to Courier New and print via my HP Laser printer, the
document will be printed with Courier New font. But when I sent the same document to the Dot Matrix printer, it will be printed with the Dot Matrix default font and not Courier New.

The printing is done the Printer object. Any idea why? I know it is not because the printer Dot Matrix does not support Courier New font since I have tested printing a document using WordPad and the comes out as Courier New fonts.
0
wsm
Asked:
wsm
  • 3
  • 2
1 Solution
 
mrmickCommented:
Try this,

Printer.FontName = "Arial"
Printer.Print " "
Printer.FontName = "Courier New"
' Note - you may have to repeat this for each new page.  This code can also be left as is for the HP printer.
0
 
mrmickCommented:
Whoops, I meant to offer that as the answer.
0
 
wsmAuthor Commented:
What I had set it this

gFontName = "Courier New"
TextLine = "Testing printing to local printer."

Printer.FontName = gFontName
Printer.NewPage
Printer.Print
Printer.Print TextLine
Printer.EndDoc

This codes works for Laser Printer as I would be able to see the
text being printed as Courier New. BUT if I print via the Dot
Matrix printer, it will not give me the font Courier New. instead
it prints out the text using the default font. However, if I use
WordPad application to print out the document and setting the
font to Courier New, it will come out nicely as Courier New at
the Dot Matrix.
0
 
wsmAuthor Commented:
What I had set it this

gFontName = "Courier New"
TextLine = "Testing printing to local printer."

Printer.FontName = gFontName
Printer.NewPage
Printer.Print
Printer.Print TextLine
Printer.EndDoc

This codes works for Laser Printer as I would be able to see the
text being printed as Courier New. BUT if I print via the Dot
Matrix printer, it will not give me the font Courier New. instead
it prints out the text using the default font. However, if I use
WordPad application to print out the document and setting the
font to Courier New, it will come out nicely as Courier New at
the Dot Matrix. Any reason why VB 4.0 (32-bit) is having this
problem with setting font before printing to Dot Matrix printer?
0
 
mrmickCommented:
Yes, it's a bug.  Try what I suggested.

Printer.FontName = "Arial"
Printer.Print " "
Printer.FontName = "Courier New"
Printer.Print "This text should be in a Courier New font for both printers."


0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now