0

Is there a way to attach audio/video files to PDF files using php? The only option I could find was itext which is written in Java.

iconte
  • 31
  • 3

1 Answers1

0

You pretend play audio or video inside PDF? or you want to insert a external link?

For external link, I use https://github.com/mpdf/mpdf

Installation: $ composer require mpdf/mpdf

Example:

$mpdf = new \Mpdf\Mpdf();
$mpdf->WriteHTML('<h1>Hello world!</h1>');

$mpdf->WriteHTML('<a href="http://hcmaslov.d-real.sci-nnov.ru/public/mp3/Queen/Queen%20\'Another%20One%20Bites%20The%20Dust\'.mp3">Play the song</a>');

$mpdf->Output();

Screenshot: PDF generated with mpdf library with external link

Screenshot: Playing the song after clic on the external link

  • It would be great if I could have an embedded player for mp3/video files. It's enough to add links to files that can open it on external applications – iconte Jul 24 '18 at 13:11