日期:2014-05-19  浏览次数:20682 次

html转pdf。100分求助
本帖最后由 is_zhoufeng 于 2012-11-29 16:42:13 编辑 itext  , pd4ml 都试过了,不是编码有问题, 就是页面打印不全,或样式跟html不一样。

html 放到这里了, 求转为pdf , 详细代码,和依赖jar包。



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
    

body{
 font-family:SimSun;    
     font-size:12px;          
 width:960px;                
 margin:0 auto 0 auto ;
}       

.ordertable{width:960px ; margin-top:20px;}         

.ordertable tr{
height:30px;      
}

.ordertable tr:hover{
background:#f5f5f5;        
}

.ordertable th{
text-align : center; 
background:#d7e0e8;
}

.ordertable td{
text-align : center;    
border:1px solid #efefef;        
}

.ljtr:hover{background:#ffffff;}

.disinfo{width:960px}

.disinfo .title{
width:100px;        
text-align : right;       
font-weight:bold;                  
}

.disinfo .value{
width:300px;      
text-align : left;      
border-bottom : 1px solid black ; 
}

.logo-div{width:960px; height:91px;}  


.noprint...{display:none;}                   

</style>
</head> 
  <body>  
 <div id="mainDiv">
<div class="logo-div">
<img src="http://223.4.172.172/image/logo.png" style="float:left;"/>
<h1  style="float:left;margin-left:20px;line-height:50px;">深圳市建华信息技术有限公司</h1>                                    
</div>
     
<center><h2>客户对账单</h2></center>   

<table class="disinfo">  
<tr>              
<td class="title">发送到:</td>  
<td class="value">sdfds</td>
<td class="title">发送者:</td>
<td class="value">深圳永恒之旅</td>           
</tr>           
<tr>
<td class="title">收件人:&