Gets information about a given printer.

Syntax

Result = SRP_Get_PrinterInfo(PrinterName)

Returns

A dynamic array structure with lots of printer information.

Parameters

ParameterDescription
OptionDetermines which printers are to be returned.

Remarks

The SRP_Get_PrinterInfo method is an OIPI-free way to get information about a single printer. The PrinterName parameter is the name of a printer as it appears in the computer's printer panel. You can also get the printer name by calling SRP_Get_Printers.

This method returns a single dynamic array that contains a wealth of information. Here is the structure:

Array has the following structure:

PosNameDescription
<1> Printer Information
    <1, 1>Printer NameThe printer's name
    <1, 2>Server NameThe print server name of the printer
    <1, 3>Share NameThe shared name of the printer
    <1, 4>Port NameThe printer port name
    <1, 5>Driver NameThe printer driver name
    <1, 6>DescriptionThe printer description
    <1, 7>LocationThe printer location
    <1, 8>Separator FileThe printer's page separator file
    <1, 9>Print ProcessorThe printer processor for the printer
    <1, 10>ParametersAuxiliary parameters for the printer
<2> Printer Capabilities
    <2, 1>Device NameThe device name of the printer
    <2, 2>Driver VersionThe printer's driver version number
    <2, 3>Spec VersionThe specification version number
    <2, 4> Paper Orientation
        <2, 4, 1>ValueThe numerical value indicating the paper orientation
        <2, 4, 2>DescriptionThe textual description of the paper orientation
    <2, 5> Paper Size
        <2, 5, 1>ValueThe numerical value indicating the paper size
        <2, 5, 2>DescriptionThe textual description of the paper size
    <2, 6>Paper LengthLength of paper in tenths of a millimeter
    <2, 7>Paper WidthWidth of paper in tenths of a millimeter
    <2, 8>ScaleThe factor by which the printed output is to be scaled. Scale is X where X/100 is the scale factor.
    <2, 9>CopiesThe default number of copies
    <2, 10> Default Source
        <2, 10, 1>ValueThe numerical value indicating the paper source
        <2, 10, 2>DescriptionThe textual description of the paper source
    <2, 11> Print Quality
        <2, 11, 1>ValueThe numerical value indicating the print quality
        <2, 11, 2>DescriptionThe textual description of the print quality
    <2, 12> Position
        <2, 12, 1>X PositionThe horizontal position in reference to the primary display device
        <2, 12, 2>Y PositionThe vertical position in reference to the primary display device
    <2, 13> Display Rotation
        <2, 13, 1>ValueThe numerical value indicating the display rotation
        <2, 13, 2>DescriptionThe textual description of the display rotation
    <2, 14> Display Layout
        <2, 14, 1>ValueThe numerical value indicating the display layout
        <2, 14, 2>DescriptionThe textual description of the display layout
    <2, 15> Color Mode
        <2, 15, 1>ValueThe numerical value indicating the color mode
        <2, 15, 2>DescriptionThe textual description of the color mode
    <2, 16> Duplex
        <2, 16, 1>ValueThe numerical value indicating the duplex setting
        <2, 16, 2>DescriptionThe textual description of the duplex setting
    <2, 17>Y ResolutionThe y-resolution in dots per inch
    <2, 18> True Type Font Option
        <2, 18, 1>ValueThe numerical value indicating how true type fonts should be printed
        <2, 18, 2>DescriptionThe textual description of how true type fonts should be printed
    <2, 19>CollateSpecifies whether collation should be used when printing multiple copies.
    <2, 20>Form NameThe name of the form to use.
    <2, 21>Logical PixelsThe number of pixels per logical inch.
    <2, 22>Bits Per PixelThe color resolution, in bits per pixel, of the display device.
    <2, 23>Device Width in PixelsThe width, in pixels, of the visible device surface
    <2, 24>Device Height in PixelsThe height, in pixels, of the visible device surface
    <2, 25> Media Type
        <2, 25, 1>ValueThe numerical value indicating the type of media being printed on.
        <2, 25, 2>DescriptionThe textual description of the type of media being printed on.
    <2, 26> Dither Type
        <2, 26, 1>ValueThe numerical value indicating how dithering is to be done.
        <2, 26, 2>DescriptionThe textual description of how dithering is to be done.

Example

// Determine if the default printer is set to print on Letter size paper
DefaultPrinter = SRP_Get_Printers("Default")
Info = SRP_Get_PrinterInfo(DefaultPrinter)
IsLetter = IndexC(Info<2, 5, 2>, "Letter", 1) GT 0
  • No labels