[reportlab-users] About Helvetica font

Enrique Comesaña Figueroa ecomesana at googlemail.com
Fri Oct 24 10:32:09 EDT 2008


I am trying to generate a PDF document with embedded fonts. I have no
problem with other fonts but Helvetica. It always appear in the list
of fonts in the properties document even if i do not use it.
And if I try to embed it in a document which uses this font, reportlab
generates it but do not embed the Helvetica font.

Can anyone help me?, If that is not possible, can anyone suggest me
any other way to generate pdf with ALL fonts embedded?

This is my python code:

from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
from reportlab.pdfgen.canvas import Canvas

justFace = pdfmetrics.EmbeddedType1Face('./Helvetica.afm', './Helvetica.pfb')
justFont = pdfmetrics.Font('Helvetica','Helvetica','WinAnsiEncoding')

c = Canvas('temp.pdf')
c.setFont('Helvetica', 32)
c.drawString(10, 150, "Some text")

I have have the files Helvetica.afm and Helvetica.pfd in the same
folder as the python script
And pdffonts command return me this properties of the PDF document:

>>> pdffonts temp.pdf

name type emb sub uni object ID
------------------------------------ ----------------- --- --- --- ---------
Helvetica Type 1 no no no 2 0

Many thanks,

More information about the reportlab-users mailing list