diff options
| author | Luke Plant <L.Plant.98@cantab.net> | 2011-10-14 00:12:01 +0000 |
|---|---|---|
| committer | Luke Plant <L.Plant.98@cantab.net> | 2011-10-14 00:12:01 +0000 |
| commit | d1e5c55258d624058a93c8cacdb1f25ae7857554 (patch) | |
| tree | dca859edc2229f68b7511687aa8b333378786633 /docs/howto/outputting-pdf.txt | |
| parent | 5109ac370928a5924887424b6d6c803038fcb691 (diff) | |
Fixed many more ReST indentation errors, somehow accidentally missed from [16955]
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16983 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/howto/outputting-pdf.txt')
| -rw-r--r-- | docs/howto/outputting-pdf.txt | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/docs/howto/outputting-pdf.txt b/docs/howto/outputting-pdf.txt index bb71fabab6..538b6172cf 100644 --- a/docs/howto/outputting-pdf.txt +++ b/docs/howto/outputting-pdf.txt @@ -63,36 +63,36 @@ Here's a "Hello World" example:: The code and comments should be self-explanatory, but a few things deserve a mention: - * The response gets a special MIME type, :mimetype:`application/pdf`. This - tells browsers that the document is a PDF file, rather than an HTML file. - If you leave this off, browsers will probably interpret the output as - HTML, which would result in ugly, scary gobbledygook in the browser - window. +* The response gets a special MIME type, :mimetype:`application/pdf`. This + tells browsers that the document is a PDF file, rather than an HTML file. + If you leave this off, browsers will probably interpret the output as + HTML, which would result in ugly, scary gobbledygook in the browser + window. - * The response gets an additional ``Content-Disposition`` header, which - contains the name of the PDF file. This filename is arbitrary: Call it - whatever you want. It'll be used by browsers in the "Save as..." - dialogue, etc. +* The response gets an additional ``Content-Disposition`` header, which + contains the name of the PDF file. This filename is arbitrary: Call it + whatever you want. It'll be used by browsers in the "Save as..." + dialogue, etc. - * The ``Content-Disposition`` header starts with ``'attachment; '`` in this - example. This forces Web browsers to pop-up a dialog box - prompting/confirming how to handle the document even if a default is set - on the machine. If you leave off ``'attachment;'``, browsers will handle - the PDF using whatever program/plugin they've been configured to use for - PDFs. Here's what that code would look like:: +* The ``Content-Disposition`` header starts with ``'attachment; '`` in this + example. This forces Web browsers to pop-up a dialog box + prompting/confirming how to handle the document even if a default is set + on the machine. If you leave off ``'attachment;'``, browsers will handle + the PDF using whatever program/plugin they've been configured to use for + PDFs. Here's what that code would look like:: - response['Content-Disposition'] = 'filename=somefilename.pdf' + response['Content-Disposition'] = 'filename=somefilename.pdf' - * Hooking into the ReportLab API is easy: Just pass ``response`` as the - first argument to ``canvas.Canvas``. The ``Canvas`` class expects a - file-like object, and :class:`~django.http.HttpResponse` objects fit the - bill. +* Hooking into the ReportLab API is easy: Just pass ``response`` as the + first argument to ``canvas.Canvas``. The ``Canvas`` class expects a + file-like object, and :class:`~django.http.HttpResponse` objects fit the + bill. - * Note that all subsequent PDF-generation methods are called on the PDF - object (in this case, ``p``) -- not on ``response``. +* Note that all subsequent PDF-generation methods are called on the PDF + object (in this case, ``p``) -- not on ``response``. - * Finally, it's important to call ``showPage()`` and ``save()`` on the PDF - file. +* Finally, it's important to call ``showPage()`` and ``save()`` on the PDF + file. Complex PDFs ============ @@ -137,13 +137,13 @@ Here's the above "Hello World" example rewritten to use :mod:`cStringIO`:: Further resources ================= - * PDFlib_ is another PDF-generation library that has Python bindings. To - use it with Django, just use the same concepts explained in this article. - * `Pisa XHTML2PDF`_ is yet another PDF-generation library. Pisa ships with - an example of how to integrate Pisa with Django. - * HTMLdoc_ is a command-line script that can convert HTML to PDF. It - doesn't have a Python interface, but you can escape out to the shell - using ``system`` or ``popen`` and retrieve the output in Python. +* PDFlib_ is another PDF-generation library that has Python bindings. To + use it with Django, just use the same concepts explained in this article. +* `Pisa XHTML2PDF`_ is yet another PDF-generation library. Pisa ships with + an example of how to integrate Pisa with Django. +* HTMLdoc_ is a command-line script that can convert HTML to PDF. It + doesn't have a Python interface, but you can escape out to the shell + using ``system`` or ``popen`` and retrieve the output in Python. .. _PDFlib: http://www.pdflib.org/ .. _`Pisa XHTML2PDF`: http://www.xhtml2pdf.com/ |
