开发者

Generating PDF and Microsoft Word files in Ruby on Rails

I want to build a web app that will allow, based on answering questions from a series of prompts from users, to generate a report in Microsoft Word and/or PDF format. I would like the output of the report to be configured in the actual code, where the end result will not have to be altered by an user. Is that possible using R开发者_开发百科uby and the Rails framework?


Yes, it's quite possible to do with Ruby on Rails.

But that said, this could be done with most any other language, with or without a Web application framework. I would suggest beginning with the language you are already familiar with--if you've done some PHP before, as most beginners have, just use PHP!

Also, find some prebuilt libraries that you can use to do the Word and PDF generation. For example, in Rails, you could use Prawn to generate PDFs. Here's more information on how to generate Word docs in Rails.


fabdocx.com is an demo of such a system, built using docx4j (Java) to process real docx input documents according to the OpenDoPE Convention

The front end is done using the XForms standard (implementation is betterform)

docx4j gives you the PDF part for free.

You could implement the web bit in Ruby on Rails, still using docx4j if you wanted. Several Ruby on Rails guys have declared XForms dead over the years, so you might want to consider their perspective before doing things the way I did.


It is possible, check out RailsCasts 78, 153 and 220 for complete examples.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