Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

183
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda