mpdf的开发文档地址:
Supported CSS – CSS & Stylesheets – mPDF Manual
1.加载依赖库
1 | composer require mpdf /mpdf |
2.页面
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 | $html = < div > < div style = "width: 12rem;height: 15rem;float: right" > $avatar </ div > < div style = "padding-top: 5rem;padding-left: 2rem" > < span style = "font-size: 20pt;font-weight: bold" >$strTitle</ span > < table style = "color: #666666;padding-top: 1rem;font-size: 14pt;line-height: 16pt" > < tbody >< tr > < td > 姓名:$studentName </ td > < td style = "padding-left: 2rem" > 性别:$sex </ td > < td > 出生年月:$birthday </ td > </ tr > < tr > < td > 民族:$nationality </ td > < td > 政治面貌:$political </ td > < td style = "padding-left: 2rem" > 电话:$phone </ td > </ tr > </ tbody ></ table > </ div > </ div > < div style = "background-color: white;padding-bottom: initial" > < table style = "text-align:center;font-size:20pt" ></ table > < h2 ></ h2 > < h2 ></ h2 > < h2 style = "padding-left: 2rem" >技能特长</ h2 > $strSkills < table style = "text-align:left;line-height:200%;font-size:14pt;color: #666666" ></ table > < h2 ></ h2 > < h2 style = "padding-left: 2rem" >成绩单</ h2 > $strActivity < table style = "text-align:left;line-height:200%;font-size:12pt;border-collapse: collapse;margin-left: 2rem;width: 95%" > < tbody >< tr > < th style = "border: 1px solid black;border-right: 0px" >总分:$scoreTotal</ th > < th style = "border: 1px solid black;border-right: 0px;border-left: 0px" ></ th > < th style = "border: 1px solid black;border-right: 0px;border-left: 0px" ></ th > < th style = "border: 1px solid black;border-right: 0px;border-left: 0px" ></ th > < th style = "border: 1px solid black;border-left: 0px" ></ th > </ tr ></ tbody ></ table > < h2 ></ h2 > < h2 style = "padding-left: 2rem" >获奖证书</ h2 > $strCertificate < table style = "text-align:left;line-height:200%;font-size:12pt;border-collapse: collapse;margin-left: 2rem;width: 95%" > < tbody >< tr > < th style = "border: 1px solid black;color: #333333" >项目名称</ th > < th style = "border: 1px solid black;color: #333333" >等级</ th > < th style = "border: 1px solid black;color: #333333" >获得时间</ th > < th style = "border: 1px solid black;color: #333333" >经历描述</ th > </ tr ></ tbody ></ table > < h2 ></ h2 > < h2 style = "padding-left: 2rem" >实践经历</ h2 > $strTraining < h2 ></ h2 > < h2 style = "padding-left: 2rem" >个人风采</ h2 > $strPersona </ div > |