PHP Classes

My PDF to Text: Parse a PDF document to extract the text contents

Recommend this page to a friend!
  Info   View files Example   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-02-08 (3 months ago) RSS 2.0 feedNot enough user ratingsTotal: 127 This week: 2All time: 9,399 This week: 34Up
Version License PHP version Categories
pdf-my-text 1.0.0MIT/X Consortium ...5PHP 5, Files and Folders, Text proces..., D..., P...
Description 

Author

This class can parse a PDF document to extract the text contents.

It can take the file name of a PDF document as a parameter and parses the document file.

The class can extract the document's text and return it as a string.

This class convert PDF file to raw text which can be saved as .txt/.doc/.whatever or can be copied and pasted to anywhere.

Picture of The Algoslingers
  Performance   Level  
Name: The Algoslingers is available for providing paid consulting. Contact The Algoslingers .
Classes: 5 packages by
Country: Ghana Ghana
Age: ???
All time rank: 40255 in Ghana Ghana
Week rank: 30 Up1 in Ghana Ghana Up
Innovation award
Innovation award
Nominee: 1x

Recommendations

want to display a pdf file
want to display a pdf file in a web page

Instructions

Download and add the PDFMyText class to your project.

Call the PDFMyText() class or see the index.php file for example usage.

Example

<?php
require('class.pdfmytext.php');

extract($_POST);
 

if(isset(
$readpdf)){

    

    if(
$_FILES['file']['type']=="application/pdf") {

       
$a = new PDFMyText();

       
$a->setFilename($_FILES['file']['tmp_name']);

       
$a->decodePDF();

        echo
$a->output()."<br>";

    }

     
    else {

        echo
"<p style='color:red; text-align:center'>

            Wrong file format</p>
"
;

    }
}
?>
<!doctype html>
<html>
  <head>
    <meta name="viewport" content="width=device-width"/>
    <title>PDF to TEXT < By @TheAlgoslingers</title>
  </head>
  <body style="text-align:center;padding:15px">
    <form method="post" enctype="multipart/form-data">
      <input type="file" name="file" />
      <br><br>
      <input type="submit" name="readpdf" value="Convert"/>
    </form>
  </body>
</html>


  Files folder image Files  
File Role Description
Plain text file class.pdfmytext.php Class Main class file
Accessible without login Plain text file index.php Example Example file

 Version Control Unique User Downloads Download Rankings  
 0%
Total:127
This week:2
All time:9,399
This week:34Up