Jump to content

Custom font in a Pdf created with PHP


ruffzy

Recommended Posts

Hi Guys out there

 

Would be great if a php crack could find a solution:

 

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. How can i use my desired 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.

 

This is an example of the created pdf-file: http://www.video-auf-dvd.ch/Ugly_Font.pdf

 

thanks for any help!

Link to comment
https://forums.phpfreaks.com/topic/91059-custom-font-in-a-pdf-created-with-php/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.