codesoft

package module
v0.0.0-...-1223072 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2017 License: MIT Imports: 6 Imported by: 0

README

go-codesoft

利用go来调用codesoft actveX控件打印标签

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppWorkStation

func AppWorkStation(msg chan Label, max time.Duration)

AppWorkStation is for mult-gorounting, when you using the mult-goroutings, you need care about the max number of the workstation can't exceed the max num. of cpu core this function is limited by ole working principle. if out of the cores, it will cause ole object can't been close properly.

Types

type Application

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

Application is for application env.

func (Application) Close

func (app Application) Close()

Close app self

func (Application) Print

func (app Application) Print(l Label) (e error)

Print is function for print a label.

type Document

type Document struct {
	Variables
	Printer
	// contains filtered or unexported fields
}

Document is a label template

func (Document) Close

func (doc Document) Close()

Close and release resources

type Documents

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

Documents is an collection object for all label document

func (Documents) Close

func (docs Documents) Close()

Close all the documents in the documents objects, in ole, documents is a collection object, in this package implment as map to keep those open document.

func (*Documents) Open

func (docs *Documents) Open(lab string) (doc Document, e error)

Open a label in `lab` path, and return a Document object

type FreeVariables

type FreeVariables struct {
	Items map[string]Item
	// contains filtered or unexported fields
}

FreeVariables is only using in label for now

type Item

type Item struct {
	Name  string
	Value string
	// contains filtered or unexported fields
}

Item in variables

func (*Item) Set

func (itm *Item) Set(val string)

Set is using to setting item's value

func (*Item) Val

func (itm *Item) Val() string

Val is a function to read item's value

type Label

type Label struct {
	Id       string
	Template string
	Printer  string
	Data     map[string]string
	Quantity int
}

Label is a struct for recv label information template is label abs-path, printer is printer name, cause printer name never dupplicate in one computer/server, so using printer name for the output device, quantity is for the label copy num.

type Printer

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

Printer implement from ole

func (*Printer) Close

func (p *Printer) Close()

Close self

func (*Printer) MarginLeft

func (p *Printer) MarginLeft() (r string)

MarginLeft read printer parameter: marginleft

func (*Printer) MarginTop

func (p *Printer) MarginTop() (r string)

MarginTop read printer parameter: margintop

func (*Printer) SetMarginLeft

func (p *Printer) SetMarginLeft(v string)

SetMarginLeft set printer parameter: marginleft

func (*Printer) SetMarginTop

func (p *Printer) SetMarginTop(v string)

SetMarginTop set printer parameter: margintop

func (*Printer) SwitchTo

func (p *Printer) SwitchTo(prt string) (e error)

SwitchTo printer with printer name

type Variables

type Variables struct {
	FreeVariables
	// contains filtered or unexported fields
}

Variables including in the label. it contains several parts, form variables, free variables and so on, please check activex document to find details. here just implement the free variables.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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