printer

package module
v0.0.0-...-9482ef3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 26, 2022 License: MIT Imports: 4 Imported by: 0

README

winspool-go

call winspool by golang

Documentation

Index

Constants

View Source
const (
	CCHDEVICENAME = 32
	CCHFORMNAME   = 32

	DM_SPECVERSION uint16 = 0x0401
	DM_COPY        uint32 = 2
	DM_MODIFY      uint32 = 8

	DM_ORIENTATION        = 0x00000001
	DM_PAPERSIZE          = 0x00000002
	DM_PAPERLENGTH        = 0x00000004
	DM_PAPERWIDTH         = 0x00000008
	DM_SCALE              = 0x00000010
	DM_POSITION           = 0x00000020
	DM_NUP                = 0x00000040
	DM_DISPLAYORIENTATION = 0x00000080
	DM_COPIES             = 0x00000100
	DM_DEFAULTSOURCE      = 0x00000200
	DM_PRINTQUALITY       = 0x00000400
	DM_COLOR              = 0x00000800
	DM_DUPLEX             = 0x00001000
	DM_YRESOLUTION        = 0x00002000
	DM_TTOPTION           = 0x00004000
	DM_COLLATE            = 0x00008000
	DM_FORMNAME           = 0x00010000
	DM_LOGPIXELS          = 0x00020000
	DM_BITSPERPEL         = 0x00040000
	DM_PELSWIDTH          = 0x00080000
	DM_PELSHEIGHT         = 0x00100000
	DM_DISPLAYFLAGS       = 0x00200000
	DM_DISPLAYFREQUENCY   = 0x00400000
	DM_ICMMETHOD          = 0x00800000
	DM_ICMINTENT          = 0x01000000
	DM_MEDIATYPE          = 0x02000000
	DM_DITHERTYPE         = 0x04000000
	DM_PANNINGWIDTH       = 0x08000000
	DM_PANNINGHEIGHT      = 0x10000000
	DM_DISPLAYFIXEDOUTPUT = 0x20000000

	DMORIENT_PORTRAIT  int16 = 1
	DMORIENT_LANDSCAPE int16 = 2

	DMCOLOR_MONOCHROME int16 = 1
	DMCOLOR_COLOR      int16 = 2

	DMDUP_SIMPLEX    int16 = 1
	DMDUP_VERTICAL   int16 = 2
	DMDUP_HORIZONTAL int16 = 3

	DMCOLLATE_FALSE int16 = 0
	DMCOLLATE_TRUE  int16 = 1

	DMNUP_SYSTEM uint32 = 1
	DMNUP_ONEUP  uint32 = 2
)

DEVMODE constants.

View Source
const (
	JOB_STATUS_PAUSED            uint32 = 0x00000001
	JOB_STATUS_ERROR             uint32 = 0x00000002
	JOB_STATUS_DELETING          uint32 = 0x00000004
	JOB_STATUS_SPOOLING          uint32 = 0x00000008
	JOB_STATUS_PRINTING          uint32 = 0x00000010
	JOB_STATUS_OFFLINE           uint32 = 0x00000020
	JOB_STATUS_PAPEROUT          uint32 = 0x00000040
	JOB_STATUS_PRINTED           uint32 = 0x00000080
	JOB_STATUS_DELETED           uint32 = 0x00000100
	JOB_STATUS_BLOCKED_DEVQ      uint32 = 0x00000200
	JOB_STATUS_USER_INTERVENTION uint32 = 0x00000400
	JOB_STATUS_RESTART           uint32 = 0x00000800
	JOB_STATUS_COMPLETE          uint32 = 0x00001000
	JOB_STATUS_RETAINED          uint32 = 0x00002000
	JOB_STATUS_RENDERING_LOCALLY uint32 = 0x00004000
)

JOB_INFO_1 status values.

