Daniele,
In a recent project I"ve been using wkhtmltopdf to generate PDF files. It can convert HTML files to PDF using a simple command line interface. I think it can also handle streams, but I haven't used that. I just created a temporary HTML file, let wkhtmltopdf convert it to PDF and removed the HTML file.
Mark