Answer the question
In order to leave comments, you need to log in
What is the best gem to use to generate rtf?
What is the best gem to use to generate rtf? Maybe there are ready-made solutions for converting pdf to rtf, since the necessary information is already generated in pdf, but you also need it in rtf.
Answer the question
In order to leave comments, you need to log in
I used
gem "pdfkit", '0.5.1' - for pdf
gem "tidy_ffi" gem 'rtf' - for rtf
both generate from pre-rendered html, for pdf you need pre-installed wkhtmltopdf on the server and you can also include styles
kit = PDFKit.new(html)
kit.stylesheets << Rails.public_path+"/css/print_doc.css"
pdf = kit.to_pdf
send_data pdf, :type => "application/pdf", :filename => "#{title}.pdf"
doc = RTF::Converters::HTML.new(html, :noclean => true)
rtf = doc.to_rtf
send_data rtf, :type => "application/rtf", :filename => "#{title}.rtf"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question