Printer Properties

Printer properties are used to control printer settings used by the method SendPrint.

Printer properties are set and queried using the SIS_OT_PRINTER constant and the GetFlt/GetInt/GetStr/GetProperty and SetFlt/SetInt/SetStr/SetProperty methods. The nObject& argument is not required with SIS_OT_PRINTER, and should be set to 0.

Note: When the printer properties are being used then all of them must be set, because all of them are used every time the SendPrint method is called.

Printer Properties


Printer Properties

Example of an API command for another paper size:

''Compose the current map for printing
        Dim uPrinterSettings As New PrintDialog

        uPrinterSettings.AllowSelection = False
        uPrinterSettings.AllowSomePages = False
        uPrinterSettings.AllowPrintToFile = False

        If uPrinterSettings.ShowDialog() = DialogResult.OK Then
            Sis1.SetStr(SIS_OT_PRINTER, 0, "_device$", uPrinterSettings.PrinterSettings.PrinterName)
            Sis1.SetStr(SIS_OT_PRINTER, 0, "_driver$", "winspool")
            Sis1.SetStr(SIS_OT_PRINTER, 0, "_output$", "")
            Sis1.SetInt(SIS_OT_PRINTER, 0, "_copies&", uPrinterSettings.PrinterSettings.Copies)
            Sis1.SetInt(SIS_OT_PRINTER, 0, "_paperSize&", uPrinterSettings.PrinterSettings.DefaultPageSettings.PaperSize.RawKind)

            If uPrinterSettings.PrinterSettings.DefaultPageSettings.Landscape = False Then
                Sis1.SetInt(SIS_OT_PRINTER, 0, "_orientation&", 1)
            Else
                Sis1.SetInt(SIS_OT_PRINTER, 0, "_orientation&", 2)
            End If
        
        Sis1.DoCommand("AComPrintTemplateWizard")
 

       End If


Send comments on this topic.

Click to return to www.cadcorp.com

© Copyright 2000-2017 Computer Aided Development Corporation Limited (Cadcorp).