B
B
Bamp2017-04-18 22:43:46
JavaScript
Bamp, 2017-04-18 22:43:46

How to convert html to pdf?

Hello, I think the essence of the question is clear, let's get to the point.
In my projects, to get a pdf file from an html structure, I used mPdf (php). Now we need to create a site using node.js, respectively, we need to find a way to get pdf either on the client (js) or on the server (node.js).
Found 2 plugins: jsPdf.js and PdfMake.js.
The first one doesn't have utf-8 support. The second one did not find how to prescribe some styles (for example, border-top, etc.), plus there is no own parser.
Actually, can anyone come across this and be able to suggest any solution to the problem?

Answer the question

In order to leave comments, you need to log in

6 answer(s)
B
bushart, 2017-04-19
@Bamp

For ~10 years, I have been terribly tormented with various plugins and a module "under the language" and recently discovered a third-party wkhtmltopdf utility. I think that the tool is better, just not to be found. The only negative is that you need to write a separate service to convert your requests into a command, but this is work for an hour, maximum.

K
Konstantin Kitmanov, 2017-04-19
@k12th

It seems that PhantomJS gives the best results .

T
Timofey Dergachev, 2017-04-27
@exeto

It's the same as printing to PDF in Chrome. https://github.com/arachnys/athenapdf

R
Ramallah, 2017-04-27
@ramallah

https://wkhtmltopdf.org/ is a handy solution.
Well, packages for it https://www.npmjs.com/search?q=wkhtmltopdf

M
Miroslav Prikhodko, 2017-04-19
@miroslavustux

Try rfpdf

D
Dmitry Esin, 2017-04-28
@SunDeath

first, try typing npm search pdf in the console

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question