473,473 Members | 2,060 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to determine printer type?

We're printing invoices using the printer function in VB6. If we print to
an IBM-compatible dot-matrix, we can use a font called "12 CPI HSD" which
works well, since we want to use 12-pitch. If we want to print to our HP
Laser, we need to know that it is a laser so we can change the font to
something comparable. Is there a way to determine what type of printer is
selected - i.e. Laser(or deskjet) or Dot Matrix?
Jul 17 '05 #1
1 4938

"Meyer1228" <ka***@ecsnj.com> wrote in message
news:Ps****************@nwrddc01.gnilink.net...
We're printing invoices using the printer function in VB6. If we print to
an IBM-compatible dot-matrix, we can use a font called "12 CPI HSD" which
works well, since we want to use 12-pitch. If we want to print to our HP
Laser, we need to know that it is a laser so we can change the font to
something comparable. Is there a way to determine what type of printer is
selected - i.e. Laser(or deskjet) or Dot Matrix?


There are winAPI's for printer properties but I don't believe you can
directly draw a "device type or device ID" since all printers suppose to be
treated just like any drawing area.

I can't think of how I would do it. If it is a controlled environment for
example (i.e you're only dealing with a finite printer devices), I probably
would get the printer name and just compare it to the supported list.

One thing I would try probably is set the resolution to beyond what the
device can handle. For example, assuming I have an HP 700 deskjet, when I do
this:

' attempt to set 1200 dpi
Printer.PrintQuality = 1200
x = Printer.PrintQuality
if x < 1200 then ' it failed to set 1200 dpi

Another way is to probably set the printer font directly to what you know
don't exist on the printer:

Printer.Font = "Courier"
x = Printer.FontName
if x <> "Courier" then 'printer can't do Courier substituted X

They are all kludgy was of determining the printer type but given several
known variables and behavior of printers (to include Colormode) you probably
can make a decent decision based on those variables.
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: KohlerTommy | last post by:
In my application I need to give the user the ability to print duplex if the selected printer supports duplex printing. Many of the printer options do not make much sense in my application, and...
12
by: Sunner Sun | last post by:
Hi, all Since the OS look both ASCII and binary file as a sequence of bytes, is there any way to determine the file type except to judge the extension? Thank you!
2
by: Craig Scheets | last post by:
I have writting an application that prints fine, but I have to do a TranslateTransform on the graphics in the OnPagePrint event to get place output at exact X,Y (the application prints checks and...
3
by: Raymond Martin | last post by:
How do I find out if the default printer is offline or online (or has a paper jam)?
6
by: Ioannis Demetriades | last post by:
Hi, I need to change the printer's font to "control" -a printer font, and then send a sequence of characters to the printer. My problem is that I cannot change the printer's font. Can this be...
1
by: pigge79 | last post by:
Hi there, We are thinking of developing a product that needs to be able to parse data printed via some printer driver. The data will then be used to fill a PDF form. We believe the printer...
13
by: Susan Beebe | last post by:
I have downloaded the code described in Microsoft article Q154078. I am trying to send raw ZPL (zebra barcode printer) code from Microsoft access. It works just fine if I hard code the actual...
0
by: Mark | last post by:
Hello, I have a VB6 Project that uses an ini file to save selected printer settings for several forms. The program allows users to select the printer on their work station for printing forms. If...
5
by: =?Utf-8?B?bGpsZXZlbmQy?= | last post by:
Is there any way to do the following: 1. Determine whether ClearType is enabled by the system (under Display Properties - Effects in WinXP). 2. Determine whether a font supports ClearType. ...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.