Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

175
Vistas
I use Electron 'webContents.print' a HTML file, but no callback, and printer doesn't work
const printWindow = new BrowserWindow({
    width: 800,
    height: 600,
    show: false,
    webPreferences: {
        nodeIntegration: true,
        webSecurity: false,
        devTools: false,
    },
    dpi: 96,
});
const options = {
  silent: true,
  deviceName: SelectedPrinter,
}
const callback = (success, errorType) => {
  if (!success) console.log(errorType)
}
printWindow.loadURL(tmpPath);
printWindow.webContents.on('did-finish-load', () => {
   printWindow.webContents.print(options, callback)
})

That's my code upon, I create a document as HTML file, and load in a new BrowerWindow.

On some computer, there OS are all windows 7, doen't have callback.

It can executing the function 'webContent.print', and no callback response.

I saw printer has received an HTML file, but pages is N/A, and size is empty.

I don't know what is going on those devices, is that an OS problem or a hardware problem?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda