PHP Classes

How to Convert DOC to TXT using PHP DOC DOCX PDF to Text Converter: Convert DOCX, DOC, PDF to plain text

Recommend this page to a friend!
  Info   View files Example   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum (18)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 57%Total: 5,817 This week: 2All time: 400 This week: 94Up
Version License PHP version Categories
filetotext 1.0The PHP License5.2PHP 5, Text processing, Conversion
Description 

Author

This class can convert DOCX, DOC, PDF files to plain text.

It can read files in either Microsoft Word DOCX and DOC formats or PDF and parse the files to extract text they contain.

The text extracted from the documents is returned as a plain text string.

Innovation Award
PHP Programming Innovation award nominee
November 2014
Number 3


Prize: One copy of VS.PHP
File formats like Microsoft Word DOC or PDF are used to create documents that may contain text and other types of document elements.

Parsing and extracting the document elements from files in those formats, usually is not a trivial task. However, if you just want to extract the text in the document, simpler approaches may be used.

This class can extract text from PDF document files as well Microsoft Word files, including the older versions that use a binary file format.

Manuel Lemos
Picture of Aditya Sarkar
  Performance   Level  
Name: Aditya Sarkar <contact>
Classes: 2 packages by
Country: India India
Age: 33
All time rank: 48527 in India India
Week rank: 109 Up9 in India India Up
Innovation award
Innovation award
Nominee: 1x

Recommendations

Extract PDF to text and XML
I need to parse a PDF file and convert whole text into XML

What is the best PHP pdf to text class?
pdf to text format in php

What is the best PHP count characters class?
Get number of characters in a uploaded doc, txt, odt, pdf etc

Example

<?php
require("class.filetotext.php");

$docObj = new Filetotext("test.docx");
//$docObj = new Filetotext("test.pdf");
$return = $docObj->convertToText();

var_dump( $return ) ;


  Files folder image Files  
File Role Description
Plain text file class.filetotext.php Class main class file
Plain text file index.php Example example to call

 Version Control Unique User Downloads Download Rankings  
 0%
Total:5,817
This week:2
All time:400
This week:94Up
User Ratings User Comments (6)
 All time
Utility:82%StarStarStarStarStar
Consistency:80%StarStarStarStarStar
Documentation:-
Examples:84%StarStarStarStarStar
Tests:-
Videos:-
Overall:57%StarStarStar
Rank:1568
 
This one was very useful, i managed an email box crawler, inc...
6 years ago (Vincent DECARPIGNY)
62%StarStarStarStar
I need to extract text from PDF.
6 years ago (Erwin Moller)
12%Star
I need to extract text from PDF.
6 years ago (Erwin Moller)
12%Star
Does not work reliably with PDF.
8 years ago (goodbee)
32%StarStar
Very interesting class.
9 years ago (Everton da Rosa)
65%StarStarStarStar
on peut simplifier juste ceci : return $this->{"read_$file_ex...
9 years ago (Yves Marie HAMAYON)
70%StarStarStarStar