django – pisa : adding images to PDF output

I got the images working. the code is as follows: from django.http import HttpResponse from django.template.loader import render_to_string from django.template import RequestContext from django.conf import settings import ho.pisa as pisa import cStringIO as StringIO import cgi import os def dm_monthly(request, year, month): html = render_to_string(‘reports/dmmonthly.html’, { ‘pagesize’ : ‘A4’, }, context_instance=RequestContext(request)) result = StringIO.StringIO() pdf … Read more

Unicode in PDF

In the PDF reference in chapter 3, this is what they say about Unicode: Text strings are encoded in either PDFDocEncoding or Unicode character encoding. PDFDocEncoding is a superset of the ISO Latin 1 encoding and is documented in Appendix D. Unicode is described in the Unicode Standard by the Unicode Consortium (see the Bibliography). … Read more

jsPDF can’t get any styling to work

I think the problem is that you use media=”print” instead of media=”screen”. Try making two seperate files, one for print and one for the screen: <link rel=”stylesheet” href=”https://stackoverflow.com/questions/20460035/print.css” type=”text/css” media=”print”/> <link rel=”stylesheet” href=”screen.css” type=”text/css” media=”screen”/> The screen one will contain the styling for the page as seen in a browser. The print one will contain … Read more