1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
public
void CreatePersonInfo(RBS.Models.UserConfirmModel model)
{
Document document = new
Document();
string
filepath = "/Upload/Pdf/" ;
Directory.CreateDirectory(HttpContext.Current.Server.MapPath(filepath));
PdfWriter.GetInstance(document, new
FileStream(HttpContext.Current.Server.MapPath(filepath + model.ExamNo + ".pdf" ), FileMode.Create));
document.Open();
BaseFont bftitle = BaseFont.CreateFont( @"C:\\Windows\Fonts\SIMHEI.TTF" , BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
Font fonttitle = new
Font(bftitle, 20, Font.UNDERLINE);
BaseFont bf1 = BaseFont.CreateFont( @"C:\\Windows\Fonts\SIMSUN.TTC,1" , BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
Font font1 = new
Font(bf1, 12);
Font fonttitle10 = new
Font(bf1, 12);
Font fonttitle12 = new
Font(bf1, 11);
PdfPCell cellmode = new
PdfPCell();
PdfPTable table = new
PdfPTable(4);
PdfPTable tablerow = new
PdfPTable(5);
float
padding = 0f;
#region 个人信息<br><span style="color: rgb(255, 0, 0);">//这种写法感觉很像silverlight,一个萝卜一个坑,习惯了html的感觉这样很不适应</span>
CreateCell(5, 5, 1, "个人信息" , fonttitle10, "left" , tablerow);
CreateCell(1, 5, 1, "考生面试编号" , fonttitle10, "left" , tablerow);
CreateCell(1, 5, 1, model.ExamNo, fonttitle10, "left" , tablerow);
CreateCell(1, 5, 1, "姓名" , fonttitle10, "left" , tablerow);
CreateCell(1, 5, 1, model.Name, fonttitle10, "left" , tablerow);
CreateCell(model.UserId.ToString(), model.Ext, 0, 1, padding, padding, tablerow);
CreateCell(1, 5, 1, "性别" , fonttitle10, "left" , tablerow);
CreateCell(1, 5, 1, model.Sex == RBS.Models.Gender.Male ? "男"
: "女" , fonttitle10, "left" , tablerow);
CreateCell(1, 5, 1, "出生日期" , fonttitle10, "left" , tablerow);
CreateCell(1, 5, 1, model.BirthDate.ToString( "yyyy-MM-dd" ), fonttitle10, "left" , tablerow);
CreateCell(1, 5, 1, "身份证号码" , fonttitle10, "left" , tablerow);
CreateCell(1, 5, 1, model.IdentificationNo, fonttitle10, "left" , tablerow);
CreateCell(1, 5, 1, "户口所在地" , fonttitle10, "left" , tablerow);
CreateCell(1, 5, 1, model.Country, fonttitle10, "left" , tablerow);
CreateCell(1, 5, 1, "出生地" , fonttitle10, "left" , tablerow);
CreateCell(1, 5, 1, model.State, fonttitle10, "left" , tablerow);
CreateCell(1, 5, 1, "婚姻状况" , fonttitle10, "left" , tablerow);
CreateCell(1, 5, 1, model.IsMarrage == RBS.Models.Marriage.Naught ? "未婚"
: "已婚" , fonttitle10, "left" , tablerow);
CreateCell(1, 5, 1, "联系地址" , fonttitle10, "left" , tablerow);
CreateCell(1, 5, 1, model.Address, fonttitle10, "left" , tablerow);
CreateCell(1, 5, 1, "邮政编码" , fonttitle10, "left" , tablerow);
CreateCell(1, 5, 1, model.Postcode, fonttitle10, "left" , tablerow);
CreateCell(1, 5, 1, "联系电话" , fonttitle10, "left" , tablerow);
CreateCell(1, 5, 1, model.Telephone, fonttitle10, "left" , tablerow);
CreateCell(1, 5, 1, "手机" , fonttitle10, "left" , tablerow);
CreateCell(1, 5, 1, model.Mobile, fonttitle10, "left" , tablerow);
CreateCell(1, 5, 1, "邮箱" , fonttitle10, "left" , tablerow);
CreateCell(1, 5, 1, model.Email, fonttitle10, "left" , tablerow);
CreateCell(1, 5, 1, "" , fonttitle10, "left" , tablerow);
CreateCell(1, 5, 1, "" , fonttitle10, "left" , tablerow);
#endregion
#region 教育经历
CreateCell(4, 5, 1, "教育经历" , fonttitle10, "left" , table);
CreateCell(4, 5, 1, "教育经历1" , fonttitle10, "left" , table);
CreateCell(1, 5, 1, "入学时间" , fonttitle10, "left" , table);
CreateCell(1, 5, 1, model.EduBegin != null
? Convert.ToDateTime(model.EduBegin).ToString( "yyyy-MM-dd" ) : "" , fonttitle10, "left" , table);
CreateCell(1, 5, 1, "毕业时间" , fonttitle10, "left" , table);
CreateCell(1, 5, 1, model.EduEnd != null
? Convert.ToDateTime(model.EduEnd).ToString( "yyyy-MM-dd" ) : "" , fonttitle10, "left" , table);
CreateCell(1, 5, 1, "学校名称" , fonttitle10, "left" , table);
CreateCell(1, 5, 1, model.Graduated, fonttitle10, "left" , table);
CreateCell(1, 5, 1, "专业" , fonttitle10, "left" , table);
CreateCell(1, 5, 1, model.Specialty, fonttitle10, "left" , table);
CreateCell(1, 5, 1, "学历" , fonttitle10, "left" , table);
CreateCell(1, 5, 1, model.EduBackground, fonttitle10, "left" , table);
CreateCell(1, 5, 1, "学位" , fonttitle10, "left" , table);
CreateCell(1, 5, 1, model.Degree, fonttitle10, "left" , table);
#endregion
document.Add(tablerow);
document.Add(table);
document.Close();
}
|