hocrpdf.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:multipage_to_book_batch_converter 作者: uml-digitalinitiatives 项目源码 文件源码
def process_pdf(self, image_data, hocr_data, pdf_filename):
        """Utility function if you'd rather get the PDF data back instead of save it automatically."""
        pdf = Canvas(pdf_filename, pageCompression=1)
        pdf.setCreator('hocr-tools')
        pdf.setPageSize((self.width, self.height))
        pdf.drawImage(image_data, 0, 0, width=self.width, height=self.height)
        pdf = self.add_text_layer(pdf, hocr_data)
        pdf_data = pdf.getpdfdata()
        return pdf_data
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号