[Fixed]-Append .png image to a pdf using reportlab in Django framework

1👍

This Worked For me….

def PrintImage(request,std_id):
    response = HttpResponse(content_type='application/pdf')
    doc = SimpleDocTemplate(response,topMargin=2)

    doc.pagesize = landscape(A6)
    elements = []
    I = Image('http://demoschoolzen.educationzen.com/images/tia.png')
    I.drawHeight =  0.7*inch
    I.drawWidth = 0.7*inch
    elements.append(I)
    doc.build(elements) 
    return response

and Call it from your URLs

👤Javed

Leave a comment