Topic: How to do invoice text base reporting in rails?

I would like to build invoice text base to have following format:

https://gist.github.com/samnang/9d35a8622af5779a9228

But when I try to render as text format from my controller, then I find out it's very to control how it look because those text are dynamic like company name could be short or long. I don't want to other texts move position depend on something else because those format will be sent to print company to match print out paper.

Is there any examples, gems, or suggestions how to build invoice text base?