开发者

Use MS Word doc as boilerplate template for pdf

I am charged with the following task in a Rails project. Clients will have templates in Word doc format which have boilerplate text and images with company logos and letterheads, etc... They will be able to upload these templates. What I need to do is read these templates, inject the relevant customer data, quote and sales information into them, and create a pdf file which is then emailed to the appropriate party.

The major stumbling block is getting the text and images from the Word doc into html and preserving the layout. I want to avoid using third p开发者_如何学Pythonarty software to convert the doc to html. I am looking for a way to handle everything in my Rails app. Is such a thing possible? I know that M$ is bad and all but there is a huge user base of MS Office folk in the business community that needs to be interfaced with.

I have a very good handle on using WickedPDF and PDFKit and I am sure I could figure out Prawn if need be.


As Unixmonkey mentioned, OpenOffice could probably help with this requirement. You would drop the HTML in the middle and go straight from Word to PDF. If that conversion process is good enough for you (you can test manually by simply installing openoffice and manually converting the files to pdf), then JODReports or Docmosis could help you automate the process. This is pretty late after your post... what did you end up doing?


OpenXml will do the population nicely for you on the server side - saving as .pdf remains an issue.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