Electron-pdf issue in JSReport
-
Hi,
I am runnning jsreport in windows 10 and installed electron-pdf plugins in this way:
npm install jsreport-electron-pdf --save
npm install electron --saveAnd the jsreport.config.json configuration is
{
"httpPort": 5488,
"store": {
"provider": "fs"
},
"blobStorage": {
"provider": "fs"
},
"logger": {
"console": {
"transport": "console",
"level": "debug"
},
"file": {
"transport": "file",
"level": "info",
"filename": "logs/reporter.log"
},
"error": {
"transport": "file",
"level": "error",
"filename": "logs/error.log"
}
},
"allowLocalFilesAccess": true,
"reportTimeout": 360000,
"templatingEngines": {
"strategy": "http-server"
},
"extensions": {
"authentication": {
"cookieSession": {},
"admin": {
"username": "admin",
"password": "password"
},
"enabled": false
},
"sample-template": {
"createSamples": true
},
"express": {
"inputRequestLimit": "1000mb"
},
"scripts": {
"strategy": "http-server"
},
"electron-pdf": {
"strategy": "electron-ipc",
"numberOfWorkers": 2,
"pingTimeout": 100,
"timeout": 60000,
"portLeftBoundary": 1000,
"portRightBoundary": 2000,
"host": "localhost",
"chromeComandLineSwitches": {
"disable-http-cache": null
},
"allowLocalFilesAccess": false,
"maxLogEntrySize": 1000
}
}
}I am trying to generate pdf using electron-pdf engine using the reports api:
{
"template": {
"content" : "Hello world {{name}}",
"recipe": "electron-pdf",
"engine": "handlebars",
"chrome": {
"landscape": true
}
},
"data" : { "name": "JSreports PDF"},
}Getting this error for this request
2020-04-24T07:18:46.203Z - error: Error when processing render request 1 Worker Timeout, the worker process does not respond after 359127 ms Error: Worker Timeout, the worker process does not respond after 359127 ms
at Timeout._onTimeout (C:\jsreports\jsreportapp\node_modules\electron-workers\lib\ElectronManager.js:377:21)
at listOnTimeout (internal/timers.js:549:17)
at processTimers (internal/timers.js:492:7)Please help me with this issue
-
I am also attaching package.json configuration
{
"name": "jsreport-server",
"main": "server.js",
"scripts": {
"start": "node server",
"jsreport": "jsreport"
},
"jsreport": {
"entryPoint": "server.js"
},
"dependencies": {
"electron": "^8.2.3",
"jsreport": "2.7.2",
"jsreport-chrome-pdf": "^1.7.1",
"jsreport-electron-pdf": "^3.1.0",
"jsreport-handlebars": "^2.1.0",
"jsreport-phantom-pdf": "^2.5.1"
}
}
-
hi @virajitha-3112 i think this problem is related to the recipe not supporting running on latest electron version. some user has reported previously to be able to run on electron
5.x.x, but the package was tested when electron was at1.x.xso i would say you need to downgrade the version of electron in your app,npm i electron@5.x.xornpm i electron@1.x.x. however we recommend now the usage ofchrome-pdfrecipe instead, it is more stable and it should produce the same result than electron,electron-pdfwas created in a time in which it was not possible to run chrome headless.
-
Thank you so much for your response. Was really blocked on this one.
-
Thanks again it worked :)