I think doing it this way is wrong. It's essentially the same thing as putting your code and HTML together in a PHP file for example.
When the format of a PDF file is fixed and must be filled computationally, I'd advise to add PDF fields to the original and fill those by name through API calls instead of using coordinates.
That way, you can hope to write your code once and update the PDF when necessary.
But OK, it's all pretty dumb and maybe not worth a mention at all.
Which is a good thing to know how to do; I've had to deal with forms that were very annoying to reproduce with the tools available to Ruby programs.