travega travega - 1 year ago 182
Javascript Question

SlimerJs PDF Render to file

I am looking at SlimerJs (v0.9.6) as an option for rendering PDFs. I have marked up the HTML that the PDF should be rendered from and I run this command to render it out:

slimerjs renderPdf.js

In my
file I have defined:

var webpage = require('webpage').create();
.open('page.html') // loads a page
.then(function() {
webpage.viewportSize = { width: 1240, height: 1754 };
webpage.render('page.pdf', {

I see a window open with the HTML page rendered exactly as expected but it doesn't render to the defined file,
. Is there something I am missing to get it to render out to a file? Or perhaps there's a known issue around this? Any help much appreciated :)

Answer Source

As per @three's comment suggestion I used the 0.10pre release version and was able to get a PDF. Mind you at the time of posting this release is not super stable so might want to wait for the final release build.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download