Adding metadata to PDF via PHP

后端 未结 1 621
小蘑菇
小蘑菇 2020-12-18 06:21

I need to augment a PDF with a custom metadata field on download in PHP (5.3).

I have been looking at the pdftk library, but I can\'t get my head around how I would

1条回答
  •  猫巷女王i
    2020-12-18 07:22

    You could use Zend_Pdf. It's from the Zend Framework but can be used as a standalone component. Adding metadata is as easy as:

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

    0 讨论(0)
提交回复
热议问题