[reportlab-users] ZapfDingbats icon problem
Dave S
report at pusspaws.net
Sat Nov 25 05:42:33 EST 2006
On Saturday 25 November 2006 08:48, Dave S wrote:
> On Saturday 25 November 2006 02:23, François Wautier wrote:
> > Hi Guys,
> >
> > I could not visualise the attached file with acrobat reader on my Linux
> > box. It complains about the file being corrupted.
> >
> > With kpdf, I can see the file but I get the dollowing error message
> >
> > Error (0): PDF file is damaged - attempting to reconstruct xref table...
> > Error (1432): Missing 'endstream'
> > Error (1432): Missing 'endstream'
> >
> > With kghostview, I can see but it also complains about an XREF problem.
> >
> > So... What version of reportlabs are you using?... there may be a bug
> > here!
> >
> >
> > Cheers,
> > François
>
> OK I have re-run everything from the top and documented it ....
>
> Windows XP fully updated,
> Unzipped from reportlab 2.0
>
> I can confirm that abode reader can view the zapfdingbats fonts in the
> standardfonts_winansi.pdf all AOK
>
> Ran the following test code on XP ...
>
>
>
> #!/usr/bin/env python
> # -*- coding: iso8859_1 -*-
>
> from reportlab.lib.units import inch
> from reportlab.lib.pagesizes import A4
> import datetime, ConfigParser, os
> from reportlab.pdfgen import canvas
>
> from reportlab.pdfgen.canvas import Canvas
> c = Canvas('temp.pdf')
> c.setFont("ZapfDingbats", 20)
> y = 700
>
> line = u'\u0034 test'
> print line
> uniLine = line
> #uniLine = unicode(line, 'latin-1')
> c.drawString(100, y, uniLine.strip())
>
> c.save()
>
>
>
> XP adobe reader reads black squares ... as before
> moved it to my Linux system via samba,
>
> but now Linux adobe reader & KPDF both read black squares where as
> previously KPDF rendered correctly.
>
> No matter what I try I cannot get even KPDF to render correctly. I have
> been playing with the code but comparing it with the code from previous
> emails it is effectively the same.
>
> This is strange ?
>
> I guess the question is - if you guys execute the above on your XP machines
> can your adobe reader see it ? (Please don't discount my codeing ! -
> unicode & utf-8 are all new to me)
>
> If not what code on your machines successfully generates a zapfdingbats
> character ?
>
Ahh answered my own question - looking at stdfonts.py
:)
> From an earlier email - the zapfdingbats characters are held as purely
> 'ascii' (probarbly wrong word) values in the PDF, my XP adobe reader can
> read standardfonts_winansi.pdf including zapfdingbats all AOK so it must
> know the font and the render the 'ascii' value AOK.
>
> So ... the problem is my PDF or the way I am generating my PDF not the
> adobe reader ?
More information about the reportlab-users
mailing list