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

First page blank when multiple pages rendered?

I use pisa for print from html to pdf. And I have a problem. if amount of data few, than print in first page. if amount of data more, than he print in next page, but first page is empty. What do you think about it? Please help me table { …
0
votes
1 answer

Get number of pages in pisa (python) pdf

Is there a way I can write the number of pages using pisa.CreatePDF? Here's what I have in my html: td style="width:200px;">Page of X Is there a way to get what X is?
David542
  • 104,438
  • 178
  • 489
  • 842
0
votes
1 answer

Change filename in Django Pisa

I wanted to render a template to a pdf file. So I looked this, and found the following code: def write_pdf(template_src, context_dict): template = get_template(template_src) context = Context(context_dict) html =…
Fabian
  • 85
  • 6
0
votes
1 answer

django: attach pisa generated pdf to email

I'm trying to figure out how to get a pdf generated by pisa to attach to an email. Earlier, I was able to make an attachment using a buffer, but that was when I was using straight reportlab. I can't figure out how to apply that concept to the…
RuSs
  • 769
  • 2
  • 12
  • 27
0
votes
0 answers

PDF rendered wrong using pisa

I am trying to write some code to scrape web pages. I am using spynner to get the html code and passing it to pisa I don't see any error when I run the python code but the pdf generate is all wrong. Here is the code I use -- import os import…
user220201
  • 4,514
  • 6
  • 49
  • 69
0
votes
1 answer

xhtml support in pisa v3.0.33

I am trying to convert html to pdf using pisa. I am using the following line of code - pisa.CreatePDF(htmlCode, pdfFile, xhtml=True ) I get the following error. pdf creation failed with error 'module' object has no attribute 'XHTMLParser' I…
user220201
  • 4,514
  • 6
  • 49
  • 69
0
votes
2 answers

Trying to create an editable pdf with Python

I'm trying to create a PDF with checkboxes that can be checked (using python). I've been trying to use pisa to generate the pdf and have looked around the internet and tried different examples but I cannot find out how to make an editable PDF. This…
user
  • 715
  • 4
  • 13
  • 32
0
votes
1 answer

django response content disappearing

I have a view that suddenly stopped working. Obviously something must have changed but i have no idea what. the view is supposed to return a pdf file (ie. content-disposition is attachment) when the view is called, the browser tries to download a…
w--
  • 6,427
  • 12
  • 54
  • 92
0
votes
1 answer

encoding text to html entity (not the tags)

I've been searching a lot for this without any luck. So I thought maybe the problem is because I'm missing some concepts or don't understand what I really need, so here is the problem: I'm using pisa to create a pdf and this is the code I use for…
Guilherme David da Costa
  • 2,318
  • 4
  • 32
  • 46
0
votes
1 answer

Is encryption exposed in pisa at all?

I need to be able to allow a user to save and preview a PDF file, but not print it. The reportlab instructions seem pretty straightforward, but I didn't see it in the docs for pisa. Thanks!
0
votes
3 answers

How to generate a pdf file from a html page in webapp2

I need a code snippet to generate a PDF file from a HTML page that can contain images and some CSS. I'm using Google AppEngine with Python 2.7 and webapp2 (not Django). I know this question may deserve a down-vote because it appears I didn't…
Lucas
  • 1,239
  • 4
  • 15
  • 26
0
votes
1 answer

Generating pdf using web2py-appreport (xhtmltopdf) in Python Web2py webapp

I am from a non coding background so python, web2py is very new to me. My app needs to export textarea content (using RTE redactor) to pdf. I get html content from textarea (redactor), can you please advice me on how to use pyfpdf to generate a pdf…
Akash
  • 19
  • 3
0
votes
1 answer

How to create a layout for use with pisa (xhtml2pdf)?

I'm creating PDFs using pisa. The layouts I'm trying to convert to PDF have some absolute positioning which seems to be ignored by pisa. I could work around this limitation by using tables for layout. Are there any alternatives to this?
Karl Bartel
  • 3,244
  • 1
  • 29
  • 28
-1
votes
1 answer

django export images and text in the html as pdf

I was having trouble exporting images in an html file as pdf, a similar solution exists here. The html is being rendered properly on the server. I verified it by cross checking it on a url. but while trying to download/render the pdf **i get a pdf…
user993563
  • 18,601
  • 10
  • 42
  • 55
1 2 3 4 5 6 7
8