At the moment I am using this code to insert text in a PDF:
$pdf = Zend_Pdf::load("test_document.pdf");
$font = Zend_Pdf_Font::fontWithPath('arial_unicode_ms.ttf');
foreach ($pdf->pages as &$page) {
$page->setFont($font, 12);
$page->drawText("Inserted some text.", 200, 10);
}
The problem is, that I want to include this functionality in a Joomla plugin and I don’t want to include all the data from Zend Framework to my project.
Is there any easy way or any small library which provides this pdf tagging mechanism?
If you still want to use
Zend_Pdf, you’ll probably need to have a look at the dependencies in theZend/Pdfdirectory. You cangrepforrequire_onceto have a rough idea, and filter out theZend/Pdfresults:The first step outputs
Zend_Memory,Zend_ExceptionandZend_Log.You can follow a similar method to check additional dependencies, and you’ll see that
Zend_MemoryneedsZend_Cache, which needs onlyZend_Log, which is self-contained, likeZend_Exception. I think you won’t need to go much further, once you have included these four additional libraries.EDIT: I found this link that lists all the dependencies between ZF modules (don’t know how up to date it is, though): http://files.zend.com/help/Zend-Framework/requirements.dependencies.html
Hope that helps,