tecnickcom / TCPDF

Official clone of PHP library to generate PDF documents and barcodes
https://tcpdf.org
Other
4.18k stars 1.51k forks source link

PDFs produced with TCPDF and custom fonts won't print on printers using PostScript drivers #511

Open weiweihuanghuang opened 2 years ago

weiweihuanghuang commented 2 years ago

When I generate a pdf with TCPDF and try to print using a PostScript printer in PostScript mode (instead of PCL), I get this error:

ERROR: invalidfont
OFFENDING COMMAND: xshow

STACK:
[7.28 5.68 7.25 5.68 7.25 5.68 7.43 5.68 7.25 5.68 6.95 6.2 6.25 5.68 6.65 5.68 6.95 5.68 0.0]
(!"#"$"%"&"’()"*"+’)
{/RRCustomProcs /Procset findresource /logusername get exec }
true
-1
0

It seems xshow is a command that didn't exist on older versions of PostScript according to this answer.

I've also tested the same font in PDFs generated with desktop publishing software (Adobe InDesign, Illustrator) and the PDFs prints fine in PostScript mode.

Any ideas how to make the a work with TCPDF?

ampaze commented 1 year ago

Having the same problem.

@weiweihuanghuang Where you able to find further information?

ampaze commented 1 year ago

It does work for me when not subsetting the custom font. But still: when using freesans it works even when subsetting. So there must be some difference in the way the font definition files were generated?