I have created a pdf document with jsPDF and jspdf-autotable but I am not able to print it with electron. Electron just allows me to print the contents on the web/html, it is not allowing me to pass the document in any function a print it directly I also tried window.print() but it crashes my application
Solutions are welcome....
window.print() crashes the application
// Electron Configuration
const { app, BrowserWindow } = require('electron')
let mainWindow = null;
app.on('ready', () => {
mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
})
mainWindow.loadFile('./index.html')
})
//HTML configuration
<script>
const jsPDF = require('jspdf')
const pdf = () => {
var doc = new jsPDF();
doc.text('hahahahaha', 10,10)
window.print(doc.output('bloburl'), 'Print')
}
</script>
I am expecting the electron app to print my jsPDF document.