tojocky / node-printer

Native node.js printer
1.53k stars 441 forks source link

Update to work with node 12 api #253

Closed patrickrobbins closed 3 years ago

patrickrobbins commented 5 years ago

Node 12 removes access to handle class and replaces with local

tojocky commented 5 years ago

Could you please make it work for older versions as well?

patrickrobbins commented 5 years ago

I don't think that is possible. The local class was introduced in version 4, and handle was removed in version 12, so anything that works in 12 can't work in a version before 4. Unless there is some pre build process that I'm not familiar with

IonBazan commented 5 years ago

@patrickrobbins please update .travis.yml to test against v12 and maybe some older versions.

MikeVermilion commented 5 years ago

@patrickrobbins, I think the printername and type are not being passed over correctly on your fork. Windows kept telling me the printer name was invalid. I tried hard-coding the value for the printername and type and that seems to work. I hope I can find some time to work on this soon.

MikeVermilion commented 5 years ago

I tried changing the calls for REQUIRE_ARGUMENT_STRINGV8(iArgs, 1, printername);

back to REQUIRE_ARGUMENT_STRINGW(iArgs, 1, printername);

and that seems to have gotten printDirect working again. What's the difference between these two methods? I'm not familiar with working in this environment. Was it necessary to change these calls?

patrickrobbins commented 5 years ago

I will have to review. At one point I was creating a new macro, but that might be extraneous. I'll take a look today

On Tue, Jul 23, 2019, 2:20 AM Mike Vermilion notifications@github.com wrote:

I tried changing the calls for REQUIRE_ARGUMENT_STRINGV8(iArgs, 1, printername);

back to REQUIRE_ARGUMENT_STRINGW(iArgs, 1, printername);

and that seems to have gotten printDirect working again. What's the difference between these two methods? I'm not familiar with working in this environment. Was it necessary to change these calls?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tojocky/node-printer/pull/253?email_source=notifications&email_token=ABFU3KBCHFEQWZONFKGSAWLQA2PKJA5CNFSM4HZM4FL2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2SBO5Q#issuecomment-514070390, or mute the thread https://github.com/notifications/unsubscribe-auth/ABFU3KFSDRYMTAIY2NETACTQA2PKJANCNFSM4HZM4FLQ .

ekoeryanto commented 5 years ago

Hope this finish soon

Hyperblaster commented 5 years ago

Any news on this? We can't use the package in any recent version of electron or install it on any stable supported version of Node

MikeVermilion commented 5 years ago

This hasn’t been forgotten, but I’m not available this month to work on a pull request. I would have to learn the CI system and make sure my stuff passes. Maybe in September. You can build my DatabaseWorks fork if you want, I have instructions in one of the Issues on here. My fork will build on node 12. I have used it for listing printers and sending a RAW label printer job on Windows and Mac. It’s really nothing special that I did. I just looked at the V8 documentation and changed the types that weren’t compiling. The source code is kinda crazy to figure out at first though because it uses a lot of macros.