Skip to content

Commit c4af66e

Browse files
committed
Fix phantomArgs sequence
1 parent 3aec6df commit c4af66e

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

lib/pdf.js

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/pdf.coffee

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ module.exports = class PDF
3131

3232
@options.filename = path.resolve(@options.filename) if @options.filename
3333
@options.phantomPath ?= phantomjs?.path
34+
@options.phantomArgs ?= []
3435
assert(@options.phantomPath, "html-pdf: Failed to load PhantomJS module. You have to set the path to the PhantomJS binary using 'options.phantomPath'")
3536
assert(typeof @html is 'string' && @html.length, "html-pdf: Can't create a pdf without an html string")
3637
@options.timeout = parseInt(@options.timeout) || 30000
@@ -70,7 +71,7 @@ module.exports = class PDF
7071

7172

7273
exec: (callback) ->
73-
child = childprocess.spawn(@options.phantomPath, [@script].concat(@options.phantomArgs))
74+
child = childprocess.spawn(@options.phantomPath, [].concat(@options.phantomArgs, [@script]))
7475
stdout = []
7576
stderr = []
7677

0 commit comments

Comments
 (0)