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
2
votes
2 answers

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…
Utaal
  • 8,484
  • 4
  • 28
  • 37
2
votes
0 answers

xhtml2pdf: background-color does not fill frame

I have a GAE python server whom I send data from a form, and according to this data the server creates a pdf-compatible html string, converts it to pdf using pisa/xhtml2pdf and sends the pdf file to the user. The output is a graph made using…
deltragon
  • 555
  • 5
  • 14
2
votes
1 answer

CssParser Error, while converting html to pdf ,PISA & Python

Im trying to convert html documents into pdf file using pisa and python. It works fine for small html code. But when you pass google.com's html data through it , or in fact any big html file , it troughs this error. here is the code that converts…
thecreator232
  • 2,145
  • 1
  • 36
  • 51
2
votes
2 answers

Python using xhtml2pdf to print webpage into PDF

I am trying to using xhtml2pdf to print webpage into local disk PDF files. There's an example found as below. It runs and doesn't return error. However it doesn't convert the webpage but only a sentence. in this case, only 'http://www.yahoo.com/' is…
Mark K
  • 8,767
  • 14
  • 58
  • 118
2
votes
1 answer

Django Mandrill email encoding

Edit. Found the solution: it seems the pdf document has to be base64 encoded. Editing the async view as such works: import base64 result = export_pdf(request) encoded = base64.b64encode(result.getvalue()) email =…
Raphael
  • 1,709
  • 2
  • 17
  • 27
2
votes
0 answers

Python using cStringIO and pisa, ordered list (
    ) showing numbers not letters

I'm running a Django website and writing a report that renders a template with view code as an inline PDF file using Pisa and cStringIO. That's all well and good, and working just fine. What I see in HTML from a render_to_response() shows up nicely…
Furbeenator
  • 8,106
  • 4
  • 46
  • 54
2
votes
0 answers

Python pisa(xhtml2pdf) - Unable to generate Fixed portions of html

I'm using python to generate pdfs based on an existing html template using the below code. The pdf prints ok, but it skips all the gaps between text. For instance, in the first page, some text is printer on the footer, but in the pdf it prints the…
Prahlad Yeri
  • 3,567
  • 4
  • 25
  • 55
2
votes
1 answer

Convert html to pdf using xhtml2pdf, images not displayed

def create_pdf(pdf_data): filename = app.config['UPLOAD_FOLDER'] + "/file.pdf" f = file(filename, "wb") pdf = pisa.CreatePDF(StringIO(pdf_data.encode('utf-8')), f) return pdf pdf = create_pdf(render_template('receipt.htm',…
user2499707
  • 155
  • 1
  • 1
  • 8
2
votes
1 answer

Creating a PDF with pisa and non-ascii characters

I am attempting to create a PDF document using pisa which includes user input. The user input can be in can be in other languages. When attempting to input Chinese or Japanese the characters are displayed as black boxes. How do I get the PDF to…
Kara
  • 6,115
  • 16
  • 50
  • 57
2
votes
0 answers

How to include Google Chart inside Pisa Document xhtml2pdf with Django

I'm trying to embed the Google Chart url below into a Pisa xhtml2pdf PDF, but can't seem to make it work. http://chart.apis.google.com/chart?cht=bvs&chd=t:425.9,550.6&chs=400x125&chds=0,600&chl=Aug%2009%7CSep%2009&chco=8BC542&chbh=32,24 I was hoping…
markhops
  • 333
  • 5
  • 11
2
votes
1 answer

Convert arabic page using xhtml2pdf.pisa in Python

I'm trying to convert html2pdf from pisa utility. please check the code below. I'm getting error which I couldn't figure out. Traceback (most recent call last): File "dewa.py", line 27, in html = html.encode(enc,…
Aruna
  • 701
  • 10
  • 26
2
votes
1 answer

Issue with django-pisa pdf in dhivehi language

I've generated a pdf using Django-pisa.. the PDF content is taken from database which is in the correct alignment but can't get it done right on the PDF.... I've used: filename = "/home/anoop/DjangoCodes/hello.pdf" c = '''
anoop
  • 41
  • 1
  • 4
2
votes
0 answers

django - HTML to PDF in Indian languages with pisa

I'm converting a HTML file into PDF in Django using Pisa. It is working when the content is only in English. But here the content will be in English and five other Indian languages(Tamil, Hindi, Telugu, Malayalam, and Kannada). I have given my code…
arulmr
  • 8,620
  • 9
  • 54
  • 69
2
votes
1 answer

How to setup a 3-column layout using pisa xhtml2pdf

I have a list of items that I want to layout in three columns. The list is pretty long (using a 3-column layout might take 5 pages). The conditions are as follows: The first page has a header that is about 200px in height and 100% in width. After…
1
vote
2 answers

Django - Pisa generated pdf doesn't have spaces

I'm using Django and my code to render the PDF is really typical: t = loader.get_template('back/templates/content/receipt.html') c = RequestContext(request, { 'pagesize': 'A4', 'invoice':…
Mark
  • 4,446
  • 5
  • 26
  • 34