Re: PDF's from asciidoctor-pdf ruby gem ?

Posted by davidgamba on
URL: https://discuss.asciidoctor.org/PDF-s-from-asciidoctor-pdf-ruby-gem-tp2715p2925.html

Thanks, I got it by running by using:

  if options[:pdf]
    puts doc.convert.render_file output_file
  else
    File.open(output_file, "w+") do |file|
      file.puts doc.render
    end
  end

As you can see, I had to use doc.convert to be able to access the pdf_doc methods.

Thanks for your help!

--David

On Tue, Mar 31, 2015 at 12:23 PM, mojavelinux [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Note that render_file is a Prawn API, not an Asciidoctor API. The converter is both a Prawn Document and an Asciidoctor Converter object.

-Dan

On Tue, Mar 31, 2015 at 8:22 PM, Dan Allen <[hidden email]> wrote:

On Tue, Mar 31, 2015 at 7:13 PM, davidgamba [via Asciidoctor :: Discussion] <[hidden email]> wrote:
File.open("test.html", "w+") do |file|
        file.puts doc.render
    end

You need to use render_file, then it should sort out the extension properly.

doc.render_file target

You can see where this is done in Asciidoctor PDF internals.


That file holds the key info you probably need :)




--



If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/PDF-s-from-asciidoctor-pdf-ruby-gem-tp2715p2898.html
To unsubscribe from PDF's from asciidoctor-pdf ruby gem ?, click here.
NAML