PHP Classes
elePHPant
Icontem

PDF data is not in readable format

Recommend this page to a friend!

      PHP PDF to Text  >  PHP PDF to Text package blog  >  How Can PHP Read PDF ...  >  All threads  >  PDF data is not in readable format  >  (Un) Subscribe thread alerts  
Subject:PDF data is not in readable format
Summary:1
Messages:1
Author:Vipin Saini
Date:2019-05-16 05:22:11
 

  1. PDF data is not in readable format   Reply   Report abuse  
Vipin Saini - 2019-05-16 05:22:11
Hi

Christian Vigh,

I hope you are doing well!

First of all thanks for this library and it is indeed very helpful if it works for me like it works for others.

Let me show you, what i am up to.

function output ( $message )
{
if ( php_sapi_name ( ) == 'cli' )
echo ( $message ) ;
else
echo ( nl2br ( $message ) ) ;
}

$file = 'sample' ;
$pdf = new PdfToText ( "$file.pdf" ) ;

output ( "Original file contents :\n" ) ;
output ( file_get_contents ( "$file.txt" ) ) ;
output ( "-----------------------------------------------------------\n" ) ;

output ( "Extracted file contents :\n" ) ;
output ( $pdf -> Text ) ;



I am using above code to read my PDF file. Unfortunately, every time i get non readable data therefore i request you to help to figure it out.

Thanks!