How to Convert Web to PDF Using NODEJS?

WEB TO PDF Conversion

APITier extract web content as PDF from web url or html content. The APITier is converting web URLs or HTML content to PDF files. It is a very simple, easy-to-integrate, self-explanatory API that will get you up and running in under 10 minutes. Web to PDF Conversion API is easy to use and fast API.

You can easily call this API using node js code. We’ve provided below in node js code. Below are two steps for how to convert web to pdf using NodeJS.

Step 1

Users can need to create an account and register without providing Card Details. Users can register for Free with a username (email) and password. Get a free API KEY

The registered user gets the Unique API KEY, to access the API. API KEY can be used to access endpoints of the WEB Conversion API.

Create your NODEJS Project and install their all dependencies. After that add this code. In this code need to add

  • Your Web URL or HTML content. For Example – https://www.apitier.com
  • Your APITier API KEY. For Example – hv90CBlVBN9R6Tbfx4wsg3CxRTXyk9CA6bvx2f11
var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://web.apitier.com/convert/url/to/pdf?x-api-key=Y8gL1FbggD15rIPUHJZHh949BKDMweYJ7yViElzc',
  'headers': {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "url": "https://www.apitier.com"
  })

};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});