View Source
const (
	JOB_CONTROL_PAUSE             uint32 = 1
	JOB_CONTROL_RESUME            uint32 = 2
	JOB_CONTROL_CANCEL            uint32 = 3
	JOB_CONTROL_RESTART           uint32 = 4
	JOB_CONTROL_DELETE            uint32 = 5
	JOB_CONTROL_SENT_TO_PRINTER   uint32 = 6
	JOB_CONTROL_LAST_PAGE_EJECTED uint32 = 7
	JOB_CONTROL_RETAIN            uint32 = 8
	JOB_CONTROL_RELEASE           uint32 = 9
)

SetJob command values.

View Source
const (
	PRINTER_ATTRIBUTE_QUEUED            uint32 = 0x00000001
	PRINTER_ATTRIBUTE_DIRECT            uint32 = 0x00000002
	PRINTER_ATTRIBUTE_DEFAULT           uint32 = 0x00000004
	PRINTER_ATTRIBUTE_SHARED            uint32 = 0x00000008
	PRINTER_ATTRIBUTE_NETWORK           uint32 = 0x00000010
	PRINTER_ATTRIBUTE_HIDDEN            uint32 = 0x00000020
	PRINTER_ATTRIBUTE_LOCAL             uint32 = 0x00000040
	PRINTER_ATTRIBUTE_ENABLE_DEVQ       uint32 = 0x00000080
	PRINTER_ATTRIBUTE_KEEPPRINTEDJOBS   uint32 = 0x00000100
	PRINTER_ATTRIBUTE_DO_COMPLETE_FIRST uint32 = 0x00000200
	PRINTER_ATTRIBUTE_WORK_OFFLINE      uint32 = 0x00000400
	PRINTER_ATTRIBUTE_ENABLE_BIDI       uint32 = 0x00000800
	PRINTER_ATTRIBUTE_RAW_ONLY          uint32 = 0x00001000
	PRINTER_ATTRIBUTE_PUBLISHED         uint32 = 0x00002000
)

PRINTER_INFO_2 attribute values

View Source
const (
	PRINTER_STATUS_PAUSED               uint32 = 0x00000001
	PRINTER_STATUS_ERROR                uint32 = 0x00000002
	PRINTER_STATUS_PENDING_DELETION     uint32 = 0x00000004
	PRINTER_STATUS_PAPER_JAM            uint32 = 0x00000008
	PRINTER_STATUS_PAPER_OUT            uint32 = 0x00000010
	PRINTER_STATUS_MANUAL_FEED          uint32 = 0x00000020
	PRINTER_STATUS_PAPER_PROBLEM        uint32 = 0x00000040
	PRINTER_STATUS_OFFLINE              uint32 = 0x00000080
	PRINTER_STATUS_IO_ACTIVE            uint32 = 0x00000100
	PRINTER_STATUS_BUSY                 uint32 = 0x00000200
	PRINTER_STATUS_PRINTING             uint32 = 0x00000400
	PRINTER_STATUS_OUTPUT_BIN_FULL      uint32 = 0x00000800
	PRINTER_STATUS_NOT_AVAILABLE        uint32 = 0x00001000
	PRINTER_STATUS_WAITING              uint32 = 0x00002000
	PRINTER_STATUS_PROCESSING           uint32 = 0x00004000
	PRINTER_STATUS_INITIALIZING         uint32 = 0x00008000
	PRINTER_STATUS_WARMING_UP           uint32 = 0x00010000
	PRINTER_STATUS_TONER_LOW            uint32 = 0x00020000
	PRINTER_STATUS_NO_TONER             uint32 = 0x00040000
	PRINTER_STATUS_PAGE_PUNT            uint32 = 0x00080000
	PRINTER_STATUS_USER_INTERVENTION    uint32 = 0x00100000
	PRINTER_STATUS_OUT_OF_MEMORY        uint32 = 0x00200000
	PRINTER_STATUS_DOOR_OPEN            uint32 = 0x00400000
	PRINTER_STATUS_SERVER_UNKNOWN       uint32 = 0x00800000
	PRINTER_STATUS_POWER_SAVE           uint32 = 0x01000000
	PRINTER_STATUS_SERVER_OFFLINE       uint32 = 0x02000000
	PRINTER_STATUS_DRIVER_UPDATE_NEEDED uint32 = 0x04000000
)

