Web Hosting Talk







View Full Version : Custom font in a Pdf created with PHP


ruffzy
02-14-2008, 08:07 AM
Hi Guys out there

It would be great if there is a php crack for my problem:

I try to load a custom font from a font-file on the server and using it in the created PDF-file. Unfortunately there is NO error-message, but the pdf does also not show the text in the desired font. Instead it uses some other ugly font.

This is my code:

pdf_set_parameter($pdfdoc, "FontOutline", "Chancur==chancur.ttf");
$font = PDF_load_font($pdfdoc, "Chancur", "iso8859-1", "");
pdf_setfont($pdfdoc, $font, 20);
pdf_fit_textline($pdfdoc, "Hello World", 100, 100, "");

Because the pdf-creation works without a problem, I don't think that the code has a mistake. But I have no idea where else I can search for a solution.

Attached to this post an example of the created pdf file.

thanks for any ideas!