一个大众的项目,要求把html生成PDF文档,,求助啊。。。 有这个文件吗?C:\Documents and Settings\Administrator\jbproject\pfd\a.html,你在命令行里直接打开试试先 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 还是不行啊,,,明明有这个html,,求救啊,, 同意你在ie的地址栏打开C:\Documents and Settings\Administrator\jbproject\pfd\a.html,试试看有没有这个文件? a.html 放在 SRC同级目录下 请问怎样在数据库里拿到数据,生成PDF啊,,, 急啊,,,,老总要我在星期4前解决,,,, 这有个简单的小例子,你看一下,此方法是不用生成pdf文件的;数据你从数据库中取出来;你可以从网上一份pdf包的文档,一切都可以搞定了。<%@ page contentType="text/html; charset=utf-8" language="java" errorPage="" %><%@ page import="java.io.*,java.awt.Color,com.lowagie.text.*,com.lowagie.text.pdf.*"%><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>Untitled Document</title></head><body><%response.setContentType( "application/pdf" );Document document = new Document();ByteArrayOutputStream buffer = new ByteArrayOutputStream();PdfWriter writer=PdfWriter.getInstance( document, buffer );document.open();document.add(new Paragraph("Hello World"));//Hello World是要输出到PDF的内容document.close();DataOutput output = new DataOutputStream( response.getOutputStream() );byte[] bytes = buffer.toByteArray();response.setContentLength(bytes.length);for( int i = 0; i < bytes.length; i++ ) { output.writeByte( bytes ); }%></body></html> 请问如何拦截hibernate的load(userId)操作? struts新手提问 JSP错误,请教一下列位 Oracle插入时间日期问题,急,在线等 高手指教 为什么会出现这种错误呢? 感谢飞碟 请在这里发表您对本区的建议,意见。我们会尽力解决!(技术方面的问题请不要放进来) 请问linux下的好的jsp开发平台? Myeclipse用hibernate反向生成实体类的时候应该怎么选那些选项呢? 谁能提供个jsp中文手册啊? QQ群5632494,欢迎加入讨论技术问题
你在ie的地址栏打开C:\Documents and Settings\Administrator\jbproject\pfd\a.html,试试看有没有这个文件?
急啊,,,,老总要我在星期4前解决,,,,
你可以从网上一份pdf包的文档,一切都可以搞定了。
<%@ page contentType="text/html; charset=utf-8" language="java" errorPage="" %>
<%@ page import="java.io.*,java.awt.Color,com.lowagie.text.*,com.lowagie.text.pdf.*"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
</head><body>
<%
response.setContentType( "application/pdf" );
Document document = new Document();
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
PdfWriter writer=PdfWriter.getInstance( document, buffer );
document.open();
document.add(new Paragraph("Hello World"));//Hello World是要输出到PDF的内容
document.close();
DataOutput output = new DataOutputStream( response.getOutputStream() );
byte[] bytes = buffer.toByteArray();
response.setContentLength(bytes.length);
for( int i = 0; i < bytes.length; i++ )
{
output.writeByte( bytes );
}
%></body>
</html>