Skip to content

godoes/printers

 
 

Repository files navigation

🖨 Windows printing

Call Windows operating system printer in Golang.

✨ Features

See http://godoc.org/github.com/godoes/printers for details.

🔰 Installation

go get -d github.com/godoes/printers

📝 Usage

package main

import (
    "log"

    "github.com/godoes/printers"
)

func main() {
    name, err := printers.GetDefault()
    if err != nil {
        log.Fatalln("GetDefault error:", err)
    }

    printer, err := printers.Open(name)
    if err != nil {
        log.Fatalln("Open error:", err)
    }
    defer func() {
        _ = printer.Close()
    }()

    jobs, err := printer.Jobs()
    if err != nil {
        log.Fatalln("Jobs error:", err)
    }
    log.Println("jobs:", jobs)
}

Forked from alexbrainman/printer.

📃 LICENSE

BSD-3-Clause

Packages

No packages published

Languages

  • Go 97.3%
  • Batchfile 2.7%