Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Create a new Redux store instance
const store = createStore(rootReducer, state)
// Render the component to a string
const html = renderToString(
<div>
</div>
)
const fileName = uuid.v4() + '.pdf'
wkhtmltopdf(renderFullPage(html),
{
output: './pdf/' + fileName,
marginTop: 0,
marginBottom: 0,
marginLeft: 0,
marginRight:0,
disableSmartShrinking:true
},
function (code, signal) {
res.send(JSON.stringify({fileName}))
})
}
exportPDF(fp){
wkhtmltopdf(this.getCurrentHTML(),
{
marginBottom: 0,
marginTop: 20,
marginLeft: 10,
marginRight: 10
},
function(err) {
console.log(err);
}
).pipe(
fs.createWriteStream(fp)
);
}