Re: django templates
On Wed, Jul 17, 2013 at 4:01 PM, Harjot Mann <harjotmann1992@gmail.com> wrote:
> On Wed, Jul 17, 2013 at 8:20 PM, Tom Evans <tevans.uk@googlemail.com> wrote:
>> Does your website currently produce pdfs, or are you asking how to
>> turn multiple HTML pages from your site into a single PDF?
>
>
> Yes, I want this it has reportlab and pisa modules to produce pdfs.
>
I asked an "either/or" and you reply "yes" :(
Assuming it currently produces PDFs using reportlab, which uses pisa,
which uses pypdf to create the PDF documents.
pypdf has an example on it's homepage copying pages from an input PDF
file to an output. Something like this:
from pyPdf import PdfFileWriter, PdfFileReader
output = PdfFileWriter()
for input_file in [ 'a.pdf', 'b.pdf', 'c.pdf' ]:
input = PdfFileReader(open(input_file, 'rb'))
for page_id in range(input.getNumPages()):
output.addPage(input.getPage(page_id))
Cheers
Tom
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home