-1

I want to read pdf file in php and store the content in the variable without installing anything.

I am able to read doc file and .txt file but i am getting some special characters when i read pdf file.

Andrew Barber
  • 39,603
  • 20
  • 94
  • 123
  • 1
    simply write "read pdf using php" in google.You can find first 3 links of SO by which you can eaisly read the pdf.Please read the [faq](http://stackoverflow.com/faq) as well because you get know that which and How can you ask questions here – Freak Mar 15 '13 at 04:03

2 Answers2

1

You can read about useful information in reading PDF in PHP in following Links -

1: http://webcheatsheet.com/php/reading_clean_text_from_pdf.php

2: Read pdf files with php

Hope this will help you.

Community
  • 1
  • 1
Piyas De
  • 1,786
  • 15
  • 27
0

you can use fpdf as well as FPDI for this purpose
Here is the sample code of FPDI which you can find on their website as well as further support

<?php
require_once('fpdf.php');
require_once('fpdi.php');

$pdf = new FPDI();

$pagecount = $pdf->setSourceFile('TestDoc.pdf');
$tplidx = $pdf->importPage(1, '/MediaBox');

$pdf->addPage();
$pdf->useTemplate($tplidx, 10, 10, 90);

$pdf->Output('newpdf.pdf', 'D');>
//further user code

You can also get some help from this blog

Freak
  • 6,786
  • 5
  • 36
  • 54