Jcdevelopment
Jcdevelopment

Reputation: 51

Embedding fonts issue in PDFlib 9

We have just upgraded from 7 to 9 and unfortunately the guy who was running this quit and I am now in charge of this update. I am not too familiar with PDFlib either. From what I see we need to embed fonts because it no longer does this automatically for us. Below is a helper and the call to set a font.

public function setFont($name,$font)
    {

        $this->p->set_parameter("FontOutline", $name."=".Zend_Registry::get('fontPath').$font); 
    }

From what I read you have to set the embed on the load_font() function. Yet I don't see that. Also below is the call we make on the document.

$helper->setFont('MinionPro-Regular','MinionPro-Regular.otf');

Not sure if this helps, but hopefully someone can point me in the right direction. Thanks for any help.

Upvotes: 0

Views: 2890

Answers (1)

Rainer
Rainer

Reputation: 2185

for embedding a font, you should set the embedding option in the load_font() option list. The line above, just do a matching for a font name to a font file. This do not load a font.

Please check your code for a line which

$this->p->load_font($name, "winansi", "");

There you have to add "embedding" to the option list. Unfamiliar with the PDFlib API, please check the PDFlib 9 API Reference for details, which is bundled to your PDFlib 9 package within the doc directory.

see also the answer to your posting on the PDFlib mailing list: https://groups.yahoo.com/neo/groups/pdflib/conversations/messages/22126

Upvotes: 1

Related Questions