PRINTER_INFO_2 status values.

Variables

This section is empty.

Functions

This section is empty.

Types

type DOC_INFO_1

type DOC_INFO_1 struct {
	DocName    *uint16
	OutputFile *uint16
	Datatype   *uint16
}

func (*DOC_INFO_1) GetDatatype

func (p *DOC_INFO_1) GetDatatype() string

func (*DOC_INFO_1) GetDoc

func (p *DOC_INFO_1) GetDoc() Doc

func (*DOC_INFO_1) GetDocName

func (p *DOC_INFO_1) GetDocName() string

func (*DOC_INFO_1) GetOutputFile

func (p *DOC_INFO_1) GetOutputFile() string

type DRIVER_INFO_8

type DRIVER_INFO_8 struct {
	Version                  uint32
	Name                     *uint16
	Environment              *uint16
	DriverPath               *uint16
	DataFile                 *uint16
	ConfigFile               *uint16
	HelpFile                 *uint16
	DependentFiles           *uint16
	MonitorName              *uint16
	DefaultDataType          *uint16
	PreviousNames            *uint16
	DriverDate               syscall.Filetime
	DriverVersion            uint64
	MfgName                  *uint16
	OEMUrl                   *uint16
	HardwareID               *uint16
	Provider                 *uint16
	PrintProcessor           *uint16
	VendorSetup              *uint16
	ColorProfiles            *uint16
	InfPath                  *uint16
	PrinterDriverAttributes  uint32
	CoreDriverDependencies   *uint16
	MinInboxDriverVerDate    syscall.Filetime
	MinInboxDriverVerVersion uint32
}

func (*DRIVER_INFO_8) GetColorProfiles

func (p *DRIVER_INFO_8) GetColorProfiles() string

func (*DRIVER_INFO_8) GetConfigFile

func (p *DRIVER_INFO_8) GetConfigFile() string

func (*DRIVER_INFO_8) GetCoreDriverDependencies

func (p *DRIVER_INFO_8) GetCoreDriverDependencies() string

func (*DRIVER_INFO_8) GetDataFile

func (p *DRIVER_INFO_8) GetDataFile() string

func (*DRIVER_INFO_8) GetDefaultDataType

func (p *DRIVER_INFO_8) GetDefaultDataType() string

func (*DRIVER_INFO_8) GetDependentFiles

func (p *DRIVER_INFO_8) GetDependentFiles() string

func (*DRIVER_INFO_8) GetDriver

func (p *DRIVER_INFO_8) GetDriver() Driver

func (*DRIVER_INFO_8) GetDriverPath

func (p *DRIVER_INFO_8) GetDriverPath() string

func (*DRIVER_INFO_8) GetEnvironment

func (p *DRIVER_INFO_8) GetEnvironment() string

func (*DRIVER_INFO_8) GetHardwareID

func (p *DRIVER_INFO_8) GetHardwareID() string

func (*DRIVER_INFO_8) GetHelpFile

func (p *DRIVER_INFO_8) GetHelpFile() string

func (*DRIVER_INFO_8) GetInfPath

func (p *DRIVER_INFO_8) GetInfPath() string

func (*DRIVER_INFO_8) GetMfgName

func (p *DRIVER_INFO_8) GetMfgName() string

func (*DRIVER_INFO_8) GetMonitorName

func (p *DRIVER_INFO_8) GetMonitorName() string

func (*DRIVER_INFO_8) GetName

func (p *DRIVER_INFO_8) GetName() string

func (*DRIVER_INFO_8) GetOEMUrl

func (p *DRIVER_INFO_8) GetOEMUrl() string

func (*DRIVER_INFO_8) GetPreviousNames

