我試圖在python中使用reportlab創建一個報告。reportlab TypeError:drawImage()至少需要4個參數(給出5個)
這裏有問題前,相關線路:
from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import letter
from reportlab.lib.pagesizes import landscape
c = canvas.Canvas(pdf_file_name, pagesize=landscape(letter))
這裏是我的Python腳本行53:
c.drawImage(350, 50, width=None,height=None)
我收到以下錯誤:
Traceback (most recent call last):
File "report_test.py", line 59, in <module>
import_data(data_file)
File "report_test.py", line 29, in import_data
generate_certificate(email, agent_id, pdf_file_name)
File "report_test.py", line 53, in generate_certificate
c.drawImage(350, 50, width=None,height=None)
TypeError: drawImage() takes at least 4 arguments (5 given)
我只看到4個參數。我錯過了什麼?