1

I just installed html2pdf and wrote the code. When it run my code, it gets to the point of running the html2pdf code, and I get this error

Fatal error: Exception thrown without a stack frame in Unknown on line 0

the code is:
require_once('html2pdf/html2pdf.class.php');
$html2pdf = new HTML2PDF('P', 'Letter', 'en');
$html2pdf->pdf->SetTitle('The Philosophies of Adult Education');
$html2pdf->pdf->SetSubject('PAEI');
$html2pdf->pdf->SetKeywords('PAEI, Liberal, Humanistic, Progressive, Radical, Behaviorist');
$html2pdf->pdf->SetDisplayMode('fullpage');
$html2pdf->writeHTML($theData);
$html2pdf->Output($custom_output_file, 'F');

$theData contains the HTML page that is being built, and custom_output_file is the target PDF.

What have I got incorrect?

PHP Version is 5.3.15

Thanks

2

When I tried running this at a command line to see the error, this is what I see:

PHP Fatal error: Uncaught <span style="color: #AA0000; font-weight: bold;">ERROR n°4</span><br>File : /Users/chare/Sites/LabR/apps/paei/html2pdf/_class/parsingHtml.class.php<br>Line : 119<br><br>HTML code invalid, the tags are not closed in an orderly fashion.<br>Status : <pre>Array
(
[0] => page
[1] => div
[2] => p
[3] => p
[4] => p
)
</pre><br><br>HTML : ...quiry&quot;&gt;paei@labr.net.&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/page&gt;...
thrown in /Users/chare/Sites/LabR/apps/paei/html2pdf/_class/parsingHtml.class.php on line 119

Of course, meaningless to me

3

Okay, so I have cleaned up a bunch of HTML errors, and the page validates through the W3C Validator. But, html2pdf still throws this error:

PHP Fatal error: Uncaught <span style="color: #AA0000; font-weight: bold;">ERROR n°1</span><br>File : /Users/chare/Sites/LabR/apps/paei/html2pdf/html2pdf.class.php<br>Line : 1251<br><br>The tag <b>&lt;CENTER&gt;</b> does not yet exist.<br><br>If you want to add it, you must create the methods <b>o_CENTER</b> (for opening) and <b>c_CENTER</b> (for closure) by following the model of existing tags.<br><br>If you create these methods, do not hesitate to send me an email to webmaster@html2pdf.fr to included them in the next version of HTML2PDF.
thrown in /Users/chare/Sites/LabR/apps/paei/html2pdf/html2pdf.class.php on line 1251

I can't figure out which line of the source HTML that html2pdf is the problem. There are no <center> tags in the source html. everything is done using CSS or by parameters in the tag like <td align='center'>

How do I fix this?