Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

168
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!