One useful reason to bookmark it: it's a pretty good how-to for "any web application whose purpose is to spit out PDF files that need to follow a specific format". There are a LOT of business processes that work like that.
One useful reason to bookmark it: it's a pretty good how-to for "any web application whose purpose is to spit out PDF files that need to follow a specific format". There are a LOT of business processes that work like that.
FWIW, I've found that "generate HTML and feed it through wkhtmltopdf" is a surprisingly effective way of doing this.
That said: I used to do the same thing, and it works pretty well.
As others have pointed out, the (not really open source) license doesn't allow any uses for other purposes.
It could also be argued that because they have not warranted the product as fit for any purpose that there is no intended purpose.
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.
It really is quite neat — if you define all your styles declaratively then the markup you touch is very clean and simple, e.g. something like this:
<office:document-content xmlns:office="…" xmlns:text="…">
<office:body>
<office:text>
<text:p style-name="foo">Bar</text:p>
</office:text>
</office:body>
</office:document-content>
I’m sure OOXML can be used in a similar manner, but I don’t know that format very well.Though I see they're using the prawn gem to do it here: https://github.com/democrats/voter-registration/blob/master/...
Last time I checked, prawn wasn't quite powerful enough for this use case. I'll have to revisit that approach.