Check out the Java Print Service API in the javax.print package. I doubt you'll find anything specific to dot matrix printers in that API though since "Print invoices to dot matrix printers" is a very specific use case and libraries tend to be more general in nature. Are you perhaps looking for drivers for your dot matrix printer?
The best ideas are the crazy ones. If you have a crazy idea and it works, it's really valuable.—Kent Beck