日期:2014-05-17 浏览次数:20571 次
Document document = new Document();
string n = "PDF" + Utility.Utility.GetRandomCode();
PdfWriter.GetInstance(document, new FileStream(Server.MapPath("/uploads/pdfFile/" + n + ".pdf"), FileMode.Create));
document.Open();
BaseFont bfChinese = BaseFont.CreateFont("C:\\WINDOWS\\Fonts\\simsun.ttc,1", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
Font fontChinese = new Font(bfChinese, 12, Font.NORMAL, new Color(0, 0, 0));
string strHtml = "<html><table style=font: 8.5pt width=4766 border=1 style=border-collapse:collapse;>";
strHtml = strHtml + "<tr align=center class=td1 style=color:White;background-color:#1C5E55;><td></td> <td colspan=9>Nomination Business</td><td colspan=9>Free-Hand Business</td><td colspan=9>Third-Party Business</td><td colspan=9>Co-loading Business</td><td colspan=9>Others Business</td><td colspan=9>Total</td></tr>";
strHtml = strHtml + "</table></html>";
//Paragraph paragraph = new Paragraph(strHtml);
document.Add(new Paragraph(strHtml, fontChinese));
document.Close();