PHP code example of ottosmops / pdftotext

1. Go to this page and download the library: Download ottosmops/pdftotext library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ottosmops / pdftotext example snippets


  \Ottosmops\Pdftotext\Extract::getText('/path/to/file.pdf') //returns the text from the pdf

$text = (new Extract())
    ->pdf('file.pdf')
    ->text();

$text = (new Extract('/path/to/pdftotext'))
    ->pdf('path/to/file.pdf')
    ->options('-layout')
    ->text();
which pdftotext