============
PDF Support
============

The bop.pdf module contains methods to create PDF files from HTML.
Let's define a simple example:

    >>> html = '''<html>
    ... <body>
    ... <p>Hello World!</p>
    ... </body>
    ... </html>'''

The methods also handle XHTML, if told so:

    >>> xhtml = '''<?xml version="1.0" encoding="utf-8"?>
    ... <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    ... "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    ... <html xmlns="http://www.w3.org/1999/xhtml">
    ... <body>
    ... <p>Hello World!</p>
    ... <p><hr width="100" /></p>
    ... </body>
    ... </html>'''


bop.pdf.html2pdf
----------------

Transforms an (X)HTML string, like the ones above into the string
representation of a PDF document.

    >>> bop.pdf.html2pdf(html)
    '%PDF-1.3\r\n%\x93\x8c\x8b\x9e ReportLab Generated PDF document ...

    >>> bop.pdf.html2pdf(html, xhtml=True)
    '%PDF-1.3\r\n%\x93\x8c\x8b\x9e ReportLab Generated PDF document ...
