PHP Classes

Form extraction

Recommend this page to a friend!

      PHP PDF to Text  >  All threads  >  Form extraction  >  (Un) Subscribe thread alerts  
Subject:Form extraction
Summary:PHP Fatal error
Messages:5
Author:Clive Brett
Date:2017-08-08 10:03:07
 

  1. Form extraction   Reply   Report abuse  
Picture of Clive Brett Clive Brett - 2017-08-08 10:03:07
I have set up the PdfToText.phpclass class and have installed the Maps directory
I am trying to read the sample.pdf without an XML definition file using a modified example file.
I am running php 5.6

<?php
$pdfDir=dirname(__FILE__).'/core4/pdf/';

if(file_exists( $pdfDir . 'PdfToText.phpclass' )){
include ( $pdfDir . 'PdfToText.phpclass' ) ;
}
if(file_exists( $pdfDir . 'sample.pdf' )){
$pdf = new PdfToText ($pdfDir . 'sample.pdf' ) ;
}
if ( $pdf -> HasFormData ( ) ){
print "Has form data\n";
var_dump ( $pdf -> GetFormData ( ) ) ;
}

I am getting a fatal error of
Call to undefined method PdfToTextFormDefinition::ValidatePhpName() in /home/ccllweb/public_html/core4/pdf/PdfToText.phpclass on line 10873

Your help would be appreciated

  2. Re: Form extraction   Reply   Report abuse  
Picture of Clive Brett Clive Brett - 2017-08-09 13:48:09 - In reply to message 1 from Clive Brett
I tried removing the validation clause to pass over the error.
Each time I did so, I got other errors including
Call to protected method PdfToTextFormDefinition::GetFormDataFromPdfObject()

I've given up until a solution reply is posted.


  3. Re: Form extraction   Reply   Report abuse  
Picture of Carl Spooner Carl Spooner - 2017-09-12 14:32:02 - In reply to message 2 from Clive Brett
Same here, need to use the form pdf extration and have the same error.

Using PHP 5.6

  4. Re: Form extraction   Reply   Report abuse  
Picture of Carl Spooner Carl Spooner - 2017-09-12 14:51:36 - In reply to message 3 from Carl Spooner
Seems that some function / method was not at it's place. Fix it with this pastebin

pastebin.com/ycGJbB7K

Hope it helps

  5. Re: Form extraction   Reply   Report abuse  
Picture of Dave Ferns Dave Ferns - 2018-04-13 17:50:52 - In reply to message 1 from Clive Brett
Hi there,

Can you tell me what kind of pdf files can be used for this ?
I have tried all types of PDF's with fillable form fields and it isnt detecting a single field or form.

Thanks
Dave