Implementing fix from pietervandereems/pdfkit