func (p *DRIVER_INFO_8) GetPreviousNames() string

func (*DRIVER_INFO_8) GetPrintProcessor

func (p *DRIVER_INFO_8) GetPrintProcessor() string

func (*DRIVER_INFO_8) GetProvider

func (p *DRIVER_INFO_8) GetProvider() string

func (*DRIVER_INFO_8) GetVendorSetup

func (p *DRIVER_INFO_8) GetVendorSetup() string

type DevMode

type DevMode struct {
	// contains filtered or unexported fields
}

DEVMODE struct.

func (*DevMode) ClearPaperLength

func (dm *DevMode) ClearPaperLength()

func (*DevMode) ClearPaperSize

func (dm *DevMode) ClearPaperSize()

func (*DevMode) ClearPaperWidth

func (dm *DevMode) ClearPaperWidth()

func (*DevMode) GetCollate

func (dm *DevMode) GetCollate() (int16, bool)

func (*DevMode) GetColor

func (dm *DevMode) GetColor() (int16, bool)

func (*DevMode) GetCopies

func (dm *DevMode) GetCopies() (int16, bool)

func (*DevMode) GetDeviceName

func (dm *DevMode) GetDeviceName() string

func (*DevMode) GetDuplex

func (dm *DevMode) GetDuplex() (int16, bool)

func (*DevMode) GetOrientation

func (dm *DevMode) GetOrientation() (int16, bool)

func (*DevMode) GetPaperLength

func (dm *DevMode) GetPaperLength() (int16, bool)

func (*DevMode) GetPaperSize

func (dm *DevMode) GetPaperSize() (int16, bool)

func (*DevMode) GetPaperWidth

func (dm *DevMode) GetPaperWidth() (int16, bool)

func (*DevMode) SetCollate

func (dm *DevMode) SetCollate(collate int16)

func (*DevMode) SetColor

func (dm *DevMode) SetColor(color int16)

func (*DevMode) SetCopies

func (dm *DevMode) SetCopies(copies int16)

func (*DevMode) SetDuplex

func (dm *DevMode) SetDuplex(duplex int16)

func (*DevMode) SetOrientation

func (dm *DevMode) SetOrientation(orientation int16)

func (*DevMode) SetPaperLength

func (dm *DevMode) SetPaperLength(length int16)

func (*DevMode) SetPaperSize

func (dm *DevMode) SetPaperSize(paperSize int16)

func (*DevMode) SetPaperWidth

func (dm *DevMode) SetPaperWidth(width int16)

func (*DevMode) String

func (dm *DevMode) String() string

type Doc

type Doc struct {
	Datatype   string
	DocName    string
	OutputFile string
}

type Driver

type Driver struct {
	HelpFile                 string
	DefaultDataType          string
	CoreDriverDependencies   string
	Version                  uint32
	HardwareID               string
	Environment              string
	MonitorName              string
	OEMUrl                   string
	VendorSetup              string
	ColorProfiles            string
	InfPath                  string
	DriverPath               string
	DependentFiles           string
	DataFile                 string
	Name                     string
	PrinterDriverAttributes  uint32
	MfgName                  string
	MinInboxDriverVerVersion uint32
	Provider                 string
	PrintProcessor           string
	ConfigFile               string
	PreviousNames            string
}

type JOB_INFO_1

type JOB_INFO_1 struct {
	JobID uint32

	Status       uint32
	Priority     uint32
	Position     uint32
	TotalPages   uint32
	PagesPrinted uint32
	Submitted    syscall.Systemtime
	// contains filtered or unexported fields
}

JOB_INFO_1

typedef struct _JOB_INFO_1 {
 DWORD      JobId;
 LPTSTR     pPrinterName;
 LPTSTR     pMachineName;
 LPTSTR     pUserName;
 LPTSTR     pDocument;
 LPTSTR     pDatatype;
 LPTSTR     pStatus;
 DWORD      Status;
 DWORD      Priority;
 DWORD      Position;
 DWORD      TotalPages;
 DWORD      PagesPrinted;
 SYSTEMTIME Submitted;
} JOB_INFO_1, *PJOB_INFO_1;

