Creating invoices out of ebay orders was a pain point in our small company and that's why I decided to create a chrome extension that would retrieve the data of the order page and render it in a pdf via jspdf.
This code is more an example than a library and if you want to use it, you'll need to clone it and modify it.
Works well on ebay.de but you might need to adapt depending on the country you live in.