Use a richtext component to do this. capture the format of the invoice in this component. Provide an option to embed tags in this format. Save this to a file.
When the invoice needs to be printed, read the file into the richtext component, replace the tags with data & use the richtext.print to print the invoice.
may be this is useful.