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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.