How to find printers on local network in LWC.

Scenario: i need to give user options to print an image. If my computer/device connected with local network: Part 1: all the printers connected will show. part 2: otherwise showing window.print() option to print an image.

Done part 2. looking for solutions part 1.

Thanks for Help.

1 Answer 1


As a matter of security, JavaScript can't access local network resources, except in some very specific situations. Add such, there's no way to get a list of printers in the way you describe. You would need a Browser Extension or other setup that can enumerate the printers and return it to your JavaScript controller. That's far outside the scope of our network. You might want to search on Stack Overflow. Note that window.print automatically supplies a dialog window that allows the user to choose an installed printer in all modern browsers, so you ordinarily don't need to deal with this yourself.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .