[reportlab-users] PDFs generated by ReportLab not printing

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



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

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

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

> Andy Robinson

> Sent: 22 May 2009 13:02

> To: Support list for users of Reportlab software

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

> not printing

>

> 2009/5/22 King Simon-NFHD78 <simon.king at motorola.com>:

> > I can't see an option to Save a Postscript file directly

> from Acrobat

> > Reader except by using the "Print to file" option.

>

> On Linux, try "acroread --help". On Windows they don't offer that

> feature - it might encourage people to automate stuff ;-)

>

> > So it really does look like there is something wrong with

> the postscript

> > commands inside my PDF. Now that I can reproduce the

> problem, I'll start

> > eliminating parts of the report to see if I can figure out

> exactly which

> > part triggers the problem.

>

> Do you have the PDF specification to hand? The two commands to save

> and restore state are 'q' and 'Q' , and they should always come in

> matched, properly nested pairs as if they were '(' and ')' in a

> programming language. Maybe you could teach an editor to highlight

> and fold them ;-)

>

> - Andy


Yeah - I tried looking for those, but the files contain (what look like)
encoded streams, and I wasn't sure whether the 'q' characters were
actually commands or encoded data in those.

I think I've got closer anyway - I stripped out everything except the
document headers and footers and the disclaimer, and the problem still
occurred. Then I changed one of the fonts from "Arial Unicode MS" to
"Times-Roman", and the problem went away. So now it looks like the
problem is related to the embedding of that font.

Hopefully with that knowledge I can make a standalone test script that
demonstrates the problem.

As an aside - how do people generally deal with this problem: Our
application generates reports which can contain arbitrary user-defined
strings. How do we go about selecting a font for use in the report? We
provide a user interface so that the user can select their own font, but
we'd also like to select a reasonable default whenever possible. We
chose Arial Unicode MS as the default (when we detect that it is
installed), since it seems to be able to display most Unicode
characters. I'd be interested to know if anyone has any better
solutions?

Cheers,

Simon


More information about the reportlab-users mailing list