Pdf2image Python Code Generator