Print server

  • Thread starter Thread starter BB
  • Start date Start date
B

BB

Hi to all !
For list of all papersize forms of default printer I'm using:

Dim i As Integer, cFormName as String
Dim oDoc As New System.Drawing.Printing.PrintDocument()
For i = 0 To oDoc.PrinterSettings.PaperSizes.Count - 1
cFormName = oDoc.PrinterSettings.PaperSizes(i).PaperName
Next

How to list all papersize forms of PRINT SERVER without API-a ??

Thenks !!
 
Hi BB,
How to list all papersize forms of PRINT SERVER without API-a ??

I think WMI would be your best bet here. The Win32_Printer class has a
property called PaperSizesSupported that you can use to read the supported
paper sizes on a given printer:

http://msdn2.microsoft.com/en-us/library/Aa394363.aspx

I don't have a ready-made VB.NET example, but here's an example application
in C#:

http://www.codeproject.com/csharp/prntjobcontrollerusingwmi.asp

This example should be quite easy to translate to VB.NET. Hope this helps!

--
Regards,

Mr. Jani Järvinen
C# MVP
Helsinki, Finland
(e-mail address removed)
http://www.saunalahti.fi/janij/
 
Back
Top