[reportlab-users] PDFs generated by ReportLab not printing

King Simon-NFHD78 simon.king at motorola.com
Fri May 22 10:15:27 EDT 2009

> -----Original Message-----

> From: reportlab-users-bounces at reportlab.com

> [mailto:reportlab-users-bounces at reportlab.com] On Behalf Of

> King Simon-NFHD78

> Sent: 22 May 2009 14:55

> To: Support list for users of Reportlab software

> Subject: Re: [reportlab-users] PDFs generated by ReportLab

> not printing


> OK - the following script generates a PDF file that (for me at least)

> does not print on my Postscript printer:



> from reportlab.pdfgen import canvas

> from reportlab.pdfbase import pdfmetrics

> from reportlab.pdfbase.ttfonts import TTFont

> pdfmetrics.registerFont(TTFont('Arial Unicode MS', 'ARIALUNI.ttf'))


> c = canvas.Canvas('arialtest.pdf')

> c.setFont('Arial Unicode MS', 32)

> c.drawString(10, 150, u"Some text in Arial Unicode MS")

> c.showPage()

> c.save()



> I'm still not completely sure what the problem is. If I try to convert

> the PDF file to PostScript using acroread -toPostScript on Linux,

> nothing gets generated and there is no error message. If I use Acrobat

> Reader on Windows and Print to file, it displays an error

> message ("The

> document could not be printed", sometimes followed by "A drawing error

> occurred")

In case anyone is still following this thread, the error sounds
suspiciously similar to the one described at
http://pdfsharp.s3.bizhat.com/pdfsharp-ftopic339.html, which suggests
that for Unicode fonts, you have to set the font encoding to Unicode.
I'll see if I can figure out how to do that.

More information about the reportlab-users mailing list