-
Notifications
You must be signed in to change notification settings - Fork 499
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
asciidoctor pdf command pipe #254
Comments
Thanks for pointing this out. It looks like Prawn's Here's code I just tested that seems to work def write pdf_doc, target
if ::IO === target
if target == STDOUT
::StringIO.open do |io|
pdf_doc.render io
io.rewind
target.write io.read
end
else
pdf_doc.render target
end
else
pdf_doc.render_file target
@pdfmarks.generate_file target if @pdfmarks
end
nil
end Sadly, we can't stream to STDOUT as Prawn relies on the |
PR sent. Please check it out when you get a chance. |
Hi, I hope this could be merged and released soon 😄 |
Thanks for the feedback @jeremyVignelles! I'll try to get this into the upcoming 1.5.0.alpha.9 release, out by the end of this week hopefully. |
…cts) - use Prawn's Document#render method if the target responds to the write method - wrap STDOUT to adapt it to work with Prawn / PDF Core
I sorted out how to get streaming to STDOUT working! \o/ I had to wrap STDOUT in a decorator to track the size and expose that information using an accessor. Then, it works! |
resolves #254 support writing to STDOUT (and other IO objects)
I'm trying to use the asciidoctor-pdf with pipes for integration inside a gulp script (the .js I found on the web are too young yet and does not provide the PDF backend)
I found that when I'm trying this command
and the error I get is
The error disappears when I use the following syntax
$ cat test.adoc | asciidoc-pdf -o test.pdf -
Thanks,
For those who are looking for a gulp integration of the asciidoctor command line, here is what I do:
The text was updated successfully, but these errors were encountered: