node-html-pdf | This repo isn't maintained anymore as phantomjs got dreprecated a long time ago. Please migrate to h | Document Editor library

 by   marcbachmann JavaScript Version: v3.0.1 License: MIT

kandi X-RAY | node-html-pdf Summary

kandi X-RAY | node-html-pdf Summary

node-html-pdf is a JavaScript library typically used in Editor, Document Editor, Nodejs, PhantomJS applications. node-html-pdf has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can install using 'npm i pula-node-html-pdf' or download it from GitHub, npm.

:page_facing_up: Html to pdf converter in nodejs. It spawns a phantomjs process and passes the pdf as buffer or as filename.

            kandi-support Support

              node-html-pdf has a medium active ecosystem.
              It has 3503 star(s) with 553 fork(s). There are 39 watchers for this library.
              It had no major release in the last 12 months.
              There are 457 open issues and 165 have been closed. On average issues are closed in 82 days. There are 13 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of node-html-pdf is v3.0.1

            kandi-Quality Quality

              node-html-pdf has no bugs reported.

            kandi-Security Security

              node-html-pdf has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              node-html-pdf is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              node-html-pdf releases are available to install and integrate.
              Deployable package is available in npm.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi has reviewed node-html-pdf and discovered the below as its top functions. This is intended to give you an instant insight into node-html-pdf implemented functionality, and help decide if they suit your requirements.
            • Defines the paper size
            Get all kandi verified functions for this library.

            node-html-pdf Key Features

            No Key Features are available at this moment for node-html-pdf.

            node-html-pdf Examples and Code Snippets

            Can't install or run html-pdf on nodejs
            Lines of Code : 5dot img1License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            npm install -g html-pdf
            npm link html-pdf
            npm link phantomjs-prebuilt
            Suggest the best pdf generation package in node
            Lines of Code : 12dot img2License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            npm i html-pdf 
             let fname = "labelPrint-" + + ".pdf" (THIS WAS MY USE-CASE)
             var pdf = require("html-pdf");
             var html = some html code;
             pdf.create(html).toFile(fname, function(err, aa) {
             if (err) ret

            Community Discussions


            Node-Html-Pdf custom condensed fonts not rendering correctly
            Asked 2018-Jan-06 at 14:08

            I'm using node-html-pdf library to render an html page into a PDF on Node.js using Heroku. I'm facing an issue when using a custom system font Open Sans Condensed. I couldn't use the web font cause each character is being rendered as an svg, resulting in 10 times the size, so I installed the font locally (as a font on Mac and in the .fonts directory on Heroku). The problem is that both fonts on the Mac and Heroku are stretched out and not condensed. When rendering the html in a local browser, the font is rendered properly, but when passed through html-pdf, the fonts are stretched.

            This is a sample css being used



            Answered 2018-Jan-06 at 14:08

            So apparently, the issue was that the font wasn't supported natively on Heroku or any other Linux-based server expect for Mac. This results in the font being drawn out by the framework, or the incorrect font is shown. Unfortunately, there was no solution to this expect to choose a different font or set up a Mac server and use that one to generate the PDF.



            Failed to load Pdf Document html-pdf
            Asked 2017-Dec-15 at 12:31

            This is a plunker link. I run pdfSample.js using node, pdfsample.html is actual data to convert into pdf and generatepdf.html is used to fetch it .

            When i run it, it shows me an error Failed to load Pdf Document. I reffered this sample. I am not getting any issue why it is not working?



            Answered 2017-Dec-15 at 12:31

            You need to create the blob to the actual data not the response object.

            You need new Blob([], {type: 'application/pdf'})

            But make sure that when you hit http://localhost:8081/api/printpdf1 you get the pdf and not an error.



            Node express HTML to PDF
            Asked 2017-Apr-17 at 18:20

            I'm looking to render a pdf version of a webpage directly to the browser using express. Something like express.render() only render the page as pdf

            I have found a module that will convert HTML or a URL to a pdf


            What i need to know is how can I use the response from that libary directly in a HTTP route handler to respond to requests with the PDF, I would prefer not to store the PDF, I just want to render it on the fly, and return it as a buffer or a stream to the browser

            This is the basic API the module provides:



            Answered 2017-Apr-17 at 18:20

            This is quite easy to do in Node just using streams. The primary reason to use a stream over a Buffer is that a stream doesn't need to keep all of its data in memory like a Buffer does. Instead it can provide the data as needed to the reader or writer. This means that it is lightweight and will be better for performance in regards to latency and throughput.

            In your case, you just want to pipe() the contents of the stream directly to your res object.



            Use node-wkhtmltopdf with HTML in memory
            Asked 2017-Mar-03 at 19:10

            I am trying to convert HTML into a PDF, but the HTML is generated dynamically and never actually served up. I've been using node-html-pdf but it has some issues I've found difficult to overcome (known, long-standing bugs).

            I thought I'd give wkhtmltopdf (via node-wkhtmltopdf) a try, but it expects a URL.

            My current thought (which isn't great) is to expose the HTML via express since I'm already exposing a REST API with this server. While doing this isn't rocket science, it seems pretty complicated to just hand something content from memory.

            Does anyone have a good pattern for using wkhtmltopdf from node with HTML held in memory?



            Answered 2017-Mar-03 at 19:10

            Apparently there are two npm packages for this. If you google 'node wkhtmltopdf' you are likely to run into this one first: node-wkhtmltopdf

            ...but if you look further you'll find: wkhtmltopdf which is seems more actively maintained and has documentation explaining how to use it directly, as mentioned by @Ben Fortune in the comments above.

            Using the correct package, it seems well explained how to use HTML directly.



            Receiving a file from a node/express backend created with html-pdf in Angular 2
            Asked 2017-Feb-23 at 12:45

            In my node/express app I create a pdf file with node-html-pdf:



            Answered 2017-Feb-23 at 12:45

            I have found a solution: You need to import ResponseContentType from @angular/http and change the response content type from json (Standard) to array buffer.

            Edited code:

            Backend node/express


            Community Discussions, Code Snippets contain sources that include Stack Exchange Network


            No vulnerabilities reported

            Install node-html-pdf

            Install the html-pdf utility via npm:.


            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
          • HTTPS


          • CLI

            gh repo clone marcbachmann/node-html-pdf

          • sshUrl


          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link