Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Printer.Font OR Printer.FontName ?


I've seen a lot of examples like:

Printer.Font = "Courier"
or
Printer.FontName = "Courier"

Anyone knows if one is better than the other, or wich one are you using and why?

Thanks!




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Code To Specify Printer FontName
I have recently moved my HP 895Cxi from my laptop to my PC (Windows XP Professional). Now it refuses to recognise fonts and paper orientation specified in my code - see below. (I assume 2 = Landscape)


Printer.FontName = "Comic Sans"
Printer.FontSize = 14
Printer.Orientation = 2

Any ideas very welcome.

Change Font With Printer.Font.Name
I am using:
  Printer.Font.Name = "Courier"
  Printer.Font.Size = 8
  Printer.Print txtData.Text
  Printer.EndDoc

Because txtData contains columns of text and/or numbers, I do not want to use a variable width font.
Both the Form and Textbox fonts are set to Courier.
But the code above does not actually change the font to Courier on the printer.

I know this is an old problem, but I can't find the solution on Tek-Tips or anywhere on the net.
I have seen that some programmers use Doevents after setting the new font, or use Printer.Print "" before printing the data.
Neither of these work for me.

In another program I am using Printer.Font.Name = "QuickType Mono"
and that works. But it doesn't work in this program.

Can someone explain this?




Printer Font
How do I test if a specific font is installed in a printer?

Printer Font, Please Help
Why doesnt this work to me?

Printer.Font = "Courier"

It print with another font, and i need it to print with a font that all the characters´size are the same. Thank you

Printer Font
Hello

I have a form with a Rich Text Box. I have text in the box and the layout needs to stay as it is in the box when it prints. It looks like the font gets changed from the RT box to the printer so that the layout is not the same when it's printed as it is in the RT box. The RT box uses Courier New font. How do I get the printer to use the same font. Or is there something else going on that makes the printed look like a completely different font than the screen?

I tried the following but got an error message: invalid use of property. On debug it highlights Name.


Code:
Private Sub cmdPrint_Click()

Printer.Font.Name ("Courier New")

Printer.Print RichTextBox1.Text

Printer.EndDoc

End Sub


Thanks

David

Printer Font
I need to send a print job to a pinter and I need to be able to tell the printer that
I need to print it in "MICR" font


