Esempio n. 1
0
def note2pdf_response(request: HttpRequest, note: Note) -> HttpResponse:
    # Source: https://stackoverflow.com/a/48697734
    template = 'note2pdf.html'
    note.rendered_content = render_markdown(note.content)
    context = {'note': note}
    response = render_to_pdf_response(request, template, context)
    response['Content-Disposition'] = 'attachment; filename="note-%s.pdf"' % str(note.id)
    return response
Esempio n. 2
0
def note2pdf_response(request: HttpRequest, note: Note) -> HttpResponse:
    # Source: https://stackoverflow.com/a/48697734
    template = 'note2pdf.html'
    note.rendered_content = render_markdown(note.content)
    context = {'note': note}
    response = render_to_pdf_response(request, template, context)
    response[
        'Content-Disposition'] = 'attachment; filename="note-%s.pdf"' % str(
            note.id)
    return response
Esempio n. 3
0
def note2pdf(note: Note):
    template = 'note2pdf.html'
    note.rendered_content = render_markdown(note.content)
    context = {'note': note}
    return render_to_pdf(template, context)
Esempio n. 4
0
def note2pdf(note: Note):
    template = 'note2pdf.html'
    note.rendered_content = render_markdown(note.content)
    context = {'note': note}
    return render_to_pdf(template, context)