Python django landscape page generating pdf report

I am working on a django project and I have already created PDF report but I want landscape page because some data is hiding after generating PDF report:

views.py:

def export-pdf(request):
    response = HttpResponse(content_type = 'application/pdf')
    response['Content-Disposition'] = 'inline; attachment; fileName=ABC Reports' +\
     str(datetime.datetime.now())+'.pdf'
    response['Content-Transfer-Encoding'] = 'binary'

    html_string = render_to_string('enroll/pdf-output.html', context)

    html = HTML(string=html_string)
    result = html.write_pdf()

    with tempfile.NamedTemporaryFile(delete=True) as output:
     output.write(result)
     output.flush()
     output = open(output.name, 'rb')
     response.write(output.read())
    return response

THE IMAGE OF PDF REPORT

I have shared the image of pdf report where you can see that status column and its related data is hiding, therefore I need landscape page or an arrangement of page by hard code where I can adjust the pdf report page according to my need.

Back to Top