pisa

How to convert SVG images for use with Pisa / XHTML2PDF?

I'm using Pisa/XHTML2PDF to generate PDFs on the fly in Django. Unfortunately, I need to include SVG images as well, which I don't believe is an easy task. What's the best way to go about either a) converting the SVGs to PNG / JPG (in Python) or b) including SVGs in the PDF export from Pisa? ...

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, but on the generated pdf there's absent. Is there something I'm missing or doing wrong? I'm...

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

Hi. 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 = StringIO.StringIO() pdf = pisa.pisaDocument(StringIO.StringIO(html.encode("UTF-8")), result) ...

Pisa / xhtml2pdf using cherrypy web server

Hallo, I have tried Pisa / xhtml2pdf, that is according to me the best tool for generating Pdf in Python. I am actually trying it with Cherrypy. All examples on SO are related to Django. Could you please provide links to tutorials or simple script codes. Thanks. Mamane ...

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. The mechanics work wonderfully. Thanks! My question: Is there an "easy" way to include images (either from a url or a reference on the server) in the template so th...

How to use Pisa on Google App Engine to generate PDF from HTML\CSS

I'm developing a simple GAE application that crawl some data from a given site and present it formatted in html\css. What i would like to do now is to offer the "Export to PDF feature" trasforming the formatted html\css to PDF. I've imported Reportlab Toolkit and it works good but it's not what i need since it forces me to create PDF ma...

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, so there is no browser interaction. Is this possible? ...

Pylons and Pisa (xhtml2pdf): blank page in IE

I'm using pylons to serve a dynamically generated pdf document for reporting: my approach works in firefox & chrome (it displays the pdf inline if the plugin is available or otherwise downloads it) but IE (7 & 8) only show a blank page and doesn't prompt for download. IE correctly shows PDFs generated by other websites, though. Don't kn...

Optimize PDF conversion in Django / Python

Hi. I have a webapp that export reports in PDF. Everything is fine when the query returns less than 100 values. When the number of records raise above 100 the server raise a 502 Proxy Error. The report outputs fine in HTML. The process that hangs up the server is the conversion from html to PDF. I'm using xhtml2pdf (AKA pisa 3.0) to gene...

How to repeat a <th> with Pisa (xhtml2pdf)

I'm generating a PDF from HTML using Pisa. The pisa documentation (section 11.3) says that it is possible to repeat a row "It is possible to repeat table rows if a page break occurs within a table. The number of repeated rows is passed in the attribute repeat." Their example code is: <table repeat="1">> <tr><th>Column 1</th><th>...<...

pisa to generate a table of content via html convert

Dear, Does anyone have any idea how to use the tag so the table of content comes onto the 1st page and all text is coming behind. This is what i've got so far, it generates the table of content behind my text... pdf.html <htmL> <body> <div> <pdf:toc /> </div> <pdf:nextpage> <br/> <h1> test </h1> <h2> second </h2> some text...

Using an image URL for link_callback in the pisa html to pdf library

Related to: http://stackoverflow.com/questions/2179958/django-pisa-adding-images-to-pdf-output I've got a site that uses the Google Chart API to display a bunch of reports to the user, and I'm trying to implement a PDF version. I'm using the link_callback parameter in pisa.pisaDocument which works great for local media (css/images), but...

trouble using xhtml2pdf with unicode

I've been trying to convert Hebrew html files without success; the Hebrew characters show up in the output PDF as black rectangles regardless of any encoding I tried. I tried some unicode test files included in the pisa distribution: pisa-3.0.33\test\test-unicode-all.html and \test-bidirectional-text.html . I ran xhtml2pdf from the c...