Escape sequence Font#
micr <esc>(08<esc>(s0p10.00h8.4v0s0b0y slot 38

so far I got..


Private Sub Command1_Click()

Printer.Print " Test " & No.Text
Printer.Print "
End Sub

Printer Font
I am having such trouble printing out a report using the printer object. I have each row I'm printing formated so that the spacing is constant between each column. It looks PERFECT when using debug.print into the local window. But when I use
printer.print all of the columns are jogged because of the font the printer is using (i.e "TEST" prints out wider then "CODE") even though they are the same amount of characters) I have tried playing with the printer font and changing it to "Fixedsys" (which usuall prints evenly) but have failed.
Can someone tell me how to change the font for the printer in detail.

Thank you very much

Printer Font - Customizing
I am trying to change the printer font object properties in a VB6 project. I need to increase the font size, and decrease the font weight. I have tried doing

Printer.Font.Weight = 200
Me.Font.Weight = 200

and

Dim font1 As New StdFont
font1.Weight = 200
font1.Size = 14
font1.Name = "Arial"
Set Printer.Font = font1
Set Me.Font = font1

Neither of these seem to work properly. As I stepped through the printing function in debug mode, I saw that the weight remained unaffected after the assignment of 200; the weight remained at 400, even after the assignment, in both the new font and the printer font. The font size also doesn't seem to increase according to my assignment. After the assignment of 14 to font1, the font size listed for font1 was 13.5, and after the assignment to me.font the font size was 12.98.

I am looking to change the printed font, from the printer, to a light, thin, large font. It currently comes out looking very bold, bold is set to false, I checked.

Am I totally barking up the wrong tree? Could someone please help me change the printer font?

Thanks a bunch in advance for your help.

Printer Font Problem
In my program I use a ‘user-defined type’ variable to store printer settings. When the program starts for the very first time, the user selects the printer font of their choice by using ShowPrinter method of the CommonDialog control. The 'user-defined variable' is declared as:

Public Type PrFontRecord
aName As String
bSize As Single
cBold As Boolean
dItalic As Boolean
eUnderline As Boolean
oOrientation As Integer
End Type
Public PrFont As PrFontRecord

When the user is ready to print I set the printer to an object named CVT

Set CVT = Printer

and then I assign the font properties stored in the 'user-defined variable' to the printer object:

CVT.Font.Name = PrFont.aName
CVT.Font.Size = PrFont.bSize
CVT.Font.Bold = PrFont.cBold
CVT.Font.Italic = PrFont.dItalic
CVT.Font.Underline = PrFont.eUnderline
CVT.Orientation = PrFont.oOrientation

The ‘user-defined variable’ is stored in the hard disk and each time the program is started the printer settings are read from the hard disk and assigned to the ‘user-defined variable’.

I do this in order to save the printer settings for this particular program if the default printer setting was changed by another program.

The problem is, sometimes the printer (HP LaserJet 6P) prints the document with the correct font name and settings but sometimes the printed output has a different font size (seems to be the default size). What am I doing wrong? Any help is very much appreciated.

Printer.Font Problem
Hi

I haven't been able to find anything on this with the search here and the Microsoft website is as helpful as a fart in a spacesuit.

I'm having a problem where I cannot set the printer font at runtime.

I'm filling an RTF with the text I want to print and have the font on that set to Fixedsys but when I print it comes out in Arial.

I've tried every way I can find to set this property in the Printer object but none work. I get no error messages or anything, it just doesn't accept the new font.

Thanks for any help you might provide.

Printer Resident Font
I'm trying to print to a label printer with some fonts, but when they are sent to the printer they are sent as graphic and take longer. I have learned that the printer has some resident fonts that I could use that would speed it up. I understand these fonts wont be visible in windows applications, but I would like to know how to call them so I can build my label using these fonts in Visual Basic and then send to the printer. Any ideas? It's a Datamax Allegro 2 by the way.

Changing Printer Font
Hai everybody,
I am getting a problem while changing the printer font using the printer.font property. I am assigning it to "Courier" font. But it is not changing the printer font. When i print the printer.font using msgbox it is showing as "Arial" and because of that i am unable align the text. Is it the problem with the printer driver. I am using the dot matrix printer Panasonic KX-P1121.
Please help me very urgent
Thank you all.
Bhaskara Varma

Help With This Printer Font Setting!
I am using commondialog box to print. But I found that I can not change the printer font to "Fixedsys"
It always shows that the printer's font is "Arial".
Does anybody have this problem before?

Changing Printer Font
This might be a dumb question, but I just can't figure it out!

How do I set the font of something I'm printing?
I want what I'm printing to have the font FixedSys, BUT I can't seem to set the printer to that font...

I THINK I'm supposed to use a command like:

Printer.FontName = FixedSys
OR
Printer.Font.Name = FixedSys

I've tried both of these, and they don't change the font... I'm not too experienced with printing, but believe me, after figuring this out, I won't forget how to do it!

Any advice would be greatly appreciated.

Printer Font Type
Hi Everyone,

I am using this code to print my name in the Lucida Handwriting printer font type, but the printer is not changing the font type. What am I doing wrong? Thanks for your help.


Code:

Private Sub Command1_Click()
Printer.CurrentX = 450
Printer.FontName = "Lucida Handwriting"
Printer.Print "Ace Jones"
Printer.EndDoc
End Sub

Font When Using Printer.print
Hi, I'm using the basic print command in VBasic.
However when I print at home it comes out fine but when I print the same thing at the client it comes out VERY small !
I was wondering if there is anyway to cahnge the font and size ?

Any suggestion will be greatly appreciated.

Thank you,
Robin.


The weather is great here in South Africa. + 33 'C

Add Font To Combo Without Printer?
Using Printer.Fonts we can add font to a list or combo...
But how can we do it if users haven't install a printer yet?

Printing Using The Default Printer Font
Hi,
Im currently trying to print out a receipt using the printer object.
The code i have been working on was previously using the "WritePrinter" API and i have been trying to switch it over to use the printer object works fine so far.
My problem 'is' that i want to use the cpi font that "WritePrinter" call was using, (which is a font that came with the printer driver). I can set the font using
Code:
Printer.Fontname = "16 cpi"
, but this method is no good, because i need the receipt to be able to work on a number of differnt receipt printers which do not have the same cpi fonts.
Is there any way i can retreive the default font from the printer?

Ill shutup now

cheers

Printer Not Using Default Font And Quality
I am using the following code to print the bill in a dot-matrix printer. I prefer to use "Printer Object" because it is fast as compared to DataReport.

The problem is the printing with the following command is still slow and not upto the quality. I tested the printer by transferring the text in a text file and printing through MS EDIT program. The printing is fast and of good quality.

How can I set the properties of the printer to that of MS EDIT, i.e., MSDOS default.

Code:
Printer.Print Tab(50 - Len(PermitTitle1) / 2); PermitTitle1 'Centered
Printer.Print Tab(50 - Len(PermitTitle2) / 2); PermitTitle2 'Centered
Printer.Print Tab(50 - Len(PermitTitle3) / 2); PermitTitle3 'Centered
Printer.Print Tab(50 - Len(PermitTitle4) / 2); PermitTitle4 'Centered
Secondly, as an alternate option, if I transfer the bill into a text file and execute DOS command

Code:
> Type t1.text > prn
then how will I be able to track the finish of the bill and to continue next bill on the next paper.

Data Report - Printer Font
I using Ms Data Report to design a report. there are a lots of data in a row. I using Letter Size as report size (8.5 inch width). and theres not enough space to put my data in one row. There are not other font that enable my data to fit into the paper width, except the font with 17cpi or 20cpi. My printer is providing the font Courier 17cpi, But in the data report design, I cant found this font in the font properties.

can anyone guide me how to solve this problem? how can I use font in the data report? any suggestion of other font which is fixed-width and more narrow (17cpi or 20cpi)?

Thank you

Printer Font Shinks After Awhile
My program prints out tickets for every client that comes in the door. The ticket prints out there name, date, ID number. When the ticket prints it prints out at a font size of 16. But everyday the font will jump from size of 16 to a font size of 8. I have to reboot the computer to reset the font size. Could anyone tell me why this is happening?

Here is my code I am using to print out the ticket

Code:
Dim P As Object

For Each P In Printers
If P.Port = strTicketSel Then
Set Printer = P
Printer.FontBold = True
Printer.FontSize = 16
Printer.Print Me.RichTextBox1.Text
Printer.EndDoc
fnPrintReport = True
Exit For
End If
Next P

Thanks

he9ap00

Help Me To Change The Font Size Of My POS Printer
Hello forum,
I have a TP-100 dotmatix pos printer and I'm curruntly print receipt using printer.print method. But when I try to change the font size using printer.fontsize, there is no effect on the print outs. I want to use different sizes of fonts in my POS printer. Is there any way I can do this without using Printer.FontSize.

I also want to know how to display line of text on a Pole Display. If theres anyone to help me that will be a great help. Thank You!

Printer Not Using Default Font And Quality
I am using the following code to print the bill in a dot-matrix printer. I prefer to use "Printer Object" because it is fast as compared to DataReport.

The problem is the printing with the following command is still slow and not upto the quality. I tested the printer by transferring the text in a text file and printing through MS EDIT program. The printing is fast and of good quality.

How can I set the properties of the printer to that of MS EDIT, i.e., MSDOS default.

Code:
Printer.Print Tab(50 - Len(PermitTitle1) / 2); PermitTitle1 'Centered
Printer.Print Tab(50 - Len(PermitTitle2) / 2); PermitTitle2 'Centered
Printer.Print Tab(50 - Len(PermitTitle3) / 2); PermitTitle3 'Centered
Printer.Print Tab(50 - Len(PermitTitle4) / 2); PermitTitle4 'Centered

Secondly, as an alternate option, if I transfer the bill into a text file and execute DOS command

Code:
> Type t1.text > prn

then how will I be able to track the finish of the bill and to continue next bill on the next paper.

Printer Font List - Illustrated
I have a list box with all of the printer fonts. I want to save every font to the same rtf or txt file...
BUT...
I want each font to say it's name on the document and for it's name to be written in the style of that font...
eg.
SNAP ITC will be in the SNAP ITC font
ARIAL will be in the ARIAL font.
I have tried using rich txt boxes that get each name from a list box and convert it into it's font, however - the RTF box doesn't save the styles it just comes out in MSSerif font, 400 lines of a file all saying the font name.

MY QUESTION IS:
How can I do a SaveFile command on a Rich Text box and get it to save the styles too?? PLEASE REPLY BECAUSE I AM GETTING REALLY PISSED OFF!!
(sorry long msg)
Bruta?!

Is The Font Transparent Property Works For Printer.
Can any body tell me that is the font tranparent property works for printer. If no then then how can we print text over graphics.

Getting Font Bold In Generic Text Printer
Iam doing the conversion project. Prevously the project is in FOXPRO of DOS version. Now it has been converting in to visual basic & oracle.
Already they are taking reports on forpro, which are maintaining the font type of GENERIC TEXT ONLY FONT and the printing job is very fast. So I have tested with GENERIC TEXT PRINTER and I got the same result. But I stucked with the Bolding of certain figures in report. I have used the Printer objects fontbold property but I unable to get the desired result. so please help me to solve the problem. I should get the font type of GENERICT TEXT ONLY type and as well bold


hans

Changing Font Size For Printer Object
Does anyone know how to change font size in using the Printer object? I have 2 applications, one as a DOS-based Clipper application, the other was the same application but created in VB 6.0. The reports for both applications are printed in a dot-matrix printer. When I print my reports in VB using the Printer.Print command, I get smaller fonts, therefore, more lines are printed on a page when compared to the output of my DOS application. Thanks in advance.

Printer Illegal Font Data While Trying To Print A Picture
Hello,

I'm trying to print a picture to my HP4000N but all I get is Illegal Font Data.

When I turn of True type Fonts as Bitmaps, It works but I need that for My Euro sign.

Best Regards,

Jeffrey

Printer Font Size Vs Picturebox/form/font Size
HI Everibody.
Sorry for my bad English

Why the printer object font size is different as in Picturebox or form font size property?

I copyied in a PictureBox all the properties availabe in the printer object (width, height, scalemode, scalewidth, etc, etc) to simulate a printer object, but the font size in the picturebox is always greater therefore printer.currentX & Y does not match picture1.currentX & Y

Now, how can I configure a picturebox that matches perfectly the printer proportion? I need it to make Preview routine

How can I caculate the correct scale for Picture1?

Changing Paper Size In Cdl.ShowPrinter Won't Change Printer.width And Printer.height
Hi,
I use this code to let the user change the paper size and orientation before printing.


VB Code:
CommonDialog.ShowPrintermsgbox printer.width & " " & printer.height 'print code here ...  


but under Windows XP even when I change the paper size from the dialog the vb's printer.width and printer.height arn't changed ....

Is there a better way to change the paper size .. and to retrieve the changed paper size ?

Vb/crystal:how To Replace Crviewer Default Printer With Windows Common Dialog Printer
hi all,
I'm trying to create a crystal report through vb.
does anyone know how to replace the default printer ( that comes with crviewer control) with a windows common dialog printer. I mean, with the options to select differnt printers etc.

How To Verify The Computer Is In Connecting Printer Status Include Remote Printer...?
How to verify the computer is in connecting Printer status include remote printer...?

Avoid Printer From Ejecting The Paper After The Last Line Printed? (VB - Printer.print)
how to stop the printer from ejecting the paper after the last line has printed?
assume i'm making an invoice for my small store, and i want to print the items my customer bought downward, so whether it's 1 item, or 5 items, or 100 items, i want the printer stop after the last item has printed ( plus my invoice's footer off course ). i am using VB 6, and 'printer.print' code to print and my printer is EPSON LX-300+. and my database is SQL Server 2000 Developer Edition. is there anyone can help? i really appreciate any help you offer

PS : i've been searching this forum and try all topics related to my issue but nothing's suitable for me...so if there's someone can be more specific, i would really appreciate it

How Can I Change The Default Printer At Runtime To Use It With Printer.print Command?
Hi everyone,
I have a little application which uses printer.print command to do some print jobs, of course there are some other things that I print using Data Reports.
When my application starts, I think it instantiates printer object with the default printer (lx300). Once the application is started, there are some options that use printer.print, but there are options that use printer.print too but I need to print them in another printer (ip1000). I have a common dialog that lets me choose the printer, and when I choose ip1000 every printer.print call goes to lx300. I assume there's no way to "reinstantiate" printer object to print in ip1000.
Also, when I close my application ip1000 becomes my default printer. Does the common dialog can select a printer without changing the Windows default printer like Word, Excel. do?

Thanks a lot for your help

Select Printer Tray - Common Dialogue Show Printer
I'm using the following code to show the common dia... control. The user selects the printer and number of copies... Then access is opened in the background and queries a report and prints it. It prints to the correct printer, and the correct number of copies...

BUT...

We recently switched one of our network printers out and for some reason now, the printer ONLY prints from this program to the 3rd tray, which contains invoice paper. I use the common dialoge to change the tray and that doesn't do it. I even go into the printer options and specify the correct tray and it still comes out on the wrong one...

How can I fix this?


Code:
Private Function PrintOrder()
Dim StrCopies As Integer
Dim IntCopies As Integer
CD1.ShowPrinter
IntCopies = CD1.Copies
Dim acApp As Access.Application
Dim strSQl As String
strSQl = "[ID]=" & Me.txtrecid.Text
Set acApp = New Access.Application
acApp.OpenCurrentDatabase "\SERVERAction FilesLightingVB6OrderOrders.mdb"
acApp.DoCmd.OpenReport "Order", acViewPreview, , strSQl
acApp.DoCmd.PrintOut acPrintAll, , , acMedium, IntCopies
acApp.Quit
Set acApp = Nothing
End Function

VB6 - Print A Text File To A Remote Printer And My Default Printer
Please how can I get a text file located in my hard drive (C:) to print to my default printer and also print to a Remote Printer?

The remote printer is named "U288".

Any workable code snipet will be appreciated.

Thanks y'all.

Giftx.

How To Send Native Printer Language Codes To The Printer Driver?
how to send native printer language codes to the printer driver?

here some native printer language codes for testing

Epson FX Printer Codes:-
Printer Operation:

Decimal ASCII Description
7 BEL Beeper
17 DC1 Select printer
19 DC3 Deselect printer
14 SO Select double width for one line
15 SI Select condensed mode
18 DC2 Cancel condensed mode



how to pass these PCL codes to printer through VB programming for changing printer settings dynamically.
try to solve this problem.

KS Raju.

How To Pass Printer Codes (ASCii Values) To Dotmatrix Printer?
I want to pass printer code values to dotmatrix printer.
here some of the printer codes listed below

Printer Operation:
Decimal ASCII Description
7 BEL Beeper
17 DC1 Select printer
19 DC3 Deselect printer

how to pass vlues values using printer.print object.

How Can I Change The Default Printer At Runtime To Use It With Printer.print Command?
Hi everyone,
I have a little application which uses printer.print command to do some print jobs, of course there are some other things that I print using Data Reports.
When my application starts, I think it instantiates printer object with the default printer (lx300). Once the application is started, there are some options that use printer.print, but there are options that use printer.print too but I need to print them in another printer (ip1000). I have a common dialog that lets me choose the printer, and when I choose ip1000 every printer.print call goes to lx300. I assume there's no way to "reinstantiate" printer object to print in ip1000.
Also, when I close my application ip1000 becomes my default printer. Does the common dialog can select a printer without changing the Windows default printer like Word, Excel. do?

Thanks a lot for your help

HELP! Populating Combo Boxes With Printer List And With Printer Port
Well I want to have a selectable list of availiable printers in a combo box along with a combo box with the ports it could use...

I know its somehow possible with printer.port and printer.devicename.

Also how would I select the different printers for using, instead of going for say

If Combo1.Text = Dr.Polski-HPDESKJET...etc

Instead can i set a value to each printer in the combo box e.g. p1 and p2.

- and the same goes with any other combo boxes, otherwise I find it irraitating when trying to set font colours with the

If Combo1.Text = &0HH0..etc

Thanks , I hope you can help...

(by the way I am pretty new to VB , a few weeks so go easy on me )



Edited by - Dr Polski on 5/15/2004 4:55:43 AM

Printer.Height And Printer.Width Refuse To Change!
i'm using vb 6 and win xp. basically, no matter what value i set to printer.height and printer.width makes any change. check out my code, i'm probly doing something real dumb:


Label1 = Printer.Width 'gives value of 12240
Printer.Width = 6 * 1440 '6 inch Width x 1440 twips per inch
Label2 = Printer.Width 'gives value of 12240


i've tried various values, not just 6 *1440; none work. the papersize value does hower change from 1 to 256, which makes sence, but neither the width nor the hieght budge.

any ideas on why this happens, and how to fix it?

thx

How To Change Printer Orientation Specially For Dot Matrix Printer?
I want to konw API to change Printer Orientation? How to do it?

How To Check The Printer On The Network Before Printer.print Method?
Hi,
I am trying to write code to be able to give user option to choose a
printer on the network before they can printer the job.

With printer.print method, VB will not prompt the printer on the
network.
It will only print to the default printer.

Is there a way to be able to choose the printer?



Thanks!

How To Print A Specific File To The Printer/network Printer
I want to print data which is entered in rich textbox. Also I want to set top,left,right and bottom margin of file........

Printer Not Responding To Printer.Print --&gt; Help Newbie
First... I am depressed like hell to get this to work.

Problem: I have an "Eltron 310" ID Card Printer. I am trying to do

Printer.PaintPicture IMG_ID,0,0 (where IMG_ID is a picture)
Printer.EndDoc

The above
--> Works with normal printer
--> Does not work with ID Card Printer. ID Printer doesn't even respond to the command, Printer.PaintPicture, nor does it respond to Printer.Print "some text"

PLEASE HELP. ANY CODE IS GREATLY APPRECIATED.

Thanks
Sreeni

Detecting Printer Resolution W/Printer Object
I'm using the Printer object (VB6) to print graphics and need to detect the printer's resolution (in DPI). Tried

X = Printer.PrintQualiy

to no avail. Returns a zero.

It's been several years since I worked with VB, I guess I'm easily stumped...

Can it be calculated using TwipsPerPixel?

Thanks,

joe

Change Printer Name In Printer Dialog Using API In Runtime
Hi all,

My default printer is kyosera 1000. I use following code to select the printer from a print dialog in external application:
Code:
hMain = FindWindow("#32770", "Print")
hChild = FindWindowEx(hMain, 0, "ComboBox", vbNullString)
nret = SendMessage(hChild, CB_FINDSTRINGEXACT, 0, "Kyosera 2500")
If nret <> -1 Then
'To select the printer in combo
Call SendMessage(hChild, CB_SETCURSEL, nret, 0)
End If
The above code selects Kyosera 2500 without any issues. but prints on Kyosera 1000 which is my default printer.

post your suggestions.

Printer Object From The Printer Setup Dialog
Was just wondering how to extract that printer object from a printer setup dialog?
Also, how do you print an object inside a form such as a MSFlexGrid? are there any examples out there? Thank you much

Printer Not Responding To Printer.Print --&gt; Help Newbie
First... I am depressed like hell to get this to work.

Problem: I have an "Eltron 310" ID Card Printer. I am trying to do

Printer.PaintPicture IMG_ID,0,0 (where IMG_ID is a picture)
Printer.EndDoc

The above
--> Works with normal printer
--> Does not work with ID Card Printer. ID Printer doesn't even respond to the command, Printer.PaintPicture, nor does it respond to Printer.Print "some text"

PLEASE HELP. ANY CODE IS GREATLY APPRECIATED.

Thanks
Sreeni

Copyright © 2005-08 www.BigResource.com, All rights reserved