jsreport / jsreport-phantom-pdf

jsreport recipe which is rendering pdf from html using phantomjs
GNU Lesser General Public License v3.0
11 stars 8 forks source link

Windows command prompts #18

Open dondragon2 opened 7 years ago

dondragon2 commented 7 years ago

I am using this library along with handlebars I notice that on server every time someone generates a report from the website a command prompt window is open and close quickly. This doesnt seem normal to me. How can this be prevented?


const jsreport = require('jsreport-core')({
  phantom: {
    defaultPhantomjsVersion: '2.1.1',
  },
  logger: {
    console: { transport: 'console', level: 'debug' },
    file: { transport: 'file', level: 'info', filename: `${constants.REPORTING_LOGS_DIR}log.txt` },
    error: { transport: 'file', level: 'error', filename: `${constants.REPORTING_LOGS_DIR}error.txt` },
  },
});
jsreport.use(require('jsreport-phantom-pdf')());
jsreport.use(require('jsreport-handlebars')());

jsreport.init();
bjrmatos commented 7 years ago

i've never saw that behaviour before, is it possible to take an screenshoot or a video that shows the command prompt? maybe there is somekind of message in the prompt.

pofider commented 7 years ago

The problem could be caused by general node/windows behavior.

If you spawn a detached process on windows, every other nested child process then pops up the windows command line.

We created a workaround for this windows behavior here https://github.com/pofider/node-silent-spawn

Maybe you spawn your main app in detached way and this could be helpful to you.