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   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 56%Total: 5,832 This week: 1All time: 399 This week: 41Up
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: 34
All time rank: 48127 in India India
Week rank: 47 Up7 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 (2)  
File Role Description
Plain text file class.filetotext.php Class main class file
Plain text file index.php Example example to call

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:5,832
This week:1
All time:399
This week:41Up
User Ratings User Comments (6)
 All time
Utility:80%StarStarStarStarStar
Consistency:78%StarStarStarStar
Documentation:-
Examples:82%StarStarStarStarStar
Tests:-
Videos:-
Overall:56%StarStarStar
Rank:1852
 
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.
7 years ago (Erwin Moller)
12%Star
I need to extract text from PDF.
7 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