As far as I know you need to first display them on the page that the user is viewing, and then you need to invoke window.print().

For a good example of the latter, see:...