我从dompdf 0.5更新到0.6 b3,以便更好地支持我想要的一些CSS 在应用程序中生成PDF时使用。
在旧的代码版本中,我当前的页面生成工作正常 - 一个表跨越多个页面没有问题。
但是在新版本中,一旦代码尝试生成PDF,其中一个表跨越到另一个页面,DOMPDF就会挂起。
我的错误日志给了我
PHP Fatal error: Maximum execution time of 60 seconds exceeded in
../sfDomPDFPlugin/lib/dompdf/include/frame.cls.php on line 374...
我认为这是一个CSS规则,但我不清楚它可能是什么。建议?
更新:这是一些失败的示例代码。我不得不削减一点, 但它包含了所有相关标签。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>PDF</title>
<style type="text/css">
body
{
font-family: Helvetica, Arial, sans-serif;
background-image: url('/images/draft_watermark_small.png');
}
th {
font-size: 8pt;
}
#sf_admin_container ul, #sf_admin_container ol, #sf_admin_container li, #sf_admin_container h1, #sf_admin_container h2, #sf_admin_container h3, #sf_admin_container h4, #sf_admin_container h5, #sf_admin_container h6, #sf_admin_container pre, #sf_admin_container form, #sf_admin_container body, #sf_admin_container html, #sf_admin_container p, #sf_admin_container blockquote, #sf_admin_container fieldset, #sf_admin_container input { margin: 0; padding: 0; }
#sf_admin_container a img,:link img,:visited img { border: none; }
#sf_admin_container td
{
margin: 0;
font-family: Helvetica, Arial, sans-serif;
font-size: 8px;
background-color: #fff;
padding: 2px;
}
#sf_admin_container p
{
margin-bottom: 5px;
}
#sf_admin_container h1
{
margin: 2px 0pt;
padding: 3px;
padding-left: 0px;
color: #555;
font-family: Helvetica, Arial, Verdana, sans-serif;
font-size: 22px;
}
#sf_admin_container .sf_admin_default_action
{
background-color: #fc6 !important;
font-weight: bold !important;
}
#sf_admin_container .sf_admin_list
{
width: 100%;
border: 1px solid #000;
border-bottom: 1px;
border-right: 1px;
border-collapse: collapse;
}
#sf_admin_container .sf_admin_list th
{
color: #fff;
padding: 2px;
background-color: #900;
text-align: left;
}
#sf_admin_container .sf_admin_list th a
{
color: #333;
}
#sf_admin_container .sf_admin_list td
{
padding: 2px;
border-bottom: 1px solid #000;
border-right: 1px solid #000;
}
#sf_admin_container .sf_admin_filters li
{
list-style-type: none;
}
#sf_admin_container .sf_admin_row_0 td
{
background-color: #eee;
}
#sf_admin_container .sf_admin_row_1 td
{
border-bottom: 1px solid #FFF;
background-color: #EEF;
}
#sf_admin_container .sf_admin_row_2 td
{
}
#sf_admin_container .sf_admin_row_total td
{
border: 2px solid #000;
}
#sf_admin_container #heading
{
color: #fff;
background-color: #900;
padding: 3px;
font-size: 14pt;
font-weight: bold;
text-align: center;
}
#sf_admin_container #heading-bold
{
font-weight: bold;
}
#sf_admin_container #heading-total
{
color: #fff;
padding: 2px;
background-color: #900;
text-align: left;
}
div.wysiwyg-view h1
{
font-size: 2em; margin: .67em 0;
background-color: transparent !important;
color: #000 !important;
}
div.wysiwyg-view h2
{
font-size: 1.5em; margin: .75em 0;
background-color: transparent !important;
color: #000 !important;
}
div.wysiwyg-view h3
{
font-size: 1.17em; margin: .83em 0;
background-color: transparent !important;
color: #000 !important;
}
div.wysiwyg-view ol, ul, dir,
menu, dd { margin-left: 40px !important;}
div.wysiwyg-view ol { list-style-type: decimal !important; }
div.wysiwyg-view ol ul, ul ol,
ul ul, ol ol { margin-top: 0; margin-bottom: 0; }
div.wysiwyg-view blockquote { margin-left: 40px !important; margin-right: 40px !important;}
#watermark { position: fixed; bottom: 0px; right: 0px; width: 200px; height: 200px; opacity: .5; }
</style>
</head>
<body>
<div id="sf_admin_container">
<table width="100%">
<tbody>
<tr>
<td>
<img width="500" src="https://test-quote.expedient.com/images/expedient-logo-010313.png">
</td>
<td width="40%" style="border: 1px solid #000;vertical-align: top;padding: 0px;">
<div id="heading" style="font-size: 14pt;vertical-align: top;"> Quotation # 40414 </div>
<br>
<div style="left: 2px;position: relative;">
1050 Hull Street
<br>
Baltimore, MD 21230
<br>
Phone: 410-209-6700
<br>
www.datapointinc.com
<br>
<br>
Date: 03/14/13
</div>
</td>
</tr>
<tr>
<td colspan="2">
<table class="sf_admin_list" width="100%">
<tbody>
<tr>
<td id="heading" width="100%" colspan="6">
<b>Sample Quote</b>
</td>
</tr>
<tr>
<td id="heading-bold" width="40%">
<center> QUOTED FOR </center>
</td>
<td id="heading-bold" width="12%">
<center> SALES REP </center>
</td>
<td id="heading-bold" width="12%">
<center> SALES ENGINEER </center>
</td>
<td id="heading-bold" width="12%">
<center> CONTRACT TERM </center>
</td>
<td id="heading-bold" width="12%">
<center> TERMS </center>
</td>
<td id="heading-bold" width="12%">
<center> EST. DELIVERY </center>
</td>
</tr>
<tr>
<td>
<center> CeraTech (Kim Shumaker) </center>
</td>
<td>
<center> Geoffrey Maddock </center>
</td>
<td>
<center> Brian Willis </center>
</td>
<td>
<center> 36 Months</center>
</td>
<td>
<center> Net 30</center>
</td>
<td>
<center> 3.00 weeks </center>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<table class="sf_admin_list">
<tbody>
<tr>
<th style="width: 1em;">
<center>SKU</center>
</th>
<th style="width: 1em;">
<center>Type</center>
</th>
<th style="width: 1em;">
<center>Quantity</center>
</th>
<th>Name</th>
<th style="width: 4em;">
<center>Unit</center>
</th>
<th style="width: 4em;">
<center>One Time Costs</center>
</th>
<th style="width: 4em;">
<center>Monthly Recurring Cost</center>
</th>
</tr>
<tr>
<td id="topmenu" style="background-color: #ccc;text-align:center;" colspan="7">Cleveland (151)</td>
</tr>
<tr>
<td id="submenu" style="background-color: #ddd;text-align:center;" colspan="7">Managed Virtualization</td>
</tr>
<tr class="sf_admin_row_1">
<td width="25px">
<div style="text-align: center;"> 1 </div>
</td>
<td width="25px">
<div style="text-align: center;"> New </div>
</td>
<td width="25px">
<div style="text-align: center;"> 1 </div>
</td>
<td>
<div>
<b>Enterprise Virtual Instance - Level 1</b>
</div>
</td>
<td width="50px" style="text-align: right;">
<div id="lineitem_sale_unit_396047">
<b>0.00</b>
</div>
</td>
<td width="50px" style="text-align: right;">
<div id="lineitem_nrp_total_396047">
<b></b>
</div>
</td>
<td width="50px" style="text-align: right;">
<div id="lineitem_mrp_total_396047">
<b>0.00</b>
</div>
</td>
</tr>
<tr class="sf_admin_row_2">
<td width="25px"> </td>
<td width="25px"> </td>
<td width="25px"> </td>
<td>
<div id="lineitem_detail_396047" style="color:#333; text-indent: 10px;"> 1Ghz Peak, .5Ghz Average CPU; 1GB RAM</div>
</td>
<td width="50px"> </td>
<td width="50px"> </td>
<td width="50px"> </td>
</tr>
<tr class="sf_admin_row_1">
<td width="25px">
<div style="text-align: center;"> 1 </div>
</td>
<td width="25px">
<div style="text-align: center;"> New </div>
</td>
<td width="25px">
<div style="text-align: center;"> 1 </div>
</td>
<td>
<div>
<b>Enterprise Virtual Instance - Level 1</b>
</div>
</td>
<td width="50px" style="text-align: right;">
<div id="lineitem_sale_unit_396051">
<b>0.00</b>
</div>
</td>
<td width="50px" style="text-align: right;">
<div id="lineitem_nrp_total_396051">
<b></b>
</div>
</td>
<td width="50px" style="text-align: right;">
<div id="lineitem_mrp_total_396051">
<b>0.00</b>
</div>
</td>
</tr>
<tr class="sf_admin_row_2">
<td width="25px"> </td>
<td width="25px"> </td>
<td width="25px"> </td>
<td>
<div id="lineitem_detail_396051" style="color:#333; text-indent: 10px;"> 1Ghz Peak, .5Ghz Average CPU; 1GB RAM</div>
</td>
<td width="50px"> </td>
<td width="50px"> </td>
<td width="50px"> </td>
</tr>
<tr class="sf_admin_row_1">
<td width="25px">
<div style="text-align: center;"> 2 </div>
</td>
<td width="25px">
<div style="text-align: center;"> New </div>
</td>
<td width="25px">
<div style="text-align: center;"> 1 </div>
</td>
<td>
<div>
<b>Enterprise Virtual Instance Level 1 - Installation</b>
</div>
</td>
<td width="50px" style="text-align: right;">
<div id="lineitem_sale_unit_396048">
<b>0.00</b>
</div>
</td>
<td width="50px" style="text-align: right;">
<div id="lineitem_nrp_total_396048">
<b>0.00</b>
</div>
</td>
<td width="50px" style="text-align: right;">
<div id="lineitem_mrp_total_396048">
<b> </b>
</div>
</td>
</tr>
<tr class="sf_admin_row_2">
<td width="25px"> </td>
<td width="25px"> </td>
<td width="25px"> </td>
<td>
<div id="lineitem_detail_396048" style="color:#333; text-indent: 10px;"> Per Virtual Instance. Setup and Configuration of Virtual Instance(2 Hours Maximum)</div>
</td>
<td width="50px"> </td>
<td width="50px"> </td>
<td width="50px"> </td>
</tr>
<tr class="sf_admin_row_1">
<td width="25px">
<div style="text-align: center;"> 2 </div>
</td>
<td width="25px">
<div style="text-align: center;"> New </div>
</td>
<td width="25px">
<div style="text-align: center;"> 1 </div>
</td>
<td>
<div>
<b>Enterprise Virtual Instance Level 1 - Installation</b>
</div>
</td>
<td width="50px" style="text-align: right;">
<div id="lineitem_sale_unit_396049">
<b>0.00</b>
</div>
</td>
<td width="50px" style="text-align: right;">
<div id="lineitem_nrp_total_396049">
<b>0.00</b>
</div>
</td>
<td width="50px" style="text-align: right;">
<div id="lineitem_mrp_total_396049">
<b> </b>
</div>
</td>
</tr>
<tr class="sf_admin_row_2">
<td width="25px"> </td>
<td width="25px"> </td>
<td width="25px"> </td>
<td>
<div id="lineitem_detail_396049" style="color:#333; text-indent: 10px;"> Per Virtual Instance. Setup and Configuration of Virtual Instance(2 Hours Maximum)</div>
</td>
<td width="50px"> </td>
<td width="50px"> </td>
<td width="50px"> </td>
</tr>
<tr class="sf_admin_row_1">
<td width="25px">
<div style="text-align: center;"> 4 </div>
</td>
<td width="25px">
<div style="text-align: center;"> New </div>
</td>
<td width="25px">
<div style="text-align: center;"> 1 </div>
</td>
<td>
<div>
<b>Enterprise Virtual Instance Level 2 - Installation</b>
</div>
</td>
<td width="50px" style="text-align: right;">
<div id="lineitem_sale_unit_396050">
<b>0.00</b>
</div>
</td>
<td width="50px" style="text-align: right;">
<div id="lineitem_nrp_total_396050">
<b>0.00</b>
</div>
</td>
<td width="50px" style="text-align: right;">
<div id="lineitem_mrp_total_396050">
<b> </b>
</div>
</td>
</tr>
<tr class="sf_admin_row_2">
<td width="25px"> </td>
<td width="25px"> </td>
<td width="25px"> </td>
<td>
<div id="lineitem_detail_396050" style="color:#333; text-indent: 10px;"> Per Virtual Instance. Setup and Configuration of Virtual Instance(2 Hours Maximum)</div>
</td>
<td width="50px"> </td>
<td width="50px"> </td>
<td width="50px"> </td>
</tr>
<tr class="sf_admin_row_1">
<td width="25px">
<div style="text-align: center;"> 5 </div>
</td>
<td width="25px">
<div style="text-align: center;"> New </div>
</td>
<td width="25px">
<div style="text-align: center;"> 1 </div>
</td>
<td>
<div>
<b>Enterprise Virtual Instance - Level 3</b>
</div>
</td>
<td width="50px" style="text-align: right;">
<div id="lineitem_sale_unit_396052">
<b>0.00</b>
</div>
</td>
<td width="50px" style="text-align: right;">
<div id="lineitem_nrp_total_396052">
<b></b>
</div>
</td>
<td width="50px" style="text-align: right;">
<div id="lineitem_mrp_total_396052">
<b>0.00</b>
</div>
</td>
</tr>
<tr class="sf_admin_row_2">
<td width="25px"> </td>
<td width="25px"> </td>
<td width="25px"> </td>
<td>
<div id="lineitem_detail_396052" style="color:#333; text-indent: 10px;"> 3Ghz Peak, 1.5Ghz Average CPU; 3GB RAM</div>
</td>
<td width="50px"> </td>
<td width="50px"> </td>
<td width="50px"> </td>
</tr>
<tr>
<td id="topmenu" style="background-color: #ccc;text-align:center;" colspan="7">Baltimore - 1050 Hull St.</td>
</tr>
<tr>
<td id="submenu" style="background-color: #ddd;text-align:center;" colspan="7">Managed Virtualization</td>
</tr>
<tr class="sf_admin_row_1">
<td width="25px">
<div style="text-align: center;"> 7 </div>
</td>
<td width="25px">
<div style="text-align: center;"> New </div>
</td>
<td width="25px">
<div style="text-align: center;"> 1 </div>
</td>
<td>
<div>
<b>Enterprise Virtual Instance - Level 4</b>
</div>
</td>
<td width="50px" style="text-align: right;">
<div id="lineitem_sale_unit_396024">
<b>0.00</b>
</div>
</td>
<td width="50px" style="text-align: right;">
<div id="lineitem_nrp_total_396024">
<b></b>
</div>
</td>
<td width="50px" style="text-align: right;">
<div id="lineitem_mrp_total_396024">
<b>0.00</b>
</div>
</td>
</tr>
<tr class="sf_admin_row_2">
<td width="25px"> </td>
<td width="25px"> </td>
<td width="25px"> </td>
<td>
<div id="lineitem_detail_396024" style="color:#333; text-indent: 10px;"> 4Ghz Peak, 2Ghz Average CPU; 4GB RAM (File)</div>
</td>
<td width="50px"> </td>
<td width="50px"> </td>
<td width="50px"> </td>
</tr>
<tr class="sf_admin_row_1">
<td width="25px">
<div style="text-align: center;"> 8 </div>
</td>
<td width="25px">
<div style="text-align: center;"> New </div>
</td>
<td width="25px">
<div style="text-align: center;"> 1 </div>
</td>
<td>
<div>
<b>Enterprise Virtual Instance Level 4 - Installation</b>
</div>
</td>
<td width="50px" style="text-align: right;">
<div id="lineitem_sale_unit_396025">
<b>0.00</b>
</div>
</td>
<td width="50px" style="text-align: right;">
<div id="lineitem_nrp_total_396025">
<b>0.00</b>
</div>
</td>
<td width="50px" style="text-align: right;">
<div id="lineitem_mrp_total_396025">
<b> </b>
</div>
</td>
</tr>
<tr class="sf_admin_row_2">
<td width="25px"> </td>
<td width="25px"> </td>
<td width="25px"> </td>
<td>
<div id="lineitem_detail_396025" style="color:#333; text-indent: 10px;"> Per Virtual Instance. Setup and Configuration of Virtual Instance(2 Hours Maximum)</div>
</td>
<td width="50px"> </td>
<td width="50px"> </td>
<td width="50px"> </td>
</tr>
<tr class="sf_admin_row_1">
<td width="25px">
<div style="text-align: center;"> 396 </div>
</td>
<td width="25px">
<div style="text-align: center;"> New </div>
</td>
<td width="25px">
<div style="text-align: center;"> 1 </div>
</td>
<td>
<div>
<b>Enterprise Virtual Instance - Level 8</b>
</div>
</td>
<td width="50px" style="text-align: right;">
<div id="lineitem_sale_unit_396045">
<b>0.00</b>
</div>
</td>
<td width="50px" style="text-align: right;">
<div id="lineitem_nrp_total_396045">
<b></b>
</div>
</td>
<td width="50px" style="text-align: right;">
<div id="lineitem_mrp_total_396045">
<b>0.00</b>
</div>
</td>
</tr>
<tr class="sf_admin_row_2">
<td width="25px"> </td>
<td width="25px"> </td>
<td width="25px"> </td>
<td>
<div id="lineitem_detail_396045" style="color:#333; text-indent: 10px;"> 8Ghz Peak, 4Ghz Average CPU; 8GB RAM</div>
</td>
<td width="50px"> </td>
<td width="50px"> </td>
<td width="50px"> </td>
</tr>
<tr>
<td id="submenu" style="background-color: #ddd;text-align:center;" colspan="7">Shared Managed Firewall</td>
</tr>
<tr class="sf_admin_row_1">
<td width="25px">
<div style="text-align: center;"> 168 </div>
</td>
<td width="25px">
<div style="text-align: center;"> New </div>
</td>
<td width="25px">
<div style="text-align: center;"> 1 </div>
</td>
<td>
<div>
<b>Managed Firewall - Level 2</b>
</div>
</td>
<td width="50px" style="text-align: right;">
<div id="lineitem_sale_unit_396030">
<b>0.00</b>
</div>
</td>
<td width="50px" style="text-align: right;">
<div id="lineitem_nrp_total_396030">
<b></b>
</div>
</td>
<td width="50px" style="text-align: right;">
<div id="lineitem_mrp_total_396030">
<b>0.00</b>
</div>
</td>
</tr>
<tr class="sf_admin_row_2">
<td width="25px"> </td>
<td width="25px"> </td>
<td width="25px"> </td>
<td>
<div id="lineitem_detail_396030" style="color:#333; text-indent: 10px;"> 3 Mbps Sustained Bandwidth, 2 VLAN's, Up to 20 Rules</div>
</td>
<td width="50px"> </td>
<td width="50px"> </td>
<td width="50px"> </td>
</tr>
<tr class="sf_admin_row_1">
<td width="25px">
<div style="text-align: center;"> 169 </div>
</td>
<td width="25px">
<div style="text-align: center;"> New </div>
</td>
<td width="25px">
<div style="text-align: center;"> 1 </div>
</td>
<td>
<div>
<b>Managed Firewall - Level 2 - Setup and Configuration</b>
</div>
</td>
<td width="50px" style="text-align: right;">
<div id="lineitem_sale_unit_396018">
<b>0.00</b>
</div>
</td>
<td width="50px" style="text-align: right;">
<div id="lineitem_nrp_total_396018">
<b>0.00</b>
</div>
</td>
<td width="50px" style="text-align: right;">
<div id="lineitem_mrp_total_396018">
<b> </b>
</div>
</td>
</tr>
<tr class="sf_admin_row_2">
<td width="25px"> </td>
<td width="25px"> </td>
<td width="25px"> </td>
<td>
<div id="lineitem_detail_396018" style="color:#333; text-indent: 10px;"> Managed Firewall Configuration (2 hours maximum)</div>
</td>
<td width="50px"> </td>
<td width="50px"> </td>
<td width="50px"> </td>
</tr>
<tr>
<td id="submenu" style="background-color: #ddd;text-align:center;" colspan="7">Colocation and Data Center Connectivity</td>
</tr>
<tr class="sf_admin_row_1">
<td width="25px">
<div style="text-align: center;"> 221 </div>
</td>
<td width="25px">
<div style="text-align: center;"> New </div>
</td>
<td width="25px">
<div style="text-align: center;"> 3 </div>
</td>
<td>
<div>
<b>Mbps Dedicated Internet Access to Colocation - Burstable</b>
</div>
</td>
<td width="50px" style="text-align: right;">
<div id="lineitem_sale_unit_396020">
<b>0.00</b>
</div>
</td>
<td width="50px" style="text-align: right;">
<div id="lineitem_nrp_total_396020">
<b></b>
</div>
</td>
<td width="50px" style="text-align: right;">
<div id="lineitem_mrp_total_396020">
<b>0.00</b>
</div>
</td>
</tr>
<tr class="sf_admin_row_2">
<td width="25px"> </td>
<td width="25px"> </td>
<td width="25px"> </td>
<td>
<div id="lineitem_detail_396020" style="color:#333; text-indent: 10px;"> Sustained Internet Access burstable to 10Mbps ($150/Mbps)</div>
</td>
<td width="50px"> </td>
<td width="50px"> </td>
<td width="50px"> </td>
</tr>
<tr class="sf_admin_row_1">
<td colspan="4"></td>
<td width="50px">
<center>
<b>TOTAL</b>
</center>
</td>
<td id="heading-total" width="50px" style="text-align: right;">
<div id="lineitem_nrp_grand">$0.00</div>
</td>
<td id="heading-total" width="50px" style="text-align: right;">
<div id="lineitem_mrp_grand">$0.00</div>
</td>
</tr>
</tbody>
</table>
<div style="border: 1px solid #000;padding: 5px; margin-right: 3px; font-size: 8px;">
<div class="wysiwyg-view"> </div>
All product, service and pricing information is based on latest information available.
<br>
Subject to change without notice or obligation. Quote subject to, and not inclusive of, applicable shipping, handling and tax.
</div>
</div>
</body>
</html>
答案 0 :(得分:2)
感谢Brian S.他提到它适用于0.6.0 beta 3,但不是最新的,未发布的代码。这让我仔细检查,看起来我已经交换了最新的代码来测试一些东西。回到那个版本,我就搞定了。