PHP Classes

Searching a text inside a pdf: I need to search a text inside a pdf/A document

Recommend this page to a friend!
  All requests RSS feed  >  Searching a text inside a pdf  >  Request new recommendation  >  A request is featured when there is no good recommended package on the site when it is posted. Featured requests  >  No recommendations No recommendations  

Searching a text inside a pdf

Edit

Picture of Pietro by Pietro - 5 months ago (2024-08-16)

I need to search a text inside a pdf/A document

This request is clear and relevant.
This request is not clear or is not relevant.

+1

good afternoon, I need to search a text inside a pdf/A document, have you got a class for me? Thank you Bye

  • 1 Clarification request
  • 1. Picture of ASCOOS CMS by ASCOOS CMS - 3 months ago (2024-10-14) Reply

    You can use the ready-made PDFParser library that you will find here: github.com/smalot/pdfparser

    An example using it I give you bellow:

    require_once 'vendor/autoload.php';

    use Smalot\PdfParser\Parser;

    $parser = new Parser(); $pdf = $parser->parseFile('example.pdf'); $text = $pdf->getText();

    $searchText = "Hello World !!";

    if (strpos($text, $searchText) !== false) {

    echo "Text found: " . $searchText . "<br>";
    

    } else {

    echo "Text not found.";
    

    }

    Ask clarification

    Recommend package
    : 
    :