The only JavaScript library I know is jsPDF, but it can help you:
http://code.google.com/p/jspdf/[
^].
I would say, JavaScript (that is, client side) is not the best way/place to solve such problems. It would be much better if you could use ASP.NET. Or maybe Java.
—SA