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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Downloading Soft Fonts from Visual Basic 1

Status
Not open for further replies.

SAMWJ

Programmer
Feb 17, 2004
5
US

I'm presently showing a drop down list of the installed printers on a workstation. The user picks a printer from the list. Some of the printers are network printers. I need to get the port name in order to copy the softfont to the printer prior to spooling the print file.
I'm using the api calls to send raw data to the printer.
Can I append the soft font file with escape codes to a spool file and send it to the printer as one print stream.
 
Probably not. Because the spooled files go through a driver
it may reformat the data coming to it. This you do not want.

Although I don't use VB but rather PowerBasic for windows,
the api call should be about the same.
DIM Pi2(0:0) AS PRINTER_INFO_2
EnumPrinters %PRINTER_ENUM_CONNECTIONS OR %PRINTER_ENUM_LOCAL OR %PRINTER_ENUM_NETWORK, _
BYVAL %NULL, Level, BYVAL %NULL, 0, needed&, returned&
REDIM PI2(Needed& \ SIZEOF(PI2(0)) + 1)
EnumPrinters %PRINTER_ENUM_CONNECTIONS OR %PRINTER_ENUM_LOCAL OR %PRINTER_ENUM_NETWORK, _
"", Level, BYVAL VARPTR(PI2(0)), SIZEOF(PI2(0)) * (UBOUND(PI2(1)) + 1), _
needed&, returned&
REDIM printers$(Returned&-1)
REDIM portname$(Returned&-1)
REDIM devname$(Returned&-1)
FOR Element = 0 TO Returned& - 1
EntireString = EntireString + PI2(Element,0).@pPrinterName _ 'printer name
+ "," _ 'comma
+ PI2(Element,1).@pPortName _ 'port name
+ ","

printers$(Element)=PI2(Element).@pPrinterName
portname$(Element)=PI2(Element).@pPortName
devname$(Element)=PI2(Element).@pDriverName
NEXT

Hope that helps.
 
Thanks for the tip, It will help me with my problem.

-Joe
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top