I have tried reading the .docx file. I am successful in reading the .docx file. But I have to read .pdf file with PHPWord.
Any idea How can I do it?
I have tried the code
// Read contents
$source = "./example.pdf";
$phpWord = \PhpOffice\PhpWord\IOFactory::load($source, 'Word2007');
$data = '';
$section = $phpWord->addSection();
$section->addText($data);
$name = "officefile";
$source = __DIR__ . "/results/{$name}.html";
// Saving the document as HTML file...
$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'HTML');
$objWriter->save($source);