I am parsing a pdf file and changing its text:
$parser = new \Smalot\PdfParser\Parser()
$pdf = $parser->parseFile(storage_path().'/contracts/hello.pdf');
// Retrieve all pages from the pdf file.
$pages = $pdf->getPages();
$final = "";
// Loop over each page to extract text.
foreach ($pages as $page) {
$text = $page->getText();
$text = str_replace("\${NAME}","ΜΙΤΣΟΣ",$text);
…
Top comments (1)
I don't know this library, but I would try to do a try catch and see if there are any errors. I tried looking up the library documentation but is pretty limited.