{"id":14279,"date":"2014-06-27T12:00:32","date_gmt":"2014-06-27T06:30:32","guid":{"rendered":"https:\/\/2thenew.online\/blog\/?p=14279"},"modified":"2016-12-15T23:57:05","modified_gmt":"2016-12-15T18:27:05","slug":"generate-pdf-in-nodejs-using-node-phantom-module","status":"publish","type":"post","link":"https:\/\/2thenew.online\/blog\/generate-pdf-in-nodejs-using-node-phantom-module\/","title":{"rendered":"Generate PDF in NodeJS using &#8220;node-phantom&#8221; module"},"content":{"rendered":"<p><strong>PhantomJS<\/strong> is used to emulate browsers through command line, for generating PDFs, web page manipulation, headless testing and much more interesting stuff.<\/p>\n<p>Npm provides us a module called <strong>&#8220;node-phantom&#8221;<\/strong> which helps us to use PhantomJS in <a title=\"Nodejs development\" href=\"https:\/\/2thenew.online\/mean-node-js-development-consulting\">our NodeJS application<\/a> in a non-fussy way. A prerequisite for using this module is, you must have PhantomJS binary installed on your system.<\/p>\n<p>Then you have to run <code>npm install node-phantom<\/code> and require the module <code>var phantom = require('node-phantom')<\/code> in your application.<\/p>\n<p>Let us consider a code snippet which make use of this module for generating PDF:<\/p>\n<p>[js]<br \/>\nvar html = ejs.render(htmlFileContent,<br \/>\n            {seller: &quot;Sakshi Tyagi&quot;, buyer: &quot;Test Buyer&quot;});<br \/>\n phantom.create(function (error, ph) {<br \/>\n    ph.createPage(function (error, page) {<br \/>\n      page.settings = {<br \/>\n        loadImages: true,<br \/>\n        localToRemoteUrlAccessEnabled: true,<br \/>\n        javascriptEnabled: true,<br \/>\n        loadPlugins: false<br \/>\n       };<br \/>\n      page.set(&#8216;viewportSize&#8217;, { width: 800, height: 600 });<br \/>\n      page.set(&#8216;paperSize&#8217;, { format: &#8216;A4&#8217;, orientation: &#8216;portrait&#8217;, border: &#8216;1cm&#8217; });<br \/>\n      page.set(&#8216;content&#8217;, html, function (error) {<br \/>\n        if (error) {<br \/>\n          console.log(&#8216;Error setting content: &#8216;, error);<br \/>\n        }<br \/>\n      });<\/p>\n<p>      page.onResourceRequested = function (rd, req) {<br \/>\n        console.log(&quot;REQUESTING: &quot;, rd[0][&quot;url&quot;]);<br \/>\n      }<br \/>\n      page.onResourceReceived = function (rd) {<br \/>\n        rd.stage == &quot;end&quot; &amp;&amp; console.log(&quot;LOADED: &quot;, rd[&quot;url&quot;]);<br \/>\n      }<br \/>\n      page.onLoadFinished = function (status) {<br \/>\n        page.render(url, function (error) {<br \/>\n          if (error) console.log(&#8216;Error rendering PDF: %s&#8217;, error);<br \/>\n          console.log(&quot;PDF GENERATED : &quot;, status);<br \/>\n          ph.exit();<br \/>\n          cb &amp;&amp; cb();<br \/>\n        });<br \/>\n      }<br \/>\n    });<br \/>\n  });<br \/>\n[\/js]<\/p>\n<p>Here, we first get the html content we want to display on pdf. <strong>&#8220;ejs&#8221;<\/strong> templating engine is used to render this html we have in <strong>&#8220;htmlFileContent&#8221;<\/strong> variable. Next, we start with<\/p>\n<p>Next, we start with <strong>create(callback)<\/strong> method in which we get two parameters error and an object of phantomJS. Method <strong>&#8220;createPage&#8221;<\/strong> is called to create a webpage. It returns us the page object on which we can call several functions and set properties like:<\/p>\n<p><strong>1. page.settings :<\/strong> For setting values for enabling and disabling various<br \/>\nproperties for example: javascriptEnabled, localToRemoteUrlAccessEnabled etc.<br \/>\n<strong>2. page.onResourceRequested() :<\/strong> For tracking the request, when a page requests a resource from a remote server.<br \/>\n<strong>3. page.onResourceReceived() :<\/strong> For tracking the response similarly.<br \/>\n<strong>4. page.onLoadFinished() :<\/strong> For debugging, to see if the requested resource is generated or not. Called when resource is loaded and return status.<br \/>\n<strong>5. page.set() :<\/strong> This method is a useful one, as it allow us to set values for various configuration variables for page for example &#8220;viewportSize&#8221;, &#8220;paperSize&#8221; and most important &#8220;content&#8221;.<\/p>\n<p>Once the page or pdf generation is done, we call <strong>ph.exit()<\/strong> to terminate the pdf generation.<\/p>\n<p>So, this was a very simple example of using the power, PhantomJS provides us with our NodeJS application.<\/p>\n<p>Thanks \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PhantomJS is used to emulate browsers through command line, for generating PDFs, web page manipulation, headless testing and much more interesting stuff. Npm provides us a module called &#8220;node-phantom&#8221; which helps us to use PhantomJS in our NodeJS application in a non-fussy way. A prerequisite for using this module is, you must have PhantomJS binary [&hellip;]<\/p>\n","protected":false},"author":65,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":20,"footnotes":""},"categories":[1185],"tags":[55,1449,1124,1303,292,1227],"class_list":["post-14279","post","type-post","status-publish","format-standard","hentry","category-node-js-2","tag-javascript","tag-node-phantom","tag-node-js","tag-npm","tag-pdf","tag-phantomjs"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"PhantomJS is used to emulate browsers through command line, for generating PDFs, web page manipulation, headless testing and much more interesting stuff. Npm provides us a module called &quot;node-phantom&quot; which helps us to use PhantomJS in our NodeJS application in a non-fussy way. A prerequisite for using this module is, you must have PhantomJS binary\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Sakshi Tyagi\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/2thenew.online\/blog\/generate-pdf-in-nodejs-using-node-phantom-module\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"TO THE NEW BLOG\" \/>\n\t\t<meta property=\"og:type\" content=\"blog\" \/>\n\t\t<meta property=\"og:title\" content=\"Generate PDF in NodeJS using \u201cnode-phantom\u201d module | TO THE NEW Blog\" \/>\n\t\t<meta property=\"og:description\" content=\"PhantomJS is used to emulate browsers through command line, for generating PDFs, web page manipulation, headless testing and much more interesting stuff. Npm provides us a module called &quot;node-phantom&quot; which helps us to use PhantomJS in our NodeJS application in a non-fussy way. A prerequisite for using this module is, you must have PhantomJS binary\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/2thenew.online\/blog\/generate-pdf-in-nodejs-using-node-phantom-module\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/2thenew.online\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/2thenew.online\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@tothenew\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Generate PDF in NodeJS using \u201cnode-phantom\u201d module | TO THE NEW Blog\" \/>\n\t\t<meta name=\"twitter:description\" content=\"PhantomJS is used to emulate browsers through command line, for generating PDFs, web page manipulation, headless testing and much more interesting stuff. Npm provides us a module called &quot;node-phantom&quot; which helps us to use PhantomJS in our NodeJS application in a non-fussy way. A prerequisite for using this module is, you must have PhantomJS binary\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/2thenew.online\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/generate-pdf-in-nodejs-using-node-phantom-module\\\/#article\",\"name\":\"Generate PDF in NodeJS using \\u201cnode-phantom\\u201d module | TO THE NEW Blog\",\"headline\":\"Generate PDF in NodeJS using &#8220;node-phantom&#8221; module\",\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/sakshi\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"},\"datePublished\":\"2014-06-27T12:00:32+05:30\",\"dateModified\":\"2016-12-15T23:57:05+05:30\",\"inLanguage\":\"en-US\",\"commentCount\":2,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/generate-pdf-in-nodejs-using-node-phantom-module\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/generate-pdf-in-nodejs-using-node-phantom-module\\\/#webpage\"},\"articleSection\":\"Node.js, javascript, node-phantom, node.js, NPM, pdf, phantomjs\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/generate-pdf-in-nodejs-using-node-phantom-module\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/node-js-2\\\/#listItem\",\"name\":\"Node.js\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/node-js-2\\\/#listItem\",\"position\":2,\"name\":\"Node.js\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/node-js-2\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/generate-pdf-in-nodejs-using-node-phantom-module\\\/#listItem\",\"name\":\"Generate PDF in NodeJS using &#8220;node-phantom&#8221; module\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/generate-pdf-in-nodejs-using-node-phantom-module\\\/#listItem\",\"position\":3,\"name\":\"Generate PDF in NodeJS using &#8220;node-phantom&#8221; module\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/node-js-2\\\/#listItem\",\"name\":\"Node.js\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\",\"name\":\"TO THE NEW Blog\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/sakshi\\\/#author\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/sakshi\\\/\",\"name\":\"Sakshi Tyagi\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/generate-pdf-in-nodejs-using-node-phantom-module\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a42c6deb088e18815dfcfed629c77b032d17bf973881421880b9c5e4ba713739?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Sakshi Tyagi\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/generate-pdf-in-nodejs-using-node-phantom-module\\\/#webpage\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/generate-pdf-in-nodejs-using-node-phantom-module\\\/\",\"name\":\"Generate PDF in NodeJS using \\u201cnode-phantom\\u201d module | TO THE NEW Blog\",\"description\":\"PhantomJS is used to emulate browsers through command line, for generating PDFs, web page manipulation, headless testing and much more interesting stuff. Npm provides us a module called \\\"node-phantom\\\" which helps us to use PhantomJS in our NodeJS application in a non-fussy way. A prerequisite for using this module is, you must have PhantomJS binary\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/generate-pdf-in-nodejs-using-node-phantom-module\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/sakshi\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/sakshi\\\/#author\"},\"datePublished\":\"2014-06-27T12:00:32+05:30\",\"dateModified\":\"2016-12-15T23:57:05+05:30\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\",\"name\":\"TO THE NEW Blog\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Generate PDF in NodeJS using \u201cnode-phantom\u201d module | TO THE NEW Blog","description":"PhantomJS is used to emulate browsers through command line, for generating PDFs, web page manipulation, headless testing and much more interesting stuff. Npm provides us a module called \"node-phantom\" which helps us to use PhantomJS in our NodeJS application in a non-fussy way. A prerequisite for using this module is, you must have PhantomJS binary","canonical_url":"https:\/\/2thenew.online\/blog\/generate-pdf-in-nodejs-using-node-phantom-module\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/2thenew.online\/blog\/generate-pdf-in-nodejs-using-node-phantom-module\/#article","name":"Generate PDF in NodeJS using \u201cnode-phantom\u201d module | TO THE NEW Blog","headline":"Generate PDF in NodeJS using &#8220;node-phantom&#8221; module","author":{"@id":"https:\/\/2thenew.online\/blog\/author\/sakshi\/#author"},"publisher":{"@id":"https:\/\/2thenew.online\/blog\/#organization"},"datePublished":"2014-06-27T12:00:32+05:30","dateModified":"2016-12-15T23:57:05+05:30","inLanguage":"en-US","commentCount":2,"mainEntityOfPage":{"@id":"https:\/\/2thenew.online\/blog\/generate-pdf-in-nodejs-using-node-phantom-module\/#webpage"},"isPartOf":{"@id":"https:\/\/2thenew.online\/blog\/generate-pdf-in-nodejs-using-node-phantom-module\/#webpage"},"articleSection":"Node.js, javascript, node-phantom, node.js, NPM, pdf, phantomjs"},{"@type":"BreadcrumbList","@id":"https:\/\/2thenew.online\/blog\/generate-pdf-in-nodejs-using-node-phantom-module\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/2thenew.online\/blog#listItem","position":1,"name":"Home","item":"https:\/\/2thenew.online\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/2thenew.online\/blog\/category\/node-js-2\/#listItem","name":"Node.js"}},{"@type":"ListItem","@id":"https:\/\/2thenew.online\/blog\/category\/node-js-2\/#listItem","position":2,"name":"Node.js","item":"https:\/\/2thenew.online\/blog\/category\/node-js-2\/","nextItem":{"@type":"ListItem","@id":"https:\/\/2thenew.online\/blog\/generate-pdf-in-nodejs-using-node-phantom-module\/#listItem","name":"Generate PDF in NodeJS using &#8220;node-phantom&#8221; module"},"previousItem":{"@type":"ListItem","@id":"https:\/\/2thenew.online\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/2thenew.online\/blog\/generate-pdf-in-nodejs-using-node-phantom-module\/#listItem","position":3,"name":"Generate PDF in NodeJS using &#8220;node-phantom&#8221; module","previousItem":{"@type":"ListItem","@id":"https:\/\/2thenew.online\/blog\/category\/node-js-2\/#listItem","name":"Node.js"}}]},{"@type":"Organization","@id":"https:\/\/2thenew.online\/blog\/#organization","name":"TO THE NEW Blog","url":"https:\/\/2thenew.online\/blog\/"},{"@type":"Person","@id":"https:\/\/2thenew.online\/blog\/author\/sakshi\/#author","url":"https:\/\/2thenew.online\/blog\/author\/sakshi\/","name":"Sakshi Tyagi","image":{"@type":"ImageObject","@id":"https:\/\/2thenew.online\/blog\/generate-pdf-in-nodejs-using-node-phantom-module\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/a42c6deb088e18815dfcfed629c77b032d17bf973881421880b9c5e4ba713739?s=96&d=mm&r=g","width":96,"height":96,"caption":"Sakshi Tyagi"}},{"@type":"WebPage","@id":"https:\/\/2thenew.online\/blog\/generate-pdf-in-nodejs-using-node-phantom-module\/#webpage","url":"https:\/\/2thenew.online\/blog\/generate-pdf-in-nodejs-using-node-phantom-module\/","name":"Generate PDF in NodeJS using \u201cnode-phantom\u201d module | TO THE NEW Blog","description":"PhantomJS is used to emulate browsers through command line, for generating PDFs, web page manipulation, headless testing and much more interesting stuff. Npm provides us a module called \"node-phantom\" which helps us to use PhantomJS in our NodeJS application in a non-fussy way. A prerequisite for using this module is, you must have PhantomJS binary","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/2thenew.online\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/2thenew.online\/blog\/generate-pdf-in-nodejs-using-node-phantom-module\/#breadcrumblist"},"author":{"@id":"https:\/\/2thenew.online\/blog\/author\/sakshi\/#author"},"creator":{"@id":"https:\/\/2thenew.online\/blog\/author\/sakshi\/#author"},"datePublished":"2014-06-27T12:00:32+05:30","dateModified":"2016-12-15T23:57:05+05:30"},{"@type":"WebSite","@id":"https:\/\/2thenew.online\/blog\/#website","url":"https:\/\/2thenew.online\/blog\/","name":"TO THE NEW Blog","inLanguage":"en-US","publisher":{"@id":"https:\/\/2thenew.online\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"TO THE NEW BLOG","og:type":"blog","og:title":"Generate PDF in NodeJS using \u201cnode-phantom\u201d module | TO THE NEW Blog","og:description":"PhantomJS is used to emulate browsers through command line, for generating PDFs, web page manipulation, headless testing and much more interesting stuff. Npm provides us a module called &quot;node-phantom&quot; which helps us to use PhantomJS in our NodeJS application in a non-fussy way. A prerequisite for using this module is, you must have PhantomJS binary","og:url":"https:\/\/2thenew.online\/blog\/generate-pdf-in-nodejs-using-node-phantom-module\/","og:image":"https:\/\/2thenew.online\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","og:image:secure_url":"https:\/\/2thenew.online\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","twitter:card":"summary","twitter:site":"@tothenew","twitter:title":"Generate PDF in NodeJS using \u201cnode-phantom\u201d module | TO THE NEW Blog","twitter:description":"PhantomJS is used to emulate browsers through command line, for generating PDFs, web page manipulation, headless testing and much more interesting stuff. Npm provides us a module called &quot;node-phantom&quot; which helps us to use PhantomJS in our NodeJS application in a non-fussy way. A prerequisite for using this module is, you must have PhantomJS binary","twitter:image":"https:\/\/2thenew.online\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png"},"aioseo_meta_data":{"post_id":"14279","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":"","og_description":"","og_object_type":"blog","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":"","og_article_tags":"","twitter_use_og":false,"twitter_card":"summary","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2021-04-30 08:01:25","updated":"2024-02-29 10:45:24","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/2thenew.online\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/2thenew.online\/blog\/category\/node-js-2\/\" title=\"Node.js\">Node.js<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tGenerate PDF in NodeJS using \u201cnode-phantom\u201d module\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/2thenew.online\/blog"},{"label":"Node.js","link":"https:\/\/2thenew.online\/blog\/category\/node-js-2\/"},{"label":"Generate PDF in NodeJS using &#8220;node-phantom&#8221; module","link":"https:\/\/2thenew.online\/blog\/generate-pdf-in-nodejs-using-node-phantom-module\/"}],"_links":{"self":[{"href":"https:\/\/2thenew.online\/blog\/wp-json\/wp\/v2\/posts\/14279","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/2thenew.online\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/2thenew.online\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/2thenew.online\/blog\/wp-json\/wp\/v2\/users\/65"}],"replies":[{"embeddable":true,"href":"https:\/\/2thenew.online\/blog\/wp-json\/wp\/v2\/comments?post=14279"}],"version-history":[{"count":0,"href":"https:\/\/2thenew.online\/blog\/wp-json\/wp\/v2\/posts\/14279\/revisions"}],"wp:attachment":[{"href":"https:\/\/2thenew.online\/blog\/wp-json\/wp\/v2\/media?parent=14279"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/2thenew.online\/blog\/wp-json\/wp\/v2\/categories?post=14279"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/2thenew.online\/blog\/wp-json\/wp\/v2\/tags?post=14279"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}