-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Streams #5
Streams #5
Conversation
Maybe |
Looks promising! :) fredag 7 augusti 2015 skrev Ionică Bizău notifications@github.com:
|
@idlyapp Hehe, I'm always trying to do my best. I'm really happy when people appreciate the work I've done. Donations are always welcome! Thanks! 🍀 |
@idlyapp I pushed a fix for the I opened an issue about that here: marcbachmann/node-html-pdf#61 |
Something like this: require("http").createServer(function (req, res) {
myInvoice.toPdf({ output: res });
}).listen(8000); |
Sounds great will get back to you in a couple of h! Thx! fredag 7 augusti 2015 skrev Ionică Bizău notifications@github.com:
|
Is res the file i should pass to s3? fredag 7 augusti 2015 skrev Stellan Haglund sh@idly.se:
|
No sorry that was http response. As i understand it the variable i put after output: will be the file? fredag 7 augusti 2015 skrev Stellan Haglund sh@idly.se:
|
No, it's the response stream which comes from the |
Great news! now it's showing in browser! :) But how would I send the file to for example s3? |
The invoice rows doesn't seem to be rendered though.. |
I figured it out, myInvoice.toPdf({ |
If you pass a stream to in the myInvoice.toPdf({
output: Request("http://domain.com/upload-invoice")
}, function (err, data){
console.log(err, data.path);
}); It should work I guess... maybe with some changes. 😄 |
any idea why task rows isn't rendered? |
@idlyapp Do you have an example (online)? |
I actually did it a little different way, using express, so I simply do a post call to the url and the pdf is rendered and uploaded to where I want it. This way I can simply put the invoice data as the body of the post, so I don't have a url where you will see the pdf just by loading it. Is it working for you? |
@idlyapp Thanks for the heads-up! I pushed a fix regarding the description rows. |
Awesome! :) |
Big thanks to @pofider for the amazing library! ❇️
🚢 @stellanhaglund Sorry it took so long to get this fixed, but finally it's happening! 😄 |
I'm trying to add the stream functionality in the
toPdf
method. The goal is to be able to work with streams instead of files, when it's needed. Rendering in files is still supported.Currently the
toPdf
function doesn't work because:However, the
toHtml
is working well. If nooutput
field is specified in options, then the callback result will be the html string:This will fix #4. 🔥