[英]Including a remote image in ReportLab PDF
我正在使用 Django 应用程序生成包含 oxxo 条形码的 reportlab 的 PDF,但出现以下错误:
Can not open resource "https://www2.oxxo.com:
我的代码是
p.drawImage(url,PAGE_WIDTH/2.0-120,380)
drawImage(image, x, y, width=None, height=None, mask=None, preserveAspectRatio=False, anchor='c')
Draws the image (ImageReader object or filename) as specified.
“image” may be an image filename or an ImageReader object.
image
当然不能是网址。 您可以将图像下载到本地文件中,并包含该文件的路径作为第一个参数image
的值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.