Blame view

PDFUtil.java 53.1 KB
涂亚平 committed
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 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188
package com.subsidy.util;

import com.itextpdf.text.*;
import com.itextpdf.text.pdf.BaseFont;
import com.itextpdf.text.pdf.PdfPCell;
import com.itextpdf.text.pdf.PdfPTable;
import com.itextpdf.text.pdf.PdfWriter;
import com.subsidy.common.exception.HttpException;
import com.subsidy.model.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

@Slf4j
@Component
public class PDFUtil {

    static BaseFont baseFont;

    {
        try {
            baseFont = BaseFont.createFont("https://zhongzhi-cms.oss-cn-shanghai.aliyuncs.com/STSONG.TTF", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public static void create(ProjectDO projectDO1, MatchDictDO matchDictDO, TeacherDO teacherDO, List<ProjectMembersDO> projectMembersDOS, CollegesDictDO collegesDictDO) {
        try {
            ByteArrayOutputStream bao = new ByteArrayOutputStream();
            Document document = new Document(PageSize.A4, 20, 20, 20, 20);
            PdfWriter.getInstance(document, bao);
            document.open();

            document.add(new Paragraph(" \n"));
            document.add(new Paragraph(" \n"));

            Paragraph p1 = new Paragraph(matchDictDO.getMatchName(), new Font(baseFont, 20, Font.BOLD));
            p1.setAlignment(Element.ALIGN_CENTER);
            document.add(p1);
            document.add(new Paragraph(" \n"));
            document.add(new Paragraph(" \n"));

            Paragraph t2 = new Paragraph("一、课程基本信息", new Font(baseFont, 16, Font.BOLD));
            t2.setAlignment(Element.ALIGN_LEFT);
            document.add(t2);
            document.add(new Paragraph(" \n"));
            document.add(new Paragraph(" \n"));

            PdfPTable table = new PdfPTable(13);
            PDFUtil.tableStyle(new PdfPTable(13), new int[13]);
            PdfPCell cell;

            Paragraph t3 = new Paragraph("课程名称", new Font(PDFUtil.baseFont, 12));
            t3.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t3);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(2);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table.addCell(cell);

            Paragraph t4 = new Paragraph(projectDO1.getCourseName(), new Font(PDFUtil.baseFont, 12));
            t4.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t4);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(6);
            cell.setPadding(5);
            table.addCell(cell);

            Paragraph t5 = new Paragraph("参赛教师姓名", new Font(PDFUtil.baseFont, 12));
            t5.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t5);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(2);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table.addCell(cell);

            Paragraph t6 = new Paragraph(teacherDO.getUserName(), new Font(PDFUtil.baseFont, 12));
            t6.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t6);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(3);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table.addCell(cell);

            Paragraph t7 = new Paragraph("性别", new Font(PDFUtil.baseFont, 12));
            t7.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t7);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(2);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table.addCell(cell);

