Skip to content
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

import_winspool.apiDef.WritePrinter is not a function #82

Open
huangguowei449 opened this issue Dec 9, 2023 · 1 comment
Open

import_winspool.apiDef.WritePrinter is not a function #82

huangguowei449 opened this issue Dec 9, 2023 · 1 comment

Comments

@huangguowei449
Copy link

import {
winspoolGetDefaultPrinter,
winspoolOpenPrinter,
} from "win32-api/fun";

import { apiDef } from "win32-api/winspool";

I obtained the printer and handle through WinspoolGetDefPrinter and WinspoolOpenPrinter, but when calling apiDef WritePrinter doesn't get a function, can you tell me why

@waitingsong
Copy link
Owner

waitingsong commented Jun 28, 2024

Since v22, new style:

import { GetDefaultPrinter, OpenPrinter } from "win32-api/util"
import { Winspool } from 'win32-api'

const lib = Winspool.load()
lib.WritePrinter()
// or
await lib.WritePrinter_Async()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants