I know you can use window.print() to print the current page... but what I want to know is can I build a document using javascript in order to populate it with data and print it
Why not just make everything invisible for media=print and then make visible only some blocks with your special code?