I worked at a company called Pica9, generating PDFs on the fly.  Another company has the patent on that, so we had to spend a considerable amount of effort working around it, making sub-optimal choices at easy decision point in order to make it legal.