首页
学习
活动
专区
圈层
工具
发布
社区首页 >专栏 >使用openffice通过html生成pdf,变量无法找到并替换问题

使用openffice通过html生成pdf,变量无法找到并替换问题

作者头像
botkenni
发布2022-11-21 09:21:58
发布2022-11-21 09:21:58
1.8K0
举报
文章被收录于专栏:IT码农IT码农

html模板,变量{{sealstamp}}用于盖章

代码语言:javascript
复制
<div>
<!--<div style="font-family: '仿宋';font-size: 14px;letter-spacing: 2px;line-height: 1.5;">-->
<!--    font-size要设置为14px,否则盖章后有印线-font-size: 14px;-->
<!--    letter-spacing需要设置-否则解析不出变量-letter-spacing: 2px;-->
<!--    或者line-height需要设置-否则解析不出变量-line-height: 1.5;-->
<!--    只加font-family: '仿宋';font-size: 14px;都可以-->
    <!-- 插入模板start   -->
    <p style="width: 100%;height: 35px; margin: 0 auto"><img style="width: 100%; height: 35px; object-fit: contain" src="http://192.168.110.178/business/img/iemp_header.png" /></p>
    <p>&nbsp;</p>
    <p style="text-align: center"><strong><u>S</u></strong><strong><u>TUDENT TRANSCRIPT</u></strong></p>
    <p>&nbsp;</p>
    <p>Neoscholar Education certifies that:</p>
    <table style="width: 100%;margin: 0 auto;" border="1" cellspacing="0" width="100%"  cellpadding="2">
        <tbody>
        <tr>
            <td style="width: 80px" align="center" width="80">
                <p><strong>NA</strong><strong>M</strong><strong>E</strong></p>
            </td>
            <td style="width: 200px;" align="center" width="200">
                <p>${cnNamePinYin}</p>
            </td>
            <td style="width: 140px;" align="center" width="140">
                <p><strong>STUDENT NUMBER</strong></p>
            </td>
            <td style="width: 162px;" align="center" width="162">
                <p>${customerCode}</p>
            </td>
        </tr>
        <tr>
            <td style="width: 80px;" align="center" width="80">
                <p><strong>GENDER</strong></p>
            </td>
            <td style="width: 200px;" align="center" width="200">
                <p>${customerSex}</p>
            </td>
            <td style="width: 140px;" align="center" width="140">
                <p><strong>NATIONALITY</strong></p>
            </td>
            <td style="width: 162px;" align="center" width="162">
                <p>CHINA</p>
            </td>
        </tr>
        </tbody>
    </table>
    <p>&nbsp;</p>
    <p>Has successfully completed the course of IEMP ${projectNameEn} Session:</p>
    <table style="width: 100%;margin: 0 auto;" border="1" cellspacing="0" width="100%"  cellpadding="2">
        <tbody>
        <tr>
            <td style="width: 30%" align="center" width="208">
                <p style="text-indent: 0px;"><strong>Year</strong></p>
            </td>
            <td style="width: 45%" align="center" width="275">
                <p style="text-indent: 0px;"><strong>Subject</strong></p>
            </td>
            <td style="width: 25%" align="center" width="138">
                <p style="text-indent: 0px;"><strong>Grade</strong></p>
            </td>
        </tr>
        <tr>
            <td style="width: 30%" align="center" width="208">
                <p style="text-indent: 0px;">${projectNameEn}</p>
            </td>
            <td style="width: 45%" align="center" width="275">
                <p style="text-indent: 0px;">${courseNameEn}</p>
            </td>
            <td style="width: 25%" align="center" width="138">
                <p style="text-indent: 0px;">${grade}</p>
            </td>
        </tr>
        <tr>
            <td style="width: 30%" align="center" width="208">
                <p style="text-indent: 0px;"><strong>Professor</strong></p>
            </td>
            <td style="width: 45%" align="center" width="275">
                <p style="text-indent: 0px;"><strong>Respective Home College/University</strong></p>
            </td>
            <td style="width: 25%" align="center" width="138">
                <p style="text-indent: 0px;"><strong>Email</strong></p>
            </td>
        </tr>
        <tr>
            <td style="width: 30%" align="center" width="208">
                <p style="text-indent: 0px;">${professor}</p>
            </td>
            <td style="width: 45%" align="center" width="275">
                <p style="text-indent: 0px;">${school}</p>
            </td>
            <td style="width: 25%" align="center" width="138">
                <p style="text-indent: 0px;">&nbsp;${email}</p>
            </td>
        </tr>
        </tbody>
    </table>
    <p>&nbsp;</p>
    <span style="text-align: center;opacity: 0;font-family: '仿宋';font-size: 14px;">{{sealstamp}}</span>
<!--    {{sealstamp}}必须有属性font-family: '仿宋';font-size: 14px;否则获取不到变量{{sealstamp}}-算是一个bug-->
    <p style="width: 100%;margin: 0 auto;line-height: 1.5">IEMP Program is an academic Online program administrated by Neoscholar Education which is serving as a platform for international education by world-class Universities and as a gateway for their research engagement with China.</p>
    <p style="width: 100%;margin: 0 auto;line-height: 1.5">Each professor/instructor of IEMP program is invited to participate from world-known college. They design and teach the courses in the same manner and with identical requirements of their home institutions. All lectures/readings are in English and all student works are also performed in English. Academic consistency is therefore maintained in accordance with the academic requirements at their respective U.S. colleges. Individual course syllabus is available upon request.</p>
    <p>&nbsp;</p>
    <p style="width: 100%; height: 100px; margin: 0 auto; position: fixed; bottom: 0"><img style="width: 100%; height: 100px; object-fit: contain" src="http://192.168.110.178/business/img/iemp_footer.png" /></p>
<!-- 插入模板end   -->

</div>

{{sealstamp}}必须有属性font-family: '仿宋';font-size: 14px;或者其他的也可以,需要测试,否则获取不到变量{{sealstamp}}-算是一个bug

替换成功

替换失败

仅用于用于日常工作记录

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2022-11-17,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档