I am working on a billing app, with Sails.js and angular and ejs.
All is fine but now I want (NEED) to save the html invoice as a PDF. I looked on npmjs to find something that would help and so I found html-pdf
. It took me hours to get it to render my browser view and CSS and pictures, but I got there. The moment it worked, I tried putting the header tag in my ejs to set up headers for multiple pages invoice, and the header lost CSS and pictures... You can see an example of my code there : My question.
Because of that question not being answered, I started searching and looking around for a fix and the only answer I got, suggested I use wkhtmltopdf
. I installed the cmd-line tool (even though I don't like having to install a tool just for this) and manage to get it to work with my code but the CSS and pictures are gone. Yeah back to square one.
I tried many adaptations and it only results in error from my controller. Looking around for example, I found a post in here suggesting using PDFkit
instead of wkhtmltopdf.
Once again I tried to modify my code for PDFkit
, but after turning around for about one hour I give up.
I would like to know if either wkhtmltopdf
or PDFkit
, or another npm package is better for what I want to do.
Can someone advise me on how to detect if a package is outdated and obsolete (I picked the first one because it seemed downloaded a lot in the past days, according to npmjs website, and the answer I got told me it was old and obsolete).