只有几页的PDF可以正常工作,但是当我尝试生成多于20页的PDF文件时,它会在浏览器中显示此错误
这是我生成pdf的代码:
$html = '
<style>
* { font-family: Tahoma, Verdana, Segoe, sans-serif; color: #333333; font-size: 9px;}
</style>
<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#333333">
<tr>
<td height="70" bgcolor="#ffffff" colspan="7" align="center" valign="middle"><b style="font-size: 18px;">RELATÓRIO DE FECHAMENTO - Nº '.$id.'</b><br><b>Data do pagamento: '.date('d/m/Y', strtotime($objDados[$idx]->dtpagamento)).'</b></td>
<td bgcolor="#ffffff" align="center" width="130"><img src="data:image/gif;base64,R0lGODlhhQAwAPcAAAAAAP////7+//r7/e7y+Pb4+wZElD5urEp3sU56s1qDuGqPv3aYxHqbxoOiyoaky4qnzZKt0Jaw0p621aa82a7C3LLF3rbI4MLR5cvY6dLd7Nrj7+ft9erv9gBAkQFBkQJBkgdFlAhGlApHlQtIlgxJlg1Klw9LlxBMmBZQmhhSmxtUnRxVnR9XniBYnyFZnyNaoCRboSddoipfoytgpCxhpC9jpTBkpjFlpjVoqDdpqThqqTprqjtsqj9vrEBwrUJxrUNyrkV0r0RzrkZ0r0d1sE97s1F9tFJ9tFWAtlaAtleBt1iCt1mDt1yFuWCIumKJu2WMvWuQv2yRwG6SwHOWw3KVwnSXw3mbxXucxn+fyH6ex4SjyoWkyoimzIely4ypzY+rz46qzpGt0JOu0JSv0Ziy05mz05qz05u01J221Zy11KC41qG51qS72KO616e92ai+2aq/2q3C3LDE3bHF3bXI37fJ4LnL4bzN4sHR5MXU5sfV58bU5snX6MjW59Dc68/b6tTf7Nnj79ji7uDo8uPq8+Lp8uvw9s3a6d3m8OXs9Onv9uju9e3y9/T3+vj6/Pv8/f7+/v39/fz8/Pv7+/r6+vn5+fj4+Pf39/X19fPz8/Ly8vHx8fDw8O/v7+7u7u3t7ezs7Ovr6+rq6unp6efn5+bm5uXl5eTk5OPj4+Li4uHh4eDg4N/f397e3t3d3dra2tnZ2djY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ByrhpAq/xMY5Bl+MBCUDe/CVROVasUJE9VoAw74kBfzOXlQIWAJoCZHnyACEL3IUDQFmKZ4C0/bA4ULj/jClRunVTNc5Bl6xTES1XVBHDJkfxoXBA3Vdmi75UDJTEXGGqssYYaWczVRQCKzJVDQvfNQRAcDT8csUATVxzAxaxS1fG6gxU0S1XcBBBKVecYBCxVvqzM6EA9cEYXAwHwMZcSPM+FBkFvBH2QnEMHMLFz5KqKMT/CFtRaQbJUReUoexr/1ExVvWjd6A5zbUbXBx+MYEEAGMy1RNliOTZQG2obxHZB1hhI0DByJ033xlSlU1AuVUkTgCdV/UlQNlXNIvhAQMzlx22yESBQBnMdALkHkgtEuQcOr22qxFW5O9A3nZ/7Fuj81KMJQTxSRUwAk9BTlScFvVPVJq8LFMVc/yHUwVwhQIIwaJNXXtDlBDGD5EDXnGVuq3UTZNllUgXAylmoCIQyVdogCDGopqh9CSRtYvGBQQRwMIFsSSw4GsgToBWA+/QuAL8LnuWGJ5C8Ue0a96PK/JbHtKrg4xlXo4o6BrK/qnhjF7mIX/IIQqyBFIAEcwmCHP7Qhzk0gAU4GAgC/8VyAC5gAQYeWEG1LphBhLiPKswoiCQalBZ0aI8fshjIFVVHkAbtQx1+gZtAChQZaCCkBeAjyAW85gEUEIQHnJmBQMAwFwkQZAJiKQFCgESVZhgEFII6izMkUZUsCoRk+TiIPqgCC9KdJR+5MIgyFokWexQjIScw4EDq8ALONIAgAjjCYVRgB4H0SywRIEga5oIQTvziGL/gxEEqQQxscOMZPgrALYzhi0sMBDvFMB7ejBEMwJiiGdvIBjJkeZBNBIMaP5FGLzIBHzB4oQKROMgcqtAEJCjACmw4xEH20AAFKGEKbhjAQBohgQecoYECcQQaunBBodjznvjMpz73yRnPfvrznwANqEAHStCCGvSgCE2oQhf6z4AAADs=" border="0"></td>
</tr>
<tr>
<td height="30" bgcolor="#ffffff" colspan="8" align="center" valign="middle" colspan="2"><b style="font-size: 16px;">DETALHADO</b></td>
</tr>
<tr style="color: #ffffff !important;">
<td bgcolor="#1369a1" width="45" height="20"><b>DATA</b></td>
<td bgcolor="#1369a1"><b>TIPO</b></td>
<td bgcolor="#1369a1" width="30"><b>CHAPA</b></td>
<td bgcolor="#1369a1" width="150"><b>NOME</b></td>
<td bgcolor="#1369a1"><b>BANCO</b></td>
<td bgcolor="#1369a1" width="45"><b>AGENCIA</b></td>
<td bgcolor="#1369a1" width="45"><b>CONTA</b></td>
<td bgcolor="#1369a1"><b>VALOR em R$</b></td>
</tr>
'.$lista_individual.'
</table>
<br>
<br>
<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#333333">
<tr>
<td bgcolor="#ffffff" height="30" colspan="3" align="center"><b style="font-size: 16px;">SUBTOTAL</b></td>
</tr>
<tr style="color: #ffffff !important;">
<td bgcolor="#1369a1" width="45" height="20"><b>CHAPA</b></td>
<td bgcolor="#1369a1"><b>NOME</b></td>
<td bgcolor="#1369a1" width="130"><b>SUBTOTAL em R$</b></td>
</tr>
'.$lista_subtotal.'
<tr>
<td bgcolor="#c8e5f7" colspan="2" align="center" height="20"><b style="font-size: 16px;">TOTAL</b></td>
<td bgcolor="#c8e5f7" width="130"><b>'.number_format($lista_total,2,',','.').'</b></td>
</tr>
</table>
<br>
<br>
<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#333333">
<tr>
<td bgcolor="#1369a1" width="50%" height="20" align="center" style="color: white; font-size: 12px;">TOTAL BANCO SANTANDER - 033</td>
<td bgcolor="#1369a1" width="50%" align="center" style="color: white; font-size: 12px;">TOTAL OUTROS BANCOS</td>
</tr>
<tr>
<td bgcolor="#ffffff" height="20" align="center" ><b>'.number_format($tot_santander, 2 , ',', '.').'</b></td>
<td bgcolor="#ffffff" align="center"><b>'.number_format($tot_qualquerbanco, 2 , ',', '.').'</b></td>
</tr>
</table>
';
$dompdf->load_html(utf8_encode($html));
$dompdf->render();
$dompdf->stream(
"saida.pdf",
array(
"Attachment" => false
)
);
有没有一种方法可以优化时间?几页PDF可以正常工作,但在多页PDF中,DOMPDF在浏览器中返回此错误...
我正在尝试在整个Internet上寻找解决方案,但是没有一个有效。我尝试增加set_time_limit
,但还是没有用。