I managed to parse a pdf using Smalot\PdfParser but how I can construct it back?

Dimitrios Desyllas - Nov 20 '20 - - Dev Community

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);
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player