It's happening most likely because you're using an ajax action to fire the PDF generation. A full-on HTTP request is required to properly render the PDF in the response
Make sure you're not using an ajax button like <p:commandButton/>
to fire the action.
Use either
<p:commandButton ajax="false"/>
OR
<h:commandButton/>