473,387 Members | 1,579 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Printers

We are a small programming company that has customers with Okidata printers
(set to IBM emulation). We do not want to print in a font that would result
in near letter quality printing as it is very slow. So in our code we have
printer.font = "12 CPI HSD", or "10 CPI UTILITY". Sometimes we need 12
pitch, other times 10 pitch. If anyone can help with these questions, it
would be appreciated:
1) After the printer.enddoc command, do we need to set the printer back to
some sort of default? Because it seems if we do the 12-pitch, it stays in
12-pitch.
2) Sometimes, our customers might want to print their invoice to a laser
printer, in which case the above fonts won't work. Is there a way to
determine if the current printer is a laser/inkjet so we can use a different
pitch and/or font?
3) If we set our Okidata dot matrix driver to Generic / Text Only, then it
prints in HSD mode, but doesn't recognize any commands. Maybe there's a
trick to getting it to recognize pitch?

If someone has an article or web site on the inner workings of the printer
object, that would be great. So far, I'm having trouble finding out what all
the commands are
Jul 17 '05 #1
2 4156
1) Try assigning the required pitch to a variable such as pptich(0)= "12 CPI
HSD", ppitch(1) = "10 CPI UTILITY". Therefore you can assign the required
pitch with a simple Option button choice before the document is printed
(ie:Printer.Font = ppitch(x)) .

2) I'm not sure what you're asking for but there are many ways to find the
printdevice on a system. Here is a small API function that returns the
printer properties. From that you can write some code for use with the
printers you desire.

Private Declare Function OpenPrinter Lib "winspool.drv" Alias "OpenPrinterA"
(ByVal pPrinterName As String, phPrinter As Long, pDefault As Any) As Long
Private Declare Function ClosePrinter Lib "winspool.drv" (ByVal hPrinter As
Long) As Long
Private Declare Function PrinterProperties Lib "winspool.drv" (ByVal hwnd As
Long, ByVal hPrinter As Long) As Long
Private Sub Form_Load()

Dim hPrinter As Long
OpenPrinter Printer.DeviceName, hPrinter, ByVal 0&
PrinterProperties Me.hwnd, hPrinter
ClosePrinter hPrinter
End Sub

I hope this helps a little.

"Joel Ribiat" <jo**@ecsnj.com> wrote in message
news:F%*****************@nwrddc01.gnilink.net...
We are a small programming company that has customers with Okidata printers (set to IBM emulation). We do not want to print in a font that would result in near letter quality printing as it is very slow. So in our code we have
printer.font = "12 CPI HSD", or "10 CPI UTILITY". Sometimes we need 12
pitch, other times 10 pitch. If anyone can help with these questions, it
would be appreciated:
1) After the printer.enddoc command, do we need to set the printer back to
some sort of default? Because it seems if we do the 12-pitch, it stays in
12-pitch.
2) Sometimes, our customers might want to print their invoice to a laser
printer, in which case the above fonts won't work. Is there a way to
determine if the current printer is a laser/inkjet so we can use a different pitch and/or font?
3) If we set our Okidata dot matrix driver to Generic / Text Only, then it
prints in HSD mode, but doesn't recognize any commands. Maybe there's a
trick to getting it to recognize pitch?

If someone has an article or web site on the inner workings of the printer
object, that would be great. So far, I'm having trouble finding out what all the commands are

Jul 17 '05 #2
My inclination would be to bypass the printer driver and print
directly to the Spooler using the OpenPrinter API

Not exactly the 'Windows Way', but OKI line printers are not really
Windows printers

IIRC there is a command for setting OKIs back to their 'turn on' state
- however it is probably better to explicitly do this yourself

Another poster answered most of the rest.

On Mon, 01 Dec 2003 19:54:13 GMT, "Joel Ribiat" <jo**@ecsnj.com>
wrote:
We are a small programming company that has customers with Okidata printers
(set to IBM emulation). We do not want to print in a font that would result
in near letter quality printing as it is very slow. So in our code we have
printer.font = "12 CPI HSD", or "10 CPI UTILITY". Sometimes we need 12
pitch, other times 10 pitch. If anyone can help with these questions, it
would be appreciated:
1) After the printer.enddoc command, do we need to set the printer back to
some sort of default? Because it seems if we do the 12-pitch, it stays in
12-pitch.
2) Sometimes, our customers might want to print their invoice to a laser
printer, in which case the above fonts won't work. Is there a way to
determine if the current printer is a laser/inkjet so we can use a different
pitch and/or font?
3) If we set our Okidata dot matrix driver to Generic / Text Only, then it
prints in HSD mode, but doesn't recognize any commands. Maybe there's a
trick to getting it to recognize pitch?

If someone has an article or web site on the inner workings of the printer
object, that would be great. So far, I'm having trouble finding out what all
the commands are


Jul 17 '05 #3

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

Similar topics

5
by: Aaron_TekRecycle.com | last post by:
Someone must have done this before?!? I have VBS code that will Enumerate all the Printers in the AD and Add the Printer Connection to the client... I'm just not a web developer so I need some...
0
by: Simon Thompson | last post by:
Hi, I have a VB6 ActiveX DLL that we use for printing. It iterates through the printers collection to set the printer to the one the user requested. This is called from ASP (VB Script) pages,...
1
by: Vanessa | last post by:
Hi, I'm trying to loop through all the printers in my computer system using WMI. However, I found out that it doesn't really get the correct number of printers in my system. I have 16...
1
by: TheThrill | last post by:
I've got a report, Report1 that i want to print to network Printers A, B, C all with one key stroke. How do i do this?
7
by: trint | last post by:
How can I add all the network printers to a combobox? Thanks, Trint
2
by: Tessa | last post by:
Hi, We have a .net web application, and are trying to use PrinterSettings.InstalledPrinters to list the printers installed on the webserver. (Windows 2003 server R2, IIS 6, .net framework 2.0.)...
5
by: lmttag | last post by:
ASP.NET 2.0 (C#) application Intranet application (not on the Internet) Using Windows authentication and impersonation Windows Server 2003 (IIS6) Server is a member server on a domain Logged...
0
by: Ravigwipro | last post by:
Hi, I m able to get the printers object to know what are the printers had been installed and all. here my requirement is i have to write a data from VB to MS Word. for the page setup i have to...
0
by: Peter Duniho | last post by:
On Wed, 23 Apr 2008 09:40:14 -0700, Al Meadows <fineware@fineware.com> wrote: This doesn't really seem to be a .NET or C# question. However, you may want to look at the driver settings...
4
by: Frank Rizzo | last post by:
I basically need a list of printers that's returned by the Find Printers dialog ( http://www.sqleffects.com/mystuff/findPrinters.png ). I've tried the path of DirectoryEntry entry = new...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.