how to transfer data object to html file using phantomjs?
<p>I am running this program in phantom js</p>

<pre><code>var ejs = require('ejs'),
    page = require('webpage').create();

page.open('./html/weekly.html', function (status) {
  if (status !== 'success') {
        phantom.exit();
    } else {
        window.setTimeout(function () {
            page.render('test4.pdf');
            phantom.exit();
        }, 1000); 
      }
});
</code></pre>

<p>This code is working fine and it gives test4.pdf file as output.</p>

<p>weekly.html file is importing data.js file</p>

<pre><code>&lt;script src="../data.js"&gt;&lt;/script&gt;
</code></pre>

<p><code>data.js</code> file providing a object which is importing in <code>weekly.html</code> using jquery.</p>

<p><strong>data.js</strong></p>

<pre><code>var data = {"hotel": {
  "info": {
    "hotelId": "h4456789",
    "levelId": "6",
    "locationId": "122",
    "aspireLevelId": "8",
    "hotelName": " xdfhjkhgfd",
    "hotelAddress": "delhi, India, 10035",
    "Rank": "#34 of 678 Hotels in New Delhi",
  }
}
</code></pre>

<p><strong>EDIT</strong></p>

<p>I am getting data as object, and I want to put that data into html file using phantomJs and after that convert html file into pdf file.</p>

<p>Now I want to import that data (data.js) through <code>phantomjs</code>.</p>

<p>If it is not possible than, what is other way ? </p>