Convert txt,docx,doc,to pdf using Php

Asked

Viewed 606 times

1

I have to make a script in PHP where it will read several files and turn them all into PDF. I’m using the FPDF but I’m having difficulties in the logic of making it read each file in my directory and turn it into PDF. Someone can 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/>';

 }
  • Hello, welcome. Paste here the code you are using and which error you are having, so it is easier to help. Also read on how to ask good questions: http://answall.com/help/how-to-ask

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.