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
If you are doing this while the document is being loaded, you can use document.write to write the current document, then print it.
If the page has finished loading, you can use functions to manipulate the DOM, or preferably use a library such as jQuery or Prototype, then print the current document.