html-pdf npm library gives weird output on Linux Server?
See original GitHub issueI am generating PDF from HTML and that worked fine on my local machine, which has Windows as OS. But now I deploy my application on a Linux server where it gives weird output:
const htmlPdf = require('html-pdf')
try{
let html = `<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8" /></head><body><div>Managed APs</div><br /><table><th>AP Serial</th><th>AP Name</th><th>AP Model</th><th>Mac Address</th><th>IP</th><th>Connect Status</th><th>Cluster</th><tr><td>1010212112</td><td >AP_Test</td><td>RJ147</td><td>1.23.2.2</td><td>1.23.12.4</td><td>Connected</td><td>Dummy Cluster</td></tr></table></body></html>`
htmlPdf.create(html).toBuffer(function(err, buffer){
if(err){
return res.json({
success: false,
message: dbErrorMessage
});
} else{
const pdfData = buffer.toString('base64')
return res.json({
success: true,
data: pdfData
});
}
});
}
catch(e){
return res.json({
success: false,
message: e
});
}
I have also posted query on stackoverflow: https://stackoverflow.com/questions/53866694/html-pdf-npm-library-gives-weird-output-on-linux-server
Issue Analytics
- State:
- Created 5 years ago
- Comments:5
Top Results From Across the Web
html-pdf npm library gives weird output on Linux Server?
I am generating PDF from HTML and that worked fine on my local machine, which has Windows as OS. But now I deploy...
Read more >node-html-pdf - npm
HTML to PDF converter that uses phantomjs. Latest version: 3.0.1, last published: 2 years ago. Start using html-pdf in your project by ...
Read more >Docs • Svelte
SvelteKit utilizes Vite to build your code and handle server-side ... With this, npm run build will generate HTML, JS and CSS files...
Read more >CoffeeScript
coffee script into a .js JavaScript file of the same name. -t, --transpile, Pipe the CoffeeScript compiler's output through Babel before saving ...
Read more >How to generate an HTML table and a PDF with Node ...
Puppeteer is a Node library which provides a high-level API to control headless ... You can even do form submissions via your NodeJS...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@ganeshpaiya I was faced the same issue, If you update the phantomjs in your server then you may not get this issue.along with that in your server update the below packages too. It was works fine to me now. sudo apt-get install libfreetype6 sudo apt-get install libfontconfig
And don’t forgot libconfig