The symptoms were:
- An error on my computer "Cannot extract the embedded font" when printing.
- A customer got a strange error and couldn't print the PDF at all (I can't find the error message sorry).
- When viewing on the iPhone, parts of the document were missing.
We'd created the font files by going straight from the font in C:\Windows\Fonts using the instructions at http://www.tcpdf.org/fonts.php (.ufm files), so for TTF Unicode.
The solution was:
- Install this: http://ttf2pt1.sourceforge.net/ in Ubuntu it's as easy as apt-get install ttf2pt1
- Copy the windows ttf files to the linux box, change the filenames to all lower case and no spaces.
- Go to the tcpdf/fonts/utils directory.
- Put your lower case ttf files here.
- Run ttf2pt1 yourfontfile.ttf
- php makefont.php yourfontfile.ttf yourfontfile.afm
- cp yourfontfile.php ..
- cp yourfontfile.z ..
- DONE!
This changes it to an ANSI ttf instead of a CID one. You can check out the fonts in the PDF document by opening a document and going File>Properties>Fonts. If you see the embedded fonts as anything other than True Type ansi, you've got a problem, try the steps again!
Now the files work perfectly on iPhone, and for printing. Problem solved.
Hi have a converter for the converting from ttf and otf fonts for tcpdf
ReplyDeletehttp://fonts.snm-portal.com/
I didn't test it out, but that looks great.
ReplyDeleteThe converter works perfect!
ReplyDeleteThe Windows process not work like Linux.
Thanks at all!
Thank you! This post saved me a lot of time!!
ReplyDeleteThanks for reading :-D
Delete