waitingsong / node-win32-api

win32 api
MIT License
413 stars 53 forks source link

import_winspool.apiDef.WritePrinter is not a function #82

Open huangguowei449 opened 7 months ago

huangguowei449 commented 7 months ago

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 commented 3 weeks ago

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()