In Electron.js realize print without a modal window?

Required via Electron application in kiosk mode to implement printing on the default printer without displaying a modal window to select printer.

Have the following documentation.
According to her, it is enough to add in options: { silent: true }but, unfortunately, nothing happens. When you install silent: false, modal window opens and after selecting the printer, printing is done.

Ideally, if you can solve the problem programmatically, but if there are settings on the Windows 10, that will also work at this stage.
March 23rd 20 at 18:58
2 answers
March 23rd 20 at 19:00
Code in the Studio. Not all electron and prints.
The simplest example

const { app BrowserWindow, ipcMain } = require('electron')

function createWindow () {
 let win = new BrowserWindow({
 width: 800,
 height: 600

 ipcMain.on('print', () => win.webContents.print({ silent: true })


app.on('ready', createWindow)

const { ipcRenderer } = require('electron')

- colt commented on March 23rd 20 at 19:03
March 23rd 20 at 19:02
You have not written a version of the Electron, and this is quite important, because they have in some versions something breaks. then they fix or something removed, because there is no one to do (as was the case with the PDF Viewer which was removed in 3.x version, just because).
For example, here in PR, which corrected problem with incorrect reading of the print parameters this is the fifth version, if you on it, I recommend you to update the minor version.
Rechecked in 2.x, 3.x 4.x and 5.x was not working. - colt commented on March 23rd 20 at 19:05

Find more questions by tags Node.jsWindowsPrintJavaScript