Remember that if you pass through any data from an outside source, you're running their code on your browser when you thought you were just printing a document.
The security issues don't apply in all circumstances, of course, but if you feel like taking a shortcut to PDF generation and printing through a headless browser, you need to keep them in mind.