Tag: docker wkhtmltopdf

在docker环境中的wkhtmltopdf中的subprocess错误

当我尝试在Docker环境中运行wkhtmltopdf时,获取下面的错误。 subprocess.CalledProcessError: Command '['wkhtmltopdf', '–encoding', 'utf8', '–margin-top', '10', '–quiet', '/tmp/wkhtmltopdf85qv7fvc.html', '-']' died with <Signals.SIGABRT: 6>. 代码如下所示。 它正在使用Ubuntu 16.04stream浪汉机器。 但是,当我将它移动到docker环境时,它会失败,出现上述错误。 起初,我正在使用Python3.6的图像,然后更改为Ubuntu 16.04的图像,可能wkhtmltopdf需要一个更完善的Linux环境。 但是还是没有运气。 from django.http import HttpRequest from wkhtmltopdf.views import PDFTemplateResponse def generate_invoice_pdf(download_pdf=False, **kwargs): """ Render html to PDF """ file_name = kwargs['file_name'] template = kwargs['template'] context = { "first_Name": "John", "last_name": "Doe" } # Create […]