            Paragraph t8 = new Paragraph(idCard2Gender(teacherDO.getIdCard()), new Font(PDFUtil.baseFont, 12));
            t8.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t8);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(2);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table.addCell(cell);

            Paragraph t9 = new Paragraph("民族", new Font(PDFUtil.baseFont, 12));
            t9.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t9);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(2);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table.addCell(cell);

            Paragraph t10 = new Paragraph(teacherDO.getNationality(), new Font(PDFUtil.baseFont, 12));
            t10.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t10);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(2);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table.addCell(cell);

            Paragraph t11 = new Paragraph("出生年月", new Font(PDFUtil.baseFont, 12));
            t11.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t11);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(2);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table.addCell(cell);

            Paragraph t12 = new Paragraph(idCard2BirthDate(teacherDO.getIdCard()), new Font(PDFUtil.baseFont, 12));
            t12.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t12);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(3);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table.addCell(cell);

            Paragraph t13 = new Paragraph("职务", new Font(PDFUtil.baseFont, 12));
            t13.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t13);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(2);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table.addCell(cell);

            Paragraph t14 = new Paragraph(teacherDO.getPosition(), new Font(PDFUtil.baseFont, 12));
            t14.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t14);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(4);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table.addCell(cell);

            Paragraph t15 = new Paragraph("职称", new Font(PDFUtil.baseFont, 12));
            t15.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t15);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(2);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table.addCell(cell);

            Paragraph t16 = new Paragraph(teacherDO.getTitle(), new Font(PDFUtil.baseFont, 12));
            t16.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t16);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(5);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table.addCell(cell);

            Paragraph t17 = new Paragraph("学历/学位", new Font(PDFUtil.baseFont, 12));
            t17.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t17);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(2);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table.addCell(cell);

            Paragraph t18 = new Paragraph(teacherDO.getEducation(), new Font(PDFUtil.baseFont, 12));
            t18.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t18);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(4);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table.addCell(cell);

            Paragraph t19 = new Paragraph("专业/专长", new Font(PDFUtil.baseFont, 12));
            t19.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t19);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(2);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table.addCell(cell);

            Paragraph t20 = new Paragraph(teacherDO.getMajor(), new Font(PDFUtil.baseFont, 12));
            t20.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t20);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(5);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table.addCell(cell);

            Paragraph t21 = new Paragraph("所在高校", new Font(PDFUtil.baseFont, 12));
            t21.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t21);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(2);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table.addCell(cell);

            Paragraph t22 = new Paragraph(collegesDictDO.getName(), new Font(PDFUtil.baseFont, 12));
            t22.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t22);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(4);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table.addCell(cell);

            Paragraph t23 = new Paragraph("身份证号", new Font(PDFUtil.baseFont, 12));
            t23.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t23);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(2);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table.addCell(cell);

            Paragraph t24 = new Paragraph(teacherDO.getIdCard(), new Font(PDFUtil.baseFont, 12));
            t24.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t24);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(5);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table.addCell(cell);

            Paragraph t25 = new Paragraph("联系电话", new Font(PDFUtil.baseFont, 12));
            t25.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t25);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(2);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table.addCell(cell);

            Paragraph t26 = new Paragraph(teacherDO.getTelephone(), new Font(PDFUtil.baseFont, 12));
            t26.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t26);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(4);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table.addCell(cell);

            Paragraph t27 = new Paragraph("电子邮箱", new Font(PDFUtil.baseFont, 12));
            t27.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t27);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(2);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table.addCell(cell);

            Paragraph t28 = new Paragraph(teacherDO.getEmail(), new Font(PDFUtil.baseFont, 12));
            t28.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t28);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(5);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table.addCell(cell);

            Paragraph t29 = new Paragraph("课程编码", new Font(PDFUtil.baseFont, 12));
            t29.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t29);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(5);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table.addCell(cell);

            Paragraph t30 = new Paragraph(projectDO1.getCourseCode(), new Font(PDFUtil.baseFont, 12));
            t30.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t30);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(8);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table.addCell(cell);

            Paragraph t31 = new Paragraph("课程性质", new Font(PDFUtil.baseFont, 12));
            t31.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t31);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(5);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table.addCell(cell);

            Paragraph t32 = new Paragraph(projectDO1.getCourseType(), new Font(PDFUtil.baseFont, 12));
            t32.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t32);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(8);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table.addCell(cell);

            Paragraph t33 = new Paragraph("开课年级", new Font(PDFUtil.baseFont, 12));
            t33.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t33);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(5);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table.addCell(cell);

            Paragraph t34 = new Paragraph(projectDO1.getGrade(), new Font(PDFUtil.baseFont, 12));
            t34.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t34);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(8);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table.addCell(cell);

            Paragraph t35 = new Paragraph("学时", new Font(PDFUtil.baseFont, 12));
            t35.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t35);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(5);
            cell.setPaddingTop(24);
            cell.setPaddingBottom(24);
            table.addCell(cell);

            Paragraph t36 = new Paragraph("总学时:"+projectDO1.getCourseHour()+"\n理论课学时:"+projectDO1.getTheoryHour()+"\n实践学时:"+projectDO1.getPractiseHour(), new Font(PDFUtil.baseFont, 12));
            t36.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t36);
            cell.setHorizontalAlignment(Element.ALIGN_LEFT);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(8);
            cell.setPaddingTop(16);
            cell.setPaddingBottom(16);
            table.addCell(cell);

            Paragraph t37 = new Paragraph("学分", new Font(PDFUtil.baseFont, 12));
            t37.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t37);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(5);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table.addCell(cell);

            Paragraph t38 = new Paragraph(projectDO1.getScore()+"", new Font(PDFUtil.baseFont, 12));
            t38.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t38);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(8);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table.addCell(cell);

            Paragraph t39 = new Paragraph("最近两轮开课时间", new Font(PDFUtil.baseFont, 12));
            t39.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t39);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(5);
            cell.setRowspan(2);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table.addCell(cell);

            Paragraph t40 = new Paragraph(projectDO1.getStartDate1()+"~"+projectDO1.getEndDate1(), new Font(PDFUtil.baseFont, 12));
            t40.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t40);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(8);
            cell.setPaddingTop(4);
            cell.setPaddingBottom(4);
            table.addCell(cell);

            Paragraph t41 = new Paragraph(projectDO1.getStartDate2()+"~"+projectDO1.getEndDate2(), new Font(PDFUtil.baseFont, 12));
            t41.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t41);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(8);
            cell.setPaddingTop(4);
            cell.setPaddingBottom(4);
            table.addCell(cell);

            Paragraph t42 = new Paragraph("最近两轮学生总人数", new Font(PDFUtil.baseFont, 12));
            t42.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t42);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(5);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table.addCell(cell);

            Paragraph t43 = new Paragraph(projectDO1.getStudentTotalNum()+"", new Font(PDFUtil.baseFont, 12));
            t43.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t43);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(8);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table.addCell(cell);
            document.add(table);

            document.add(new Paragraph(" \n"));
            document.add(new Paragraph(" \n"));

            Paragraph p2 = new Paragraph("二、授课教师(课程团队)", new Font(baseFont, 16, Font.BOLD));
            p2.setAlignment(Element.ALIGN_LEFT);
            document.add(p2);
            document.add(new Paragraph(" \n"));
            document.add(new Paragraph(" \n"));

            PdfPTable table2 = new PdfPTable(13);

            Paragraph t44 = new Paragraph("课程团队其他主要成员(总人数限4人以内)", new Font(PDFUtil.baseFont, 13, Font.BOLD));
            t44.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t44);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(13);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table2.addCell(cell);

            Paragraph t45 = new Paragraph("序号", new Font(PDFUtil.baseFont, 12));
            t45.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t45);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(1);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table2.addCell(cell);

            Paragraph t46 = new Paragraph("姓名", new Font(PDFUtil.baseFont, 12));
            t46.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t46);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(2);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table2.addCell(cell);

            Paragraph t47 = new Paragraph("出生年月", new Font(PDFUtil.baseFont, 12));
            t47.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t47);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(2);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table2.addCell(cell);

            Paragraph t48 = new Paragraph("学历/学位", new Font(PDFUtil.baseFont, 12));
            t48.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t48);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(2);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table2.addCell(cell);

            Paragraph t49 = new Paragraph("职务/职称", new Font(PDFUtil.baseFont, 12));
            t49.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t49);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(2);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table2.addCell(cell);

            Paragraph t50 = new Paragraph("专业/专长", new Font(PDFUtil.baseFont, 12));
            t50.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t50);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(2);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table2.addCell(cell);

            Paragraph t51 = new Paragraph("授课任务", new Font(PDFUtil.baseFont, 12));
            t51.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t51);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(2);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table2.addCell(cell);

            for (int i = 1 ; i <= projectMembersDOS.size()-1 ; i ++){

                Paragraph t52 = new Paragraph(i+"",new Font(PDFUtil.baseFont, 12));
                t52.setAlignment(Element.ALIGN_CENTER);
                cell = new PdfPCell(t52);
                cell.setHorizontalAlignment(Element.ALIGN_CENTER);
                cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
                cell.setColspan(1);
                cell.setPaddingTop(8);
                cell.setPaddingBottom(8);
                table2.addCell(cell);

                Paragraph t53 = new Paragraph(projectMembersDOS.get(i).getUserName(), new Font(PDFUtil.baseFont, 12));
                t53.setAlignment(Element.ALIGN_CENTER);
                cell = new PdfPCell(t53);
                cell.setHorizontalAlignment(Element.ALIGN_CENTER);
                cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
                cell.setColspan(2);
                cell.setPaddingTop(8);
                cell.setPaddingBottom(8);
                table2.addCell(cell);

                Paragraph t54 = new Paragraph(projectMembersDOS.get(i).getBirthDate(), new Font(PDFUtil.baseFont, 12));
                t54.setAlignment(Element.ALIGN_CENTER);
                cell = new PdfPCell(t54);
                cell.setHorizontalAlignment(Element.ALIGN_CENTER);
                cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
                cell.setColspan(2);
                cell.setPaddingTop(8);
                cell.setPaddingBottom(8);
                table2.addCell(cell);

                Paragraph t55 = new Paragraph(projectMembersDOS.get(i).getEducation(), new Font(PDFUtil.baseFont, 12));
                t55.setAlignment(Element.ALIGN_CENTER);
                cell = new PdfPCell(t55);
                cell.setHorizontalAlignment(Element.ALIGN_CENTER);
                cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
                cell.setColspan(2);
                cell.setPaddingTop(8);
                cell.setPaddingBottom(8);
                table2.addCell(cell);

                Paragraph t56 = new Paragraph(projectMembersDOS.get(i).getPosition(), new Font(PDFUtil.baseFont, 12));
                t56.setAlignment(Element.ALIGN_CENTER);
                cell = new PdfPCell(t56);
                cell.setHorizontalAlignment(Element.ALIGN_CENTER);
                cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
                cell.setColspan(2);
                cell.setPaddingTop(8);
                cell.setPaddingBottom(8);
                table2.addCell(cell);

                Paragraph t57 = new Paragraph(projectMembersDOS.get(i).getMajor(), new Font(PDFUtil.baseFont, 12));
                t57.setAlignment(Element.ALIGN_CENTER);
                cell = new PdfPCell(t57);
                cell.setHorizontalAlignment(Element.ALIGN_CENTER);
                cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
                cell.setColspan(2);
                cell.setPaddingTop(8);
                cell.setPaddingBottom(8);
                table2.addCell(cell);

                Paragraph t58 = new Paragraph(projectMembersDOS.get(i).getCourseTarget(), new Font(PDFUtil.baseFont, 12));
                t58.setAlignment(Element.ALIGN_CENTER);
                cell = new PdfPCell(t58);
                cell.setHorizontalAlignment(Element.ALIGN_CENTER);
                cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
                cell.setColspan(2);
                cell.setPaddingTop(8);
                cell.setPaddingBottom(8);
                table2.addCell(cell);

            }
            document.add(table2);

            PdfPTable table3 = new PdfPTable(13);

            Paragraph t59 = new Paragraph("课程团队主要成员讲授参赛课程情况(含参赛教师,最近一轮)", new Font(PDFUtil.baseFont, 13, Font.BOLD));
            t59.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t59);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(13);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table3.addCell(cell);

            Paragraph t60 = new Paragraph("序号", new Font(PDFUtil.baseFont, 12));
            t60.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t60);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(1);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table3.addCell(cell);

            Paragraph t61 = new Paragraph("姓名", new Font(PDFUtil.baseFont, 12));
            t61.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t61);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(2);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table3.addCell(cell);

            Paragraph t62 = new Paragraph("授课学期", new Font(PDFUtil.baseFont, 12));
            t62.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t62);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(2);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table3.addCell(cell);

            Paragraph t63 = new Paragraph("起止日期", new Font(PDFUtil.baseFont, 12));
            t63.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t63);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(2);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table3.addCell(cell);

            Paragraph t64 = new Paragraph("授课学时", new Font(PDFUtil.baseFont, 12));
            t64.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t64);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(2);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table3.addCell(cell);

            Paragraph t65 = new Paragraph("授课年级", new Font(PDFUtil.baseFont, 12));
            t65.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t65);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(2);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table3.addCell(cell);

            Paragraph t66 = new Paragraph("班级人数", new Font(PDFUtil.baseFont, 12));
            t66.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t66);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(2);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table3.addCell(cell);

        for (int i = 0 ; i <= projectMembersDOS.size()-1 ; i ++){

                Paragraph t52 = new Paragraph(i+1+"",new Font(PDFUtil.baseFont, 12));
                t52.setAlignment(Element.ALIGN_CENTER);
                cell = new PdfPCell(t52);
                cell.setHorizontalAlignment(Element.ALIGN_CENTER);
                cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
                cell.setColspan(1);
                cell.setPaddingTop(8);
                cell.setPaddingBottom(8);
                table3.addCell(cell);

                Paragraph t53 = new Paragraph(projectMembersDOS.get(i).getUserName(), new Font(PDFUtil.baseFont, 12));
                t53.setAlignment(Element.ALIGN_CENTER);
                cell = new PdfPCell(t53);
                cell.setHorizontalAlignment(Element.ALIGN_CENTER);
                cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
                cell.setColspan(2);
                cell.setPaddingTop(8);
                cell.setPaddingBottom(8);
                table3.addCell(cell);

                Paragraph t54 = new Paragraph(projectMembersDOS.get(i).getSemester(), new Font(PDFUtil.baseFont, 12));
                t54.setAlignment(Element.ALIGN_CENTER);
                cell = new PdfPCell(t54);
                cell.setHorizontalAlignment(Element.ALIGN_CENTER);
                cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
                cell.setColspan(2);
                cell.setPaddingTop(8);
                cell.setPaddingBottom(8);
                table3.addCell(cell);

                Paragraph t55 = new Paragraph(projectMembersDOS.get(i).getStartDate()+"~"+projectMembersDOS.get(i).getEndDate(), new Font(PDFUtil.baseFont, 12));
                t55.setAlignment(Element.ALIGN_CENTER);
                cell = new PdfPCell(t55);
                cell.setHorizontalAlignment(Element.ALIGN_CENTER);
                cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
                cell.setColspan(2);
                cell.setPaddingTop(8);
                cell.setPaddingBottom(8);
                table3.addCell(cell);

                Paragraph t56 = new Paragraph(projectMembersDOS.get(i).getTeachHours()+"", new Font(PDFUtil.baseFont, 12));
                t56.setAlignment(Element.ALIGN_CENTER);
                cell = new PdfPCell(t56);
                cell.setHorizontalAlignment(Element.ALIGN_CENTER);
                cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
                cell.setColspan(2);
                cell.setPaddingTop(8);
                cell.setPaddingBottom(8);
                table3.addCell(cell);

                Paragraph t57 = new Paragraph(projectMembersDOS.get(i).getTeachGrade(), new Font(PDFUtil.baseFont, 12));
                t57.setAlignment(Element.ALIGN_CENTER);
                cell = new PdfPCell(t57);
                cell.setHorizontalAlignment(Element.ALIGN_CENTER);
                cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
                cell.setColspan(2);
                cell.setPaddingTop(8);
                cell.setPaddingBottom(8);
                table3.addCell(cell);

                Paragraph t58 = new Paragraph(projectMembersDOS.get(i).getClassTotalNum()+"", new Font(PDFUtil.baseFont, 12));
                t58.setAlignment(Element.ALIGN_CENTER);
                cell = new PdfPCell(t58);
                cell.setHorizontalAlignment(Element.ALIGN_CENTER);
                cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
                cell.setColspan(2);
                cell.setPaddingTop(8);
                cell.setPaddingBottom(8);
                table3.addCell(cell);

            }
            document.add(table3);

            Paragraph t74 = new Paragraph("整体课程团队教学情况(400字以内)", new Font(PDFUtil.baseFont, 13,Font.BOLD));
            t74.setAlignment(Element.ALIGN_LEFT);
            cell = new PdfPCell(t74);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(13);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table3.addCell(cell);

            Paragraph t75 = new Paragraph(projectDO1.getCourseTeam(), new Font(PDFUtil.baseFont, 12));
            t75.setAlignment(Element.ALIGN_LEFT);
            cell = new PdfPCell(t75);
            cell.setHorizontalAlignment(Element.ALIGN_LEFT);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setMinimumHeight(160f);
            cell.setColspan(13);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table3.addCell(cell);

            document.add(new Paragraph(" \n"));
            document.add(new Paragraph(" \n"));

            Paragraph t76 = new Paragraph("三、课程概述(400字以内)", new Font(baseFont, 16, Font.BOLD));
            t76.setAlignment(Element.ALIGN_LEFT);
            document.add(t76);
            document.add(new Paragraph(" \n"));
            document.add(new Paragraph(" \n"));

            PdfPTable table4 = new PdfPTable(13);
            Paragraph t77 = new Paragraph(projectDO1.getCourseDesc(), new Font(PDFUtil.baseFont, 12));
            t77.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t77);
            cell.setHorizontalAlignment(Element.ALIGN_LEFT);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setMinimumHeight(160f);
            cell.setColspan(13);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table4.addCell(cell);
            document.add(table4);

            document.add(new Paragraph(" \n"));
            document.add(new Paragraph(" \n"));
            Paragraph t78 = new Paragraph("四、课程目标(300字以内)", new Font(baseFont, 16, Font.BOLD));
            t78.setAlignment(Element.ALIGN_LEFT);
            document.add(t78);
            document.add(new Paragraph(" \n"));
            document.add(new Paragraph(" \n"));

            PdfPTable table5 = new PdfPTable(13);
            Paragraph t79 = new Paragraph(projectDO1.getCourseMission(), new Font(PDFUtil.baseFont, 12));
            t79.setAlignment(Element.ALIGN_LEFT);
            cell = new PdfPCell(t79);
            cell.setMinimumHeight(125f);
            cell.setHorizontalAlignment(Element.ALIGN_LEFT);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(13);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table5.addCell(cell);
            document.add(table5);

            document.add(new Paragraph(" \n"));
            document.add(new Paragraph(" \n"));

            Paragraph t80 = new Paragraph("五、课程内容与教学安排(500字以内)", new Font(baseFont, 16, Font.BOLD));
            t80.setAlignment(Element.ALIGN_LEFT);
            document.add(t80);
            document.add(new Paragraph(" \n"));
            document.add(new Paragraph(" \n"));

            PdfPTable table6 = new PdfPTable(13);
            Paragraph t81 = new Paragraph(projectDO1.getCourseContent(), new Font(PDFUtil.baseFont, 12));
            t81.setAlignment(Element.ALIGN_LEFT);
            cell = new PdfPCell(t81);
            cell.setHorizontalAlignment(Element.ALIGN_LEFT);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setMinimumHeight(195f);
            cell.setColspan(13);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table6.addCell(cell);
            document.add(table6);

            document.newPage();

            Paragraph t82 = new Paragraph("六、教材及教辅材料(400字以内)", new Font(baseFont, 16, Font.BOLD));
            t82.setAlignment(Element.ALIGN_LEFT);
            document.add(t82);
            document.add(new Paragraph(" \n"));
            document.add(new Paragraph(" \n"));

            PdfPTable table7 = new PdfPTable(13);
            Paragraph t83 = new Paragraph(projectDO1.getTeachFiles(), new Font(PDFUtil.baseFont, 12));
            t83.setAlignment(Element.ALIGN_LEFT);
            cell = new PdfPCell(t83);
            cell.setMinimumHeight(160f);
            cell.setHorizontalAlignment(Element.ALIGN_LEFT);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(13);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table7.addCell(cell);
            document.add(table7);
            document.add(new Paragraph(" \n"));
            document.add(new Paragraph(" \n"));
            Paragraph t84 = new Paragraph("七、教研成果及教学改革(500字以内)", new Font(baseFont, 16, Font.BOLD));
            t84.setAlignment(Element.ALIGN_LEFT);
            document.add(t84);
            document.add(new Paragraph(" \n"));
            document.add(new Paragraph(" \n"));

            PdfPTable table8 = new PdfPTable(13);
            Paragraph t85 = new Paragraph(projectDO1.getTeachResult(), new Font(PDFUtil.baseFont, 12));
            t85.setAlignment(Element.ALIGN_LEFT);
            cell = new PdfPCell(t85);
            cell.setHorizontalAlignment(Element.ALIGN_LEFT);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setMinimumHeight(195f);
            cell.setColspan(13);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table8.addCell(cell);
            document.add(table8);
            document.add(new Paragraph(" \n"));
            document.add(new Paragraph(" \n"));
            Paragraph t86 = new Paragraph("八、课程特色与创新点(400字以内)", new Font(baseFont, 16, Font.BOLD));
            t86.setAlignment(Element.ALIGN_LEFT);
            document.add(t86);
            document.add(new Paragraph(" \n"));
            document.add(new Paragraph(" \n"));

            PdfPTable table9 = new PdfPTable(13);
            Paragraph t87 = new Paragraph(projectDO1.getCourseFeature(), new Font(PDFUtil.baseFont, 12));
            t87.setAlignment(Element.ALIGN_LEFT);
            cell = new PdfPCell(t87);
            cell.setMinimumHeight(160f);
            cell.setHorizontalAlignment(Element.ALIGN_LEFT);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(13);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table9.addCell(cell);
            document.add(table9);

            document.newPage();

            Paragraph t88 = new Paragraph("九、学校推荐意见", new Font(baseFont, 16, Font.BOLD));
            t88.setAlignment(Element.ALIGN_LEFT);
            document.add(t88);
            document.add(new Paragraph(" \n"));
            document.add(new Paragraph(" \n"));

            PdfPTable table10 = new PdfPTable(13);

            Paragraph t89 = new Paragraph("学校就业部门意见", new Font(PDFUtil.baseFont, 12));
            t89.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t89);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(3);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table10.addCell(cell);

            Paragraph t90 = new Paragraph("\n\n\n\n\n\n\n(盖章)                   \n年        月       日", new Font(PDFUtil.baseFont, 12));
            t90.setAlignment(Element.ALIGN_RIGHT);
            cell = new PdfPCell(t90);
            cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(10);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table10.addCell(cell);

            Paragraph t91 = new Paragraph("学校教务部门意见", new Font(PDFUtil.baseFont, 12));
            t91.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t91);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(3);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table10.addCell(cell);

            Paragraph t92 = new Paragraph("\n\n\n\n\n\n\n(盖章)                   \n年        月       日", new Font(PDFUtil.baseFont, 12));
            t92.setAlignment(Element.ALIGN_RIGHT);
            cell = new PdfPCell(t92);
            cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(10);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table10.addCell(cell);

            Paragraph t93 = new Paragraph("学校政治审查意见", new Font(PDFUtil.baseFont, 12));
            t93.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t93);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(3);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table10.addCell(cell);

            Paragraph t94 = new Paragraph("        该课程内容及上传的申报材料无危害国家安全、涉密及其他不适宜公开 传播的内容,对于我国政治制度以及党的理论、路线、方针、政策等理解和表述准确无误,价值取向正确,不存在思想性问题。\n" +
                    "        该课程团队参赛教师及成员遵纪守法,无违法违纪行为,不存在师德师风问题、学术不端等问题,五年内未出现过重大教学事故。\n\n                                                                                                      (盖章)\n                                        " +
                    "                                            年         月       日", new Font(PDFUtil.baseFont, 12));
            t94.setAlignment(Element.ALIGN_RIGHT);
            cell = new PdfPCell(t94);
//            cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(10);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table10.addCell(cell);

            Paragraph t95 = new Paragraph("申报学校承诺意见", new Font(PDFUtil.baseFont, 12));
            t95.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t95);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(3);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table10.addCell(cell);

            Paragraph t96 = new Paragraph("        学校对课程有关信息及课程负责人填报的内容进行了核实,保证真实性。经对该课程评审评价,择优申报推荐。\n" +
                    "        如果此课程获评全国金奖,自获奖结果公布开始,该课程相关材料将通过教育部有关网站、大赛官网等平台公开发布,供全国高校交流学习不少于5年,并按教育部要求提供年度运行数据,接受监督和管理。\n" +
                    "\n                                                    主管校领导签字:\n                                          " +
                    "                                          年       月       日", new Font(PDFUtil.baseFont, 12));
            t96.setAlignment(Element.ALIGN_RIGHT);
            cell = new PdfPCell(t96);
//            cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(10);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table10.addCell(cell);

            Paragraph t97 = new Paragraph("学校意见", new Font(PDFUtil.baseFont, 12));
            t97.setAlignment(Element.ALIGN_CENTER);
            cell = new PdfPCell(t97);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(3);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table10.addCell(cell);

            Paragraph t98 = new Paragraph("\n\n\n\n\n\n\n学校(盖章)\n年        月       日", new Font(PDFUtil.baseFont, 12));
            t98.setAlignment(Element.ALIGN_RIGHT);
            cell = new PdfPCell(t98);
            cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setColspan(10);
            cell.setPaddingTop(8);
            cell.setPaddingBottom(8);
            table10.addCell(cell);
            document.add(table10);

            document.add(new Paragraph(" \n"));
            document.add(new Paragraph(" \n"));


            Paragraph t99 = new Paragraph("说明:", new Font(baseFont, 12, Font.BOLD));
            t99.setAlignment(Element.ALIGN_LEFT);
            document.add(t99);

            Paragraph t100 = new Paragraph("1.参赛课程不包含创业类课程;", new Font(baseFont, 10));
            t100.setAlignment(Element.ALIGN_LEFT);
            document.add(t100);

            Paragraph t101 = new Paragraph("2.推荐表盖章后需扫描成PDF格式提交。", new Font(baseFont, 10));
            t101.setAlignment(Element.ALIGN_LEFT);
            document.add(t101);

            document.close();
            bao.close();
            renderPdf(bao.toByteArray(), String.valueOf(System.currentTimeMillis()), "pdf");
        } catch (Exception e) {
//            log.error("---PDF创建异常: " + e);
            e.printStackTrace();
            throw new HttpException(10010);
        }
    }

    public static void tableStyle(PdfPTable table, int[] cellsWidth) throws DocumentException {
        table.setWidths(cellsWidth);
        table.setWidthPercentage(100);
        table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
        table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE);
        table.getDefaultCell().setFixedHeight(30);
        table.getDefaultCell().setBackgroundColor(BaseColor.BLUE);
        table.getDefaultCell().setPadding(0);
        table.getDefaultCell().setBorderWidth(0);
    }

    /**
     * 流化下载
     *
     * @param bytes
     * @param filename
     */
    public static void renderPdf(final byte[] bytes, final String filename, String type) {
        ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
        HttpServletResponse response = servletRequestAttributes.getResponse();
        initResponseHeader(response, "application/" + type);
        setFileDownloadHeader(response, filename, "." + type);
        if (null != bytes) {
            try {
                response.getOutputStream().write(bytes);
                response.getOutputStream().flush();
            } catch (IOException e) {
                throw new IllegalArgumentException(e);
            }
        }
    }

    /**
     * 分析并设置contentType与headers.
     */
    private static HttpServletResponse initResponseHeader(HttpServletResponse response, final String contentType, final String... headers) {
        // 分析headers参数
        String encoding = "utf-8";
        boolean noCache = true;
        for (String header : headers) {
            String headerName = StringUtils.substringBefore(header, ":");
            String headerValue = StringUtils.substringAfter(header, ":");
            if (StringUtils.equalsIgnoreCase(headerName, "utf-8")) {
                encoding = headerValue;
            } else if (StringUtils.equalsIgnoreCase(headerName, "no-cache")) {
                noCache = Boolean.parseBoolean(headerValue);
            } else {
                throw new IllegalArgumentException(headerName + "不是一个合法的header类型");
            }
        }
        // 设置headers参数
        String fullContentType = contentType + ";charset=" + encoding;
        response.setContentType(fullContentType);
        if (noCache) {
            // Http 1.0 header
            response.setDateHeader("Expires", 0);
            response.addHeader("Pragma", "no-cache");
            // Http 1.1 header
            response.setHeader("Cache-Control", "no-cache");
        }
        return response;
    }

    /**
     * 设置让浏览器弹出下载对话框的Header.
     *
     * @param
     */
    public static void setFileDownloadHeader(HttpServletResponse response, String fileName, String fileType) {
        try {
            // 中文文件名支持
            String encodedfileName = new String(fileName.getBytes(StandardCharsets.UTF_8), "ISO8859-1");
            response.setHeader("Content-Disposition", "attachment; filename=\"" + encodedfileName + fileType + "\"");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
    }

    public static String idCard2Gender(String idCard) {
        int genderDigit = Integer.parseInt(idCard.substring(16, 17));
        return (genderDigit % 2 == 0) ? "女" : "男";
    }

    public static String idCard2BirthDate(String idCard) {
        if (idCard == null || idCard.length() != 18) {
            throw new IllegalArgumentException("身份证号码不合法");
        }

        String birthDateStr = idCard.substring(6, 14);
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
        try {
            Date birthDate = sdf.parse(birthDateStr);
            SimpleDateFormat outputFormat = new SimpleDateFormat("yyyy/MM/dd");
            return outputFormat.format(birthDate);
        } catch (Exception e) {
            throw new IllegalArgumentException("身份证号码中的出生日期不合法");
        }
    }


}