-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pdf文档打印 #22
Comments
I do not know. Alex |
如果没有编程语言限制,可以参考一下这个链接 使用python作为“胶水” (1测试未成功,2测试成功)
|
Just pass the binary data of pdf to the write method, works fine on my printer "Mi All-in-One Laser Printer K200 [0984]". package main
import (
"fmt"
"os"
"strings"
"github.com/alexbrainman/printer"
)
func main() {
printers, _ := printer.ReadNames()
for _, name := range printers {
fmt.Println(name)
if strings.Contains(name, "K200") {
p, _ := printer.Open(name)
p.StartRawDocument("Test")
dat, _ := os.ReadFile("./download.pdf")
p.Write(dat)
p.EndDocument()
p.Close()
}
}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
如何打印pdf文档
The text was updated successfully, but these errors were encountered: