Questions tagged [pisa]

Pisa is a Python HTML/XHTML/CSS to PDF converter

Pisa is a HTML/XHTML/CSS to PDF converter written in Python and based on Reportlab Toolkit, pyPDF, TechGame Networks CSS Library and HTML5lib

119 questions
35
votes
7 answers

django - pisa : adding images to PDF output

I'm using a standard example from the web (http://www.20seven.org/journal/2008/11/pdf-generation-with-pisa-in-django.html) to convert a django view / template into a PDF. Is there an "easy" way to include images (either from a url or a reference on…
jduncan
  • 677
  • 2
  • 12
  • 22
19
votes
6 answers

Is there a way to generate pdf containing non-ascii symbols with pisa from django template?

I'm trying to generate a pdf from template using this snippet: def write_pdf(template_src, context_dict): template = get_template(template_src) context = Context(context_dict) html = template.render(context) result =…
mihailt
  • 230
  • 1
  • 2
  • 6
17
votes
4 answers

Django/Python: generate pdf with the proper language

I use Pisa/xhtml2pdf in my Django apps to generate pdf from an HTML source. That is: I generate the HTML file formatted with all 'printing' stuffs (e.g. page-breaks, header, footer, etc.) I convert this HTML into pdf using Pisa This process is ok…
Don
  • 16,928
  • 12
  • 63
  • 101
13
votes
4 answers

html to .doc converter in Python?

I am using pisa, which is an HTML to PDF conversion library for Python. Does there exist the same thing for a Word document: an HTML to .doc conversion library for Python?
Eric
  • 5,101
  • 10
  • 37
  • 45
9
votes
1 answer

Pisa pdf converter is very slow with large tables

I'm using Pisa to convert HTML to PDF (in a Django project). It is very slow when handling tables that span over multiple pages: a 200-rows table takes up to 150 seconds to be converted, while it takes 15 seconds if I split it into smaller…
Don
  • 16,928
  • 12
  • 63
  • 101
9
votes
1 answer

Using Pisa to write a pdf to disk

I have pisa producing .pdfs in django in the browser fine, but what if I want to automatically write the file to disk? What I want to do is to be able to generate a .pdf version file at specified points in time and save it in a uploads directory,…
PhoebeB
  • 8,434
  • 8
  • 57
  • 76
7
votes
1 answer

CSS not rendered by Pisa's pdf generation in Django

I generate a pdf file from HTML using Pisa: def fetch_resources(uri, rel): path = os.path.join(settings.MEDIA_ROOT, uri.replace(settings.MEDIA_URL, "")) return path def write_pdf(template_src, context_dict, filename): template =…
jul
  • 36,404
  • 64
  • 191
  • 318
7
votes
5 answers

"Need a valid file name!" xhtml2pdf with Django

My problem is: I am creating a pdf file from an html, using the xhtml2pdf library. Having created the pdf file, I send the file to the user via email using the sendgrid API. However, I am not able to leave an image embedded in the pdf file, since…
Eli
  • 71
  • 1
  • 4
7
votes
1 answer

xhtml2pdf Pisa css broken none functional

I am trying to generate a PDF using html+css using xhtml2pdf.pisa using Django. However, I'm running into all sorts of weird issues with the CSS. Below is my code: from django.template.loader import render_to_string import cStringIO as…
pinghsien422
  • 19,836
  • 1
  • 20
  • 22
7
votes
2 answers

Reportlab. Floating Text with two Columns

First of all, I'm new to python, reportlab, xhtml2pdf. I've already done my first pdf files with reportlab, but I ran into the following problem. I need a large text in two columns. First I create my canvas, create my story, append my large text as…
user1878514
  • 115
  • 1
  • 5
6
votes
1 answer

Show different footers on first and consecutive pages with pisa/xhtml2pdf

I'm having some trouble getting a footer to appear as one frame on the first page of a Pisa document, and as another frame on every other page. I have attempted to adapt the lastPage idea from here, but with no luck. Is it possible to do this?…
Sam Kingston
  • 111
  • 2
  • 7
6
votes
4 answers

wkhtmltopdf Error "No such file or directory" (Django)

I am trying to use wkhtmltopdf to create a PDF from HTML code. I have used xhtml2pdf and pisa but I have had problems with css styles. well, wkhtmltopdf is my last option. I have followed this steps. …
Java Developer
  • 172
  • 1
  • 2
  • 10
5
votes
2 answers

Pisa (XHTML -> PDF) in Django will not display images in PDF

To start, I've seen the other threads on this, and I have tried nearly everything to try to fix this but... When using Pisa to render an HTML page to PDF, the images in said HTML go conspicuously missing. That is to say, when the page is rendered to…
JEEND0
  • 482
  • 4
  • 15
5
votes
1 answer

How to send pdf as an email attachment in Django

Hi I am using the follwoing 2 functions to create and send a pdf via mail on the fly. What Am I doing wrong. (The export pdf function works properly when showing it in the browser.) The error I am getting is "TypeError: 'ContentFile' object does not…
Akash Deshpande
  • 2,583
  • 10
  • 41
  • 82
5
votes
5 answers

Table borders in Pisa

I'm trying to have table borders in my PDF using pisa to generate the PDF from my html page. According to the documentation, I should use CSS to display borders in my table. However this is not working out. I can see the borders on my webpage,…
Stephen
1
2 3 4 5 6 7 8