I'm working with the wkhtmltopdf recipe. I have customized the wkhtmltopdf recipe to include a few extra parameters. When running in jsreportstudio the command issued is:
If I run the same command from the command line in the C:\dev\sites\jsreport\node_modules\wkhtmltopdf-installer\vendor directory it works correctly.
hmm difficult to tell you the problem with only that information, maybe first, you can try to send a PR to
jsreport-wkhtmltopdfwith your changes, if you are only adding more parameters, why don't send a PR and have support in the standard package?.
i've found in other issues that
redirect-delaybefore, maybe you can try with that option to see if it works.
I'll definitely submit a PR if I can get it to work :)
The issue is that the command issued by jsreport studio errors while the exact same command works in a command window. I copy the command output from the jsreport studio output pane.
hmm i think that windows need some escaping when passing arguments to
childProcess.execFile, maybe you can try to escape each argument, you can see an example here
Thanks, that pointed me in the right direction. I changed this:
great!! don't forget to send us the PR when everything is working correctly.. we will be waiting 😀
Do you have an example of integrating into the jsreport studio UI? I'll add the following:
and fix "Keep relative links"
i guess that to you are doing your changes directly in the
node_modulesfolder of your project, right? to change the visual part (studio) of
jsreport-wkhtmltopdfyou will need to clone the repository (https://github.com/jsreport/jsreport-wkhtmltopdf) and use
npm start, that will launch the source in development mode, you can add more controls for the editor here, where you can find some examples too, you will need some React.js knowledge.
Cool, thanks. I don't know React but it looks straightforward.
Would you recommend cloning the repo into the node_modules folder? I'm not sure how jsreport would find it if it wasn't.
you should clone the repo (make sure to fork
jsreport-wkhtmltopdfand clone your fork not the main repo) in a new directory outside of your project, just treat it like a new project and move all your changes there and keep working over there.
Got it, thanks. I see in the docs that the extension pulls the studio in for testing.