Rewritten module to use itextpdf