Adding metadata to PDF via PHP

I need to enlarge a PDF file using a custom metadata field when uploading to PHP (5.3).

I was looking at the pdftk library, but I cannot figure out how to get the PHP interface with it on our (Ubuntu) web server.

The obsolete PDFInfo library looks like a dead end.

Is there a simpler / simplified / better solution?

thanks

+4
source share
1 answer

You can use Zend_Pdf . This is from the Zend Framework, but can be used as a separate component. Adding metadata is as simple as:

$pdf = Zend_Pdf::load($pdfPath); $pdf->properties['Title'] = 'New Title.'; $pdf->save($pdfPath); 
+5
source

Source: https://habr.com/ru/post/1313063/


All Articles