gpt4 book ai didi

java - 尝试呈现 pdf 时获取此 "org.xhtmlrenderer.render.BlockBox cannot be cast to org.xhtmlrenderer.newtable.TableBox"

转载 作者:行者123 更新时间:2023-11-29 05:53:12 26 4
gpt4 key购买 nike

我在尝试呈现 pdf 时遇到此错误。我正在为游戏框架使用 Nicolas Leroux 的 PDF 模块。

这是整个堆栈跟踪:Pastebin .谷歌搜索仅显示 4 个结果。他们建议删除我已删除的任何 float 属性和位置属性,只是为了试一试。我仍然面临这个问题。有没有人能够解决这个问题?

编辑:这是呈现 pdf 的 html:

#{extends 'main.html' /} #{set title:'Salary Details' /}
<html>
<head>
<title>Employee Name</title>
<style>
body {
font: 9pt Arial, Helvetica, sans-serif;
}

.container {
margin: 0 auto;
width: 1000px;
border: 1px solid black;
padding: 12px;
}

.logoClass {
width: 200px;
height: 85px;;
}

.companyAddressClass {
width: 60%;
margin: 0 auto;
font-size: 17px;
font-weight: bold;
text-align: center;
}

.empClass table {
width: 100%;
border: 1px solid #ccc;
border-collapse: collapse;
margin: 10px 0px;
}

.empClass table th,td {
border: 1px solid #ccc;
padding: 5px 5px;
}

.empClass table th {
background: #f2f2f2;
}
</style>
</head>

<body onload="window.print();">

%{for(int i=0;i<dataList.size ();i=i+1){}%
<div class="container" style="page-break-after:#{if i == dataList.size()-1} avoid;#{/if} #{else} always; #{/else}">
<div class="logoClass"></div>
<div class="companyAddressClass">
${dataList.get(i).distributorName},<br /> ${dataList.get(i).city},<br />
${dataList.get(i).state} <br /> <br /> <span>Payslip for the
month of ${dataList.get(i).salaryMonth}</span>
</div>
<br class="clear" />
<div class="empClass">
<table border="1">
<tr>
<td>Employee No: ${dataList.get(i).employeeNumber}</td>
<td>Location: ${dataList.get(i).location}</td>
</tr>
<tr>
<td>Name: ${dataList.get(i).employeeName}</td>
<td>Salary for the M/O: ${dataList.get(i).salaryMonth}</td>
</tr>
<tr>
<td>Bank Name: ${dataList.get(i).bankName}</td>
<td>Designation: ${dataList.get(i).designation}</td>
</tr>
<tr>
<td>Bank Acc No: ${dataList.get(i).accountNumber}</td>
<td>Join Date: ${dataList.get(i).joinDate}</td>
</tr>
<tr>
<td>PF No: ${dataList.get(i).pfNumber}</td>
<td>Gender: ${dataList.get(i).gender}</td>
</tr>
<tr>
<td>ESI No: ${dataList.get(i).esiNumber}</td>
<td>LOP: ${dataList.get(i).lop}</td>
</tr>
<tr>
<td>PAN No: ${dataList.get(i).panNumber}</td>
<td>Days Worked: ${dataList.get(i).daysWorked}</td>
</tr>
</table>
</div>
<br />
<div class="empClass">
<table border="1">
<tr>
<th colspan="3">Earnings</th>
<th colspan="2">Deductions</th>
</tr>
<tr>
<th align="left">Header</th>
<th align="right">Actual</th>
<th align="right">Paid</th>
<th align="left">Header</th>
<th align="right">Paid</th>
</tr>
<tr>
<td>Basic</td>
<td align="right">${dataList.get(i).basic}</td>
<td align="right">${dataList.get(i).basic}</td>
<td>PF</td>
<td align="right">${dataList.get(i).pf}</td>
</tr>
<tr>
<td>HRA</td>
<td align="right">${dataList.get(i).hra}</td>
<td align="right">${dataList.get(i).hra}</td>
<td>ESICEE</td>
<td align="right">${dataList.get(i).esicee}</td>
</tr>
<tr>
<td>Conveyance Allowance</td>
<td align="right">${dataList.get(i).conveynanceAllowance}</td>
<td align="right">${dataList.get(i).conveynanceAllowance}</td>
<td>ESICEE(PWS)</td>
<td align="right">${dataList.get(i).esiceePWS}</td>
</tr>
<tr>
<td>Medical Allowance</td>
<td align="right">${dataList.get(i).medicalAllowances}</td>
<td align="right">${dataList.get(i).medicalAllowances}</td>
<td>PT</td>
<td align="right">${dataList.get(i).pt}</td>
</tr>
<tr>
<td>Special Allowance</td>
<td align="right">${dataList.get(i).specialAllowance}</td>
<td align="right">${dataList.get(i).specialAllowance}</td>
<td>PT(PWS)</td>
<td align="right">${dataList.get(i).ptPWS}</td>
</tr>
<tr>
<td>Incentives</td>
<td align="right">${dataList.get(i).midMonthAmountPWS}</td>
<td align="right">${dataList.get(i).midMonthAmountPWS}</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Other Allowances</td>
<td align="right">${dataList.get(i).otherAllowance}</td>
<td align="right">${dataList.get(i).otherAllowance}</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan="3" align="right">Total
Earnings:${dataList.get(i).totalEarnings}</td>
<td colspan="2" align="right">Total Deduction
:${dataList.get(i).totalDeduction}</td>
</tr>
<tr>
<td colspan="3">&nbsp;</td>
<td colspan="2" align="right"><strong>Salary Credited
: ${dataList.get(i).salaryCredited}</strong></td>
</tr>
</table>

<table>
<thead>
<tr>
<th>Position Title</th>
<th>City Name</th>
<th>State Name</th>
</tr>
</thead>
<thead>
<tr>
..
..
..
..
<th>${dataList.get(i).positionTitle}</th>
<th>${dataList.get(i).cityName}</th>
<th>${dataList.get(i).stateName}</th>
</tr>
</thead>
</table>
<br>
<table>
<thead>
<tr>
<th>Some Header</th>
<th>Some Header</th>
<th>Some Header</th>
<th>Some Header</th>

</tr>
</thead>
<tbody>
<tr>
<td align="center">Values</td>
..
..
..
..
..
</tr>
</tbody>
</table>
</div>
<div>
<span style="font-size: 15px; font-weight: bold;"> Salary
Credited Amount(In Words): ${dataList.get(i).salaryCreditedInWord} </span>
</div>
</div>
<br />
<br />

%{}}%
</body>
</html>

我用的是Windows 7和Tomcat6作为测试环境,和大家过来的环境一样here面临着麻烦。

谢谢。

最佳答案

This commit是解决您的问题的方法。你可以download the whole class并将其放入您的源代码中,这样您就不必重建库 jar。

关于java - 尝试呈现 pdf 时获取此 "org.xhtmlrenderer.render.BlockBox cannot be cast to org.xhtmlrenderer.newtable.TableBox",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13137401/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com