PHP Classes
elePHPant
Icontem

File: examples/formdata-extraction/example.php

Recommend this page to a friend!
  Classes of Christian Vigh  >  PHP PDF to Text  >  examples/formdata-extraction/example.php  >  Download  
File: examples/formdata-extraction/example.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP PDF to Text
Extract text contents from PDF files
Author: By
Last change: Minor changes
Date: 1 year ago
Size: 578 bytes
 

Contents

Class file image Download
<?php
   
include ( '../../PdfToText.phpclass' ) ;

    if (
php_sapi_name ( ) != 'cli' )
        echo (
"<pre>" ) ;


    echo
"Form data extraction using an XML definition file (sample.pdf) :\n" ;
   
$pdf = new PdfToText ( 'sample.pdf' ) ;

    if (
$pdf -> HasFormData ( ) )
       
var_dump ( $pdf -> GetFormData ( 'sample.xml' ) ) ;

    echo
"\n" ;

    echo
"Form data extraction WITHOUT using an XML definition file :\n" ;
   
$pdf = new PdfToText ( 'sample.pdf' ) ;

    if (
$pdf -> HasFormData ( ) )
       
var_dump ( $pdf -> GetFormData ( ) ) ;

   
$w9 = $pdf -> GetFormData ( ) ;