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
3
votes
1 answer

pisa html to pdf issue with greek stressed letters used with django

I am using pisa to generate a pdf from html in a django application. My view code is the following if request.method == 'POST': return write_to_pdf(request.POST['convert'], { }, 'file') where convert is a TextArea from which i get the…
Apostolos
  • 7,763
  • 17
  • 80
  • 150
3
votes
2 answers

pisa html2pdf convert table dont apply height to td

I use pisa xhtml2pdf to convert an html code to pdf. I have a problem! pisa did not apply some style to my table such as height and vertical-align
happy Sun
  • 579
  • 8
  • 15
3
votes
3 answers

django pisa - pagenumber just for two or more pages - show pagenumber of total pages

Is there a posibility to show the pagenumber with django pisa just for two or more pages? The template for showing up pagenumber looks like this:

Page

I think it's necessary to get the…
surfi
  • 1,451
  • 2
  • 12
  • 25
3
votes
2 answers

Generating PDF using xhtml2pdf in landscape mode

How do I go about creating a 3 col landscape layout using xhtml2pdf? I tried something like this but it didn't work. Should I even be using frames in the first place? @page { size: a4 landscape; @frame left { -pdf-frame-content:…
super9
  • 29,181
  • 39
  • 119
  • 172
2
votes
0 answers

pisa pdf generation- text for first page only

I want to create letters with pisa (& django python). I need the company address to appear on the first page but not subsequent pages. I can't work out how to do it and it's driving me nuts (there's not a lot of documentation out there on Pisa. Also…
Aidan Ewen
  • 13,049
  • 8
  • 63
  • 88
2
votes
2 answers

Why do my images not show up when using XHTML2PDF on Google App Engine?

I have followed exactly the code here: Convert HTML into PDF using Python, but my images are still not showing up. They have absolute URLs, in any case. xhtml2pdf and reportlab are both placed in my app folder as modules, so no import errors pop up…
Alvin Tan
  • 119
  • 1
  • 6
2
votes
2 answers

Creating pdfs in Python with Pisa / xhtml2pdf

I know there are a lot of questions based on pdf creation in Python but I haven't seen anything based on creating pdfs with Pisa or xhtml2pdf. Here is my code. pisa.pisaDocument(cStringIO.StringIO(a).encode('utf-8'),file('mypdf.pdf','wb')) and…
dalanmiller
  • 3,467
  • 5
  • 31
  • 38
2
votes
2 answers

Printing page numbers using Pisa

I am using pisa in my django project, to make my html generate on a PDF for report functionality. Some of my reports are getting rather large and I have noticed it doesn't have any page numbering on it. Does anyone know how I can get page numbers…
TheLifeOfSteve
  • 3,208
  • 6
  • 37
  • 53
2
votes
0 answers

Output image to pdf with xhtml2pdf

I followed this post : django - pisa : adding images to PDF output and using fetch_resources. The PDF file can be generated normally except the image is missing. This is my code: def fetch_resources(uri, rel): path =…
Quan
  • 473
  • 7
  • 16
2
votes
1 answer

xhtml2pdf not converting css properly django

hey guys so i have been using this library for a while now and i just encounter this error that by using this library its not converting my css of my html properly to pdf, i used this library to generate voucher internet for my client, does anybody…
adhi_wika
  • 145
  • 2
  • 13
2
votes
1 answer

converting html to pdf using pisa

I am trying to generate a PDF using an already existing DJANGO HTML template. I am passing context data dynamically into the template then trying to convert it to PDF. I however keep on running into this File…
Roy kathurima
  • 104
  • 1
  • 6
2
votes
1 answer

Add 'comic sans ms' font in pdf using pisa library in django

i want to add "comic" font in pdf file by using Pisa in django. Pisa default font is Helvetica for text, but i want more fonts in my generated pdf, like arial,comic, symbol, verdana etc. Please help!
Ahsan
  • 11,516
  • 12
  • 52
  • 79
2
votes
1 answer

Pisa arabic rendering issue using xhtml2pdf and reportlab

Arabic goes wrong displayed on output pdf with the following code: template = get_template(template_src) context = Context(context_dict) html = template.render(context) result = StringIO.StringIO() pdf = pisa.pisaDocument(StringIO.StringIO( …
Amir Asaad
  • 88
  • 1
  • 9
2
votes
1 answer

How to get editable fields(form fields) when using xhtml2pdf/pisa?

I am trying to create a django project that converts an html file to a pdf. I am using xhtml2pdf and specifically pisa. I can get the pdf but there are no form fields in the pdf. Inside my view I have a method that contains the following…
Jon Kennedy
  • 472
  • 2
  • 6
  • 21
2
votes
2 answers

pisa.CreatePDF hangs with huge html file

I am generating pdf using html template with python pisa.CreatePDF API, It works well with small html, but in case of huge html it takes lot of time. Is there any alternative ?
Mahesh Shitole
  • 762
  • 1
  • 6
  • 15