Documentation ¶
Overview ¶
Windows printing.
Index ¶
- Constants
- func ClosePrinter(h syscall.Handle) (err error)
- func Default() (string, error)
- func EndDocPrinter(h syscall.Handle) (err error)
- func EndPagePrinter(h syscall.Handle) (err error)
- func EnumJobs(h syscall.Handle, firstJob uint32, noJobs uint32, level uint32, buf *byte, ...) (err error)
- func EnumPrinters(flags uint32, name *uint16, level uint32, buf *byte, bufN uint32, ...) (err error)
- func GetDefaultPrinter(buf *uint16, bufN *uint32) (err error)
- func GetPrinterDriver(h syscall.Handle, env *uint16, level uint32, di *byte, n uint32, ...) (err error)
- func OpenPrinter(name *uint16, h *syscall.Handle, defaults uintptr) (err error)
- func ReadNames() ([]string, error)
- func StartDocPrinter(h syscall.Handle, level uint32, docinfo *DOC_INFO_1) (err error)
- func StartPagePrinter(h syscall.Handle) (err error)
- func WritePrinter(h syscall.Handle, buf *byte, bufN uint32, written *uint32) (err error)
- type DOC_INFO_1
- type DRIVER_INFO_8
- type DriverInfo
- type JOB_INFO_1
- type JobInfo
- type PRINTER_INFO_5
- type Printer
- func (p *Printer) Barcode(barcode string, format int)
- func (p *Printer) Cash()
- func (p *Printer) Close() error
- func (p *Printer) Cut()
- func (p *Printer) CutPartial()
- func (p *Printer) DriverInfo() (*DriverInfo, error)
- func (p *Printer) End()
- func (p *Printer) EndDocument() error
- func (p *Printer) EndPage() error
- func (p *Printer) Feed(params map[string]string)
- func (p *Printer) FeedAndCut(params map[string]string)
- func (p *Printer) Formfeed()
- func (p *Printer) FormfeedN(n int)
- func (p *Printer) Image(params map[string]string, data string)
- func (p *Printer) Init()
- func (p *Printer) Jobs() ([]JobInfo, error)
- func (p *Printer) Linefeed()
- func (p *Printer) Pulse()
- func (p *Printer) SendEmphasize()
- func (p *Printer) SendFontSize()
- func (p *Printer) SendMoveX(x uint16)
- func (p *Printer) SendMoveY(y uint16)
- func (p *Printer) SendReverse()
- func (p *Printer) SendRotate()
- func (p *Printer) SendSmooth()
- func (p *Printer) SendUnderline()
- func (p *Printer) SendUpsidedown()
- func (p *Printer) SetAlign(align string)
- func (p *Printer) SetEmphasize(u uint8)
- func (p *Printer) SetFont(font string)
- func (p *Printer) SetFontSize(width, height uint8)
- func (p *Printer) SetLang(lang string)
- func (p *Printer) SetReverse(v uint8)
- func (p *Printer) SetRotate(v uint8)
- func (p *Printer) SetSmooth(v uint8)
- func (p *Printer) SetUnderline(v uint8)
- func (p *Printer) SetUpsidedown(v uint8)
- func (p *Printer) StartDocument(name, datatype string) error
- func (p *Printer) StartPage() error
- func (p *Printer) StartRawDocument(name string) error
- func (p *Printer) Text(params map[string]string, data string)
- func (p *Printer) Write(b []byte) (int, error)
- func (p *Printer) WriteNode(name string, params map[string]string, data string)
- func (p *Printer) WriteString(data string) (int, error)
Constants ¶
View Source
const ( PRINTER_ENUM_LOCAL = 2 PRINTER_ENUM_CONNECTIONS = 4 PRINTER_DRIVER_XPS = 0x00000002 )
View Source
const ( JOB_STATUS_PAUSED = 0x00000001 // Job is paused JOB_STATUS_ERROR = 0x00000002 // An error is associated with the job JOB_STATUS_DELETING = 0x00000004 // Job is being deleted JOB_STATUS_SPOOLING = 0x00000008 // Job is spooling JOB_STATUS_PRINTING = 0x00000010 // Job is printing JOB_STATUS_OFFLINE = 0x00000020 // Printer is offline JOB_STATUS_PAPEROUT = 0x00000040 // Printer is out of paper JOB_STATUS_PRINTED = 0x00000080 // Job has printed JOB_STATUS_DELETED = 0x00000100 // Job has been deleted JOB_STATUS_BLOCKED_DEVQ = 0x00000200 // Printer driver cannot print the job JOB_STATUS_USER_INTERVENTION = 0x00000400 // User action required JOB_STATUS_RESTART = 0x00000800 // Job has been restarted JOB_STATUS_COMPLETE = 0x00001000 // Job has been delivered to the printer JOB_STATUS_RETAINED = 0x00002000 // Job has been retained in the print queue JOB_STATUS_RENDERING_LOCALLY = 0x00004000 // Job rendering locally on the client QRCodeErrorCorrectionLevelL uint8 = 48 QRCodeErrorCorrectionLevelM uint8 = 49 QRCodeErrorCorrectionLevelQ uint8 = 50 QRCodeErrorCorrectionLevelH uint8 = 51 )
View Source
const ( // ASCII DLE (DataLinkEscape) DLE byte = 0x10 // ASCII EOT (EndOfTransmission) EOT byte = 0x04 // ASCII GS (Group Separator) GS byte = 0x1D )
Variables ¶
This section is empty.
Functions ¶
func ClosePrinter ¶
func EndDocPrinter ¶
func EndPagePrinter ¶
func EnumPrinters ¶
func GetDefaultPrinter ¶
func GetPrinterDriver ¶
func StartDocPrinter ¶
func StartDocPrinter(h syscall.Handle, level uint32, docinfo *DOC_INFO_1) (err error)
func StartPagePrinter ¶
Types ¶
type DOC_INFO_1 ¶
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 }
type DriverInfo ¶
DriverInfo stores information about printer driver.
type JOB_INFO_1 ¶
type JobInfo ¶
type JobInfo struct { JobID uint32 UserMachineName string UserName string DocumentName string DataType string Status string StatusCode uint32 Priority uint32 Position uint32 TotalPages uint32 PagesPrinted uint32 Submitted time.Time }
JobInfo stores information about a print job.
type PRINTER_INFO_5 ¶
type Printer ¶
type Printer struct { Debug bool // contains filtered or unexported fields }
func (*Printer) DriverInfo ¶
func (p *Printer) DriverInfo() (*DriverInfo, error)
DriverInfo returns information about printer p driver.
func (*Printer) EndDocument ¶
func (*Printer) FeedAndCut ¶
feed and cut based on parameters
func (*Printer) SendFontSize ¶
func (p *Printer) SendFontSize()
func (*Printer) StartDocument ¶
func (*Printer) StartRawDocument ¶
StartRawDocument calls StartDocument and passes either "RAW" or "XPS_PASS" as a document type, depending if printer driver is XPS-based or not.
Click to show internal directories.
Click to hide internal directories.