Documentation ¶
Index ¶
- Constants
- func GetDefaultPrinterName() (string, []uint16)
- func GetPrinterNames() ([]string, error)
- func GoClosePrinter(printerHandle uintptr)
- func GoOpenPrinter(printerName string) (uintptr, error)
- func GoPrint(printerHandle uintptr, path string) error
- func GoPrintFromOpenFile(printerHandle uintptr, docName string, fileContents []byte) error
- func IsvalidDevMode(dev *DevMode, buf uint16) (b bool)
- func OpenPrinter2(name *uint16, h *syscall.Handle, defaults uintptr) (err error)
- func SetDefaultPrinter(printerName string) (b bool)
- type DOC_INFO_1
- type DevMode
- func (dm *DevMode) ClearPaperLength()
- func (dm *DevMode) ClearPaperSize()
- func (dm *DevMode) ClearPaperWidth()
- func (dm *DevMode) GetCollate() (int16, bool)
- func (dm *DevMode) GetColor() (int16, bool)
- func (dm *DevMode) GetCopies() (int16, bool)
- func (dm *DevMode) GetDeviceName() string
- func (dm *DevMode) GetDuplex() (int16, bool)
- func (dm *DevMode) GetOrientation() (int16, bool)
- func (dm *DevMode) GetPaperLength() (int16, bool)
- func (dm *DevMode) GetPaperSize() (int16, bool)
- func (dm *DevMode) GetPaperWidth() (int16, bool)
- func (dm *DevMode) SetCollate(collate int16)
- func (dm *DevMode) SetColor(color int16)
- func (dm *DevMode) SetCopies(copies int16)
- func (dm *DevMode) SetDuplex(duplex int16)
- func (dm *DevMode) SetOrientation(orientation int16)
- func (dm *DevMode) SetPaperLength(length int16)
- func (dm *DevMode) SetPaperSize(paperSize int16)
- func (dm *DevMode) SetPaperWidth(width int16)
- func (dm *DevMode) String() string
- type DocInfo
- type HANDLE
- func (hPrinter *HANDLE) ClosePrinter() error
- func (hPrinter HANDLE) DocumentPropertiesGet(deviceName string) (*DevMode, error)
- func (hPrinter HANDLE) DocumentPropertiesSet(deviceName string, devMode *DevMode) error
- func (hPrinter HANDLE) GetPrinter2() (*PRINTER_INFO_2, error)
- func (hPrinter HANDLE) GetPrinter9() (*DevMode, error)
- func (hPrinter *HANDLE) Print(path string) error
- func (hPrinter HANDLE) SetDuplexPrinter2(printerInfo *PRINTER_INFO_2)
- func (hPrinter HANDLE) SetPrinter(printerInfo *PRINTER_INFO_2) error
- type PRINTER_INFO_2
- type PRINTER_INFO_5
- type PRINTER_INFO_9
Constants ¶
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.
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 )
Variables ¶
This section is empty.
Functions ¶
func GetDefaultPrinterName ¶
func GetPrinterNames ¶
func GoClosePrinter ¶
func GoClosePrinter(printerHandle uintptr)
func GoOpenPrinter ¶
Opens a printer which can then be used to send documents to. Must be closed by user once.
func GoPrintFromOpenFile ¶
func IsvalidDevMode ¶
func OpenPrinter2 ¶
func SetDefaultPrinter ¶
Types ¶
type DOC_INFO_1 ¶
type DOC_INFO_1 struct {
// contains filtered or unexported fields
}
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 (*DevMode) GetDeviceName ¶
func (*DevMode) GetOrientation ¶
func (*DevMode) GetPaperLength ¶
func (*DevMode) GetPaperSize ¶
func (*DevMode) GetPaperWidth ¶
func (*DevMode) SetCollate ¶
func (*DevMode) SetOrientation ¶
func (*DevMode) SetPaperLength ¶
func (*DevMode) SetPaperSize ¶
func (*DevMode) SetPaperWidth ¶
type HANDLE ¶
type HANDLE uintptr
func OpenPrinter ¶
func (*HANDLE) ClosePrinter ¶
func (HANDLE) DocumentPropertiesGet ¶
func (HANDLE) DocumentPropertiesSet ¶
func (HANDLE) GetPrinter2 ¶
func (hPrinter HANDLE) GetPrinter2() (*PRINTER_INFO_2, error)
func (HANDLE) GetPrinter9 ¶
func (HANDLE) SetDuplexPrinter2 ¶
func (hPrinter HANDLE) SetDuplexPrinter2(printerInfo *PRINTER_INFO_2)
func (HANDLE) SetPrinter ¶
func (hPrinter HANDLE) SetPrinter(printerInfo *PRINTER_INFO_2) error
type PRINTER_INFO_2 ¶
type PRINTER_INFO_2 struct {
// contains filtered or unexported fields
}
PRINTER_INFO_2 struct.
func (*PRINTER_INFO_2) GetDataType ¶
func (pi *PRINTER_INFO_2) GetDataType() string
type PRINTER_INFO_5 ¶
type PRINTER_INFO_9 ¶
type PRINTER_INFO_9 struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.