Open abdul-creator opened 1 year ago
my code for above task so far:
`func main() { // create a new ipp client client := ipp.NewIPPClient("server", 631, "user", "password", true)
err := client.TestConnection()
if err != nil {
fmt.Printf("%v", err)
} else {
Get all printers on above server ????
looping through all the printers
var res []string
printer, _ := client.GetPrinterAttributes("1st printer in loop", res)
for _, atr := range printer {
for _, nameAtr := range atr {
if nameAtr.Name == "printer-state-reasons" {
if xx.Value == "paused" {
client.ResumePrinter(printer)
}
}
}
}
}
}`
// currently I am using chromedp to get all the printers.
func GetPausedPrinter(url string) { ctx, cancel := chromedp.NewContext(context.Background()) defer cancel() ctx, cancel = context.WithTimeout(ctx, 25*time.Second) defer cancel() chromedp.Run(ctx, chromedp.Navigate(url), chromedp.Nodes("/html/body/table/tbody/tr[1]/td/table[2]/tbody/tr/td/a", &HrefNode)) }
Hello, I am trying to