Parse error: syntax error, unexpected T_NEW in /home/arcadhes/www/dompdf/include/functions.inc.php on line 240

160 views
Skip to first unread message

Dupont Jean

unread,
Oct 31, 2019, 8:22:23 AM10/31/19
to dompdf
Hello Everyone,

I'm using Dompdf in a test folder "https://www.mysite.com/test2" and all work perfectly but when i put the project in the root of my website, configuration of php is the same, i have this error message : 

Parse error: syntax error, unexpected T_NEW in /home/arcadhes/www/dompdf/include/functions.inc.php on line 240

Line 240 referred to : 

if ( !is_numeric($num) )
  throw new DOMPDF_Exception("dec2roman() requires a numeric argument.");

I use (dompdf - PHP5)

Do you have any idea ? 

Thanks

Julien



Alwin Pacheco

unread,
Oct 31, 2019, 8:58:37 AM10/31/19
to dompdf
Can you post your file?

Dupont Jean

unread,
Oct 31, 2019, 9:08:46 AM10/31/19
to dompdf
<?php session_start();


include('connexion/connexion-adhesion.php');

require_once("dompdf/dompdf_config.inc.php");

$html='<html>';
$html.='<head>';
$html.='<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>';
$html.='</head>';
$html.='<body style=background-color:#ffffff;>';
$html.='<table width=100% border=0 style=page-break-after:always;text-align:left;padding:30px;word-wrap:normal;font-size:10px;font-family:Helvetica;>';
$html.='<tr>';
$html.='<td>';
$html.='<center><img src=images/header-cs-v2.jpg style=width:500px;></center>';
$html.='</td>';
$html.='</tr>';
$html.='<tr>';
$html.='<td style=padding-left:10px;font-size:13px;><b><u>INFORMATION xxxx:</u></b>';
$html.='</td>';
$html.='</tr>';



$html.='<center>
<p style=font-size:8px;padding-top:40px;>Association à but non lucratif régie par la loi du 1er juillet 1901<br>
<b>xxxxxxxx</b>&nbsp;&nbsp;- tél xxxxx - fax xxxxx <br><span style="font-size:10px;"><b>3</b></span></p></center';

$html.='</td>';
$html.='</tr>';
$html.='</table>';


$html.='</body>';
$html.='</html>';


}

$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->set_paper('a4','portrait');
$dompdf->render();
$dompdf->stream("CONTRAT.pdf");




header("Location:index.php");
exit;


} else {

header("Location:index.php");
exit;

}

?>
Message has been deleted

Alwin Pacheco

unread,
Oct 31, 2019, 10:03:37 AM10/31/19
to dompdf
Some more questions:
- How do you use dompdf. composer or self install?
- dompdf version? (I don't see that code in line 240)

Check in your html code attributes (they must be wrapped in quotes). I don't know why this worked in another directory but my guess is that the issue is there
Good luck

El jueves, 31 de octubre de 2019, 8:22:23 (UTC-4), Dupont Jean escribió:

Dupont Jean

unread,
Oct 31, 2019, 5:10:53 PM10/31/19
to dompdf
Thanks for your response.

i made a self install.
version is v 1.17

Finally i made a redirection and it's work. I will correct the missing quotes but i can't explain why it's work in a directory and not in the root...mystery !

Thanks

BrianS

unread,
Jan 20, 2020, 4:49:22 PM1/20/20
to dompdf
FYI, the file path here indicates an older version of Dompdf. Recommend you upgrade to the latest release: https://github.com/dompdf/dompdf/releases
Reply all
Reply to author
Forward
0 new messages