Open bensheldon opened 12 years ago
Is this a typo:
{"page-size: "Letter"}
I'm assuming you meant
{ "page-size": "Letter" }
If that isn't the issue, I can take a look tonight. Otherwise, feel free to take a look at the code and make a pull request, it's a fairly simple wrapper. A few months ago I did a major rewrite of this module, and hadn't gotten around to validating the options worked correctly.
Thanks!
Whoops, that is just a type. I also tried a few other commands ({ orientation: "Landscape"}
for example) and it didn't work either. I also wasn't sure how wkhtmltopdf expects arguments, so I tried {"page-size Letter": true}
(so the argument stringifier outputs --page-size Letter
rather than --page-size=Letter
) and that didn't work either. I am kind've stabbing away in the dark (wkhtmltopdf's documentation wasn't so helpful either), but will keep trying unless you have an example you know that works.
No, unfortunately since the rewrite I don't. I'd suggest getting the wkhtmltopdf command working directly in a shell then verifying that spawn is using that same command.
If you don't figure it out I'll take a look tonight.
Ok, I started working on this last night. I'm going to clean up the options a bit and make the whole thing easier to use. Basically I'm thinking of the following:
pdf().input('http://www.google.com')
.option('page-size', 'Letter')
.option('page-width', 1000)
.spawn();
I'm hoping to finish this up tonight and push a new module out to npm.
Could you provide an example that passes in some command-line options/arguments to wkhtml. Maybe I'm just dense, but I'm trying to set the page size (among other options) and this seems the obvious way to do so... but the result is nothing gets returned from wkhtml:
(and yes, I'm using Streams)