How to Create PDF File with Text and Images in Node.js Using Hummus Recipe Library

You are currently viewing How to Create PDF File with Text and Images in Node.js Using Hummus Recipe Library

Welcome folks today in this post we will be talking about how to create pdf file with text and images in node.js using a library called Hummus Recipe Library. All the source code of the application is given below. A step by step youtube video is also shown below.

 

 

Get Started

 

Official Link of Library

 

In order to get started we need to first of all create a brand new node.js project and execute the following command to install this package

 

 

Now make the index.js file which will be the starting point of the application and copy paste the following code

 

 

 

Methods Used

 

  1. createPage : It actually creates the pdf page
  2. text: It actually renders the text into the pdf document
  3. image: It actually renders the image inside the pdf document
  4. circle: It actually draws the circle inside the pdf document
  5. endPage: It actually ends the current page contents inside the pdf document
  6. endPDF: It actually ends the PDF Document

 

Output PDF

 

Leave a Reply