func (*JOB_INFO_1) GetDatatype

func (p *JOB_INFO_1) GetDatatype() string

func (*JOB_INFO_1) GetDocument

func (p *JOB_INFO_1) GetDocument() string

func (*JOB_INFO_1) GetJob

func (p *JOB_INFO_1) GetJob() Job

func (*JOB_INFO_1) GetMachineName

func (p *JOB_INFO_1) GetMachineName() string

func (*JOB_INFO_1) GetPrinterName

func (p *JOB_INFO_1) GetPrinterName() string

func (*JOB_INFO_1) GetSubmitted

func (p *JOB_INFO_1) GetSubmitted() time.Time

func (*JOB_INFO_1) GetUserName

func (p *JOB_INFO_1) GetUserName() string

type JOB_INFO_2

type JOB_INFO_2 struct {
	JobID uint32

	Status       uint32
	Position     uint32
	Priority     uint32
	StartTime    uint32
	UntilTime    uint32
	Size         uint32
	Submitted    syscall.Systemtime
	Time         uint32
	PagesPrinted uint32
	// contains filtered or unexported fields
}

JOB_INFO_2

typedef struct _JOB_INFO_2 {
 DWORD                JobId;
 LPTSTR               pPrinterName;
 LPTSTR               pMachineName;
 LPTSTR               pUserName;
 LPTSTR               pDocument;
 LPTSTR               pNotifyName;
 LPTSTR               pDatatype;
 LPTSTR               pPrintProcessor;
 LPTSTR               pParameters;
 LPTSTR               pDriverName;
 LPDEVMODE            pDevMode;
 LPTSTR               pStatus;
 PSECURITY_DESCRIPTOR pSecurityDescriptor;
 DWORD                Status;
 DWORD                Priority;
 DWORD                Position;
 DWORD                StartTime;
 DWORD                UntilTime;
 DWORD                TotalPages;
 DWORD                Size;
 SYSTEMTIME           Submitted;
 DWORD                Time;
 DWORD                PagesPrinted;
} JOB_INFO_2, *PJOB_INFO_2;

func (*JOB_INFO_2) GetDatatype

func (p *JOB_INFO_2) GetDatatype() string

func (*JOB_INFO_2) GetDocument

func (p *JOB_INFO_2) GetDocument() string

func (*JOB_INFO_2) GetDriverName

func (p *JOB_INFO_2) GetDriverName() string

func (*JOB_INFO_2) GetJob

func (p *JOB_INFO_2) GetJob() Job

func (*JOB_INFO_2) GetMachineName

func (p *JOB_INFO_2) GetMachineName() string

func (*JOB_INFO_2) GetNotifyName

func (p *JOB_INFO_2) GetNotifyName() string

func (*JOB_INFO_2) GetParameters

func (p *JOB_INFO_2) GetParameters() string

func (*JOB_INFO_2) GetPrintProcessor

func (p *JOB_INFO_2) GetPrintProcessor() string

func (*JOB_INFO_2) GetPrinterName

func (p *JOB_INFO_2) GetPrinterName() string

func (*JOB_INFO_2) GetSubmitted

func (p *JOB_INFO_2) GetSubmitted() time.Time

func (*JOB_INFO_2) GetUserName

func (p *JOB_INFO_2) GetUserName() string

type JOB_INFO_3

type JOB_INFO_3 struct {
	JobID     uint32
	NextJobId uint32
	Reserved  uint32
}

JOB_INFO_3

typedef struct _JOB_INFO_3 {
 DWORD JobId;
 DWORD NextJobId;
 DWORD Reserved;
} JOB_INFO_3, *PJOB_INFO_3;

func (*JOB_INFO_3) GetJob

func (p *JOB_INFO_3) GetJob() Job

type Job

type Job struct {
	Status             uint32
	Priority           uint32
	UntilTime          uint32
	Reserved           uint32
	Size               uint32
	NextJobId          uint32
	PrinterName        string
	Parameters         string
	DriverName         string
	NotifyName         string
	StartTime          uint32
	Document           string
	SecurityDescriptor uint32
	PrintProcessor     string
	Datatype           string
	PagesPrinted       uint32
	Submitted          time.Time
	JobID              uint32
	MachineName        string
	Time               uint32
	TotalPages         uint32
	UserName           string
	Position           uint32
}

func (*Job) GetChinesStatus

func (p *Job) GetChinesStatus() string

func (*Job) GetStatus

func (p *Job) GetStatus() string

type PRINTER_INFO_2

type PRINTER_INFO_2 struct {
	// contains filtered or unexported fields
}

PRINTER_INFO_2 struct. sys_struct: PRINTER

func (*PRINTER_INFO_2) GetComment

func (p *PRINTER_INFO_2) GetComment() string

func (*PRINTER_INFO_2) GetDatatype

func (p *PRINTER_INFO_2) GetDatatype() string

func (*PRINTER_INFO_2) GetDriverName

func (p *PRINTER_INFO_2) GetDriverName() string

func (*PRINTER_INFO_2) GetLocation

func (p *PRINTER_INFO_2) GetLocation() string

func (*PRINTER_INFO_2) GetParameters

func (p *PRINTER_INFO_2) GetParameters() string

func (*PRINTER_INFO_2) GetPortName

func (p *PRINTER_INFO_2) GetPortName() string

func (*PRINTER_INFO_2) GetPrintProcessor

func (p *PRINTER_INFO_2) GetPrintProcessor() string

func (*PRINTER_INFO_2) GetPrinter

func (p *PRINTER_INFO_2) GetPrinter() Printer

func (*PRINTER_INFO_2) GetPrinterName

func (p *PRINTER_INFO_2) GetPrinterName() string

func (*PRINTER_INFO_2) GetSepFile

func (p *PRINTER_INFO_2) GetSepFile() string

func (*PRINTER_INFO_2) GetServerName

func (p *PRINTER_INFO_2) GetServerName() string

func (*PRINTER_INFO_2) GetShareName

func (p *PRINTER_INFO_2) GetShareName() string

type PRINTER_INFO_5

type PRINTER_INFO_5 struct {
	// contains filtered or unexported fields
}

func (*PRINTER_INFO_5) GetPortName

func (p *PRINTER_INFO_5) GetPortName() string

func (*PRINTER_INFO_5) GetPrinter

func (p *PRINTER_INFO_5) GetPrinter() Printer

func (*PRINTER_INFO_5) GetPrinterName

func (p *PRINTER_INFO_5) GetPrinterName() string

type Printer

type Printer struct {
	SepFile                  string
	PrinterName              string
	Datatype                 string
	ShareName                string
	DriverName               string
	UntilTime                uint32
	DefaultPriority          uint32
	StartTime                uint32
	TransmissionRetryTimeout uint32
	DeviceNotSelectedTimeout uint32
	PortName                 string
	Comment                  string
	PrintProcessor           string
	CJobs                    uint32
	AveragePPM               uint32
	Location                 string
	Parameters               string
	Priority                 uint32
	Attributes               uint32
	ServerName               string
	Status                   uint32
}

func (*Printer) GetAttributes

func (p *Printer) GetAttributes() map[string]bool

func (*Printer) GetPrinterStatus

func (p *Printer) GetPrinterStatus() PrinterStatusType

func (*Printer) GetStatus

func (p *Printer) GetStatus() map[string]bool

type PrinterStatusType

type PrinterStatusType string
const (
	PrinterStatusIdle       PrinterStatusType = "IDLE"
	PrinterStatusProcessing PrinterStatusType = "PROCESSING"
	PrinterStatusStopped    PrinterStatusType = "STOPPED"
)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL