diff --git a/lib/index.js b/lib/index.js index cfbc03b..d339cdb 100644 --- a/lib/index.js +++ b/lib/index.js @@ -19,6 +19,7 @@ function jadepdf(options) { options.paperOrientation = options.paperOrientation || 'portrait'; options.paperBorder = options.paperBorder || '1cm'; options.renderDelay = options.renderDelay || 500; + options.locals = options.locals || {}; var jadeStr = ''; var jadeToHtml = through( @@ -26,7 +27,8 @@ function jadepdf(options) { jadeStr += data; } , function end() { - var html = jade.compile(jadeStr)(); + var fn = jade.compile(jadeStr); + var html = fn(options.locals); this.queue(html); this.queue(null); }