patch from Élie Roux for pdfgen.w (trunk)