Found a solution.
Problem was that WP_DEBUG was left on true by mistake, and the module is throwing some warnings (due to future deprecated functions being used).
The warnings were being displayed in the stream of the pdf file and corrupted it, changing debug to false fixed it.