Convert txt, docx, doc, to pdf using Php

1

I have to make a script in PHP where it will read several files and turn all into PDF. I'm using FPDF but I'm having difficulty logically in having it read each file in my directory and turn it into PDF. Can someone give me a light?

<?php
//require('gerapdf.php');

 $pasta = 'C:\xampp\www\listar\pdf';
 $listar  = new RecursiveDirectoryIterator($pasta);
 $recursivo = new RecursiveIteratorIterator($listar);


 foreach($recursivo as $obj){
     echo '<a href="'.$obj->getPathname().'">'.$obj->getFilename().'</a><br/>';

 }
    
asked by anonymous 17.03.2017 / 20:18

0 answers