【发布时间】:2016-11-21 11:30:44
【问题描述】:
<HTML>
<body>
<%
String value = "12324";
String email = "abc@gmail.com";
%>
<h3>Welcome to the system. To download this form click on "Download PDF" </h3>
<jsp:useBean id="myBean" scope="session" class="VU.viechelInfoClass" />
<jsp:getProperty name="myBean" property="model" />
<table border="1" width="20%" height="50" >
<thead>
<tr>
<th>#</th>
<th>1</th>
<th>2</th>
<th>3</th>
<th>4</th>
</tr>
</thead>
<tbody width="20%" height="50" >
<tr>
<td><%= value %> </td>
<td><%= email %></td>
<td> email </td>
<td>name </td>
<td>Address </td>
</tr>
<tr>
<td> id </td>
<td> Quiz</td>
<td> email </td>
<td>name</td>
<td>Address </td>
</tr>
</tbody>
</table>
<br>
<input type="submit" value="Download PDF" />
</form>
</body>
</HTML>
当点击下载按钮时,我得到了这个 pdf 格式的 jsp,但它没有在表格中正确显示数据?这可能吗?请问怎么做?
请分享一些信息提示。
【问题讨论】:
-
如果您不想使用浏览器打印工具,您将需要使用 PDF 库(如 IText)自己重新创建页面。
-
how to save a jsp page as pdf in java? 或此search 的任何其他页面的可能副本