在 NetSuite 中将 Serif 字体添加到高级 PDF

问题描述 投票:0回答:1

我希望在高级 PDF 中将某一特定行显示为衬线字体(具体为 Times New Roman)。我已将 .ttf 文件上传到文件柜并选中“无需登录即可使用”。我将链接分配给一个变量,然后使用该变量将文件链接到高级 PDF:

<#assign font_times_regular = "[[link to file in file cabinet]]" />
<link name="times" type="font" subtype="opentype" src="${font_times_regular}"></link>

然后使用 本身来定义字体

<td align="center" colspan="6" style="padding-top: 10px;padding-bottom:10px; font-family: 'times'; font-size: 11pt;" class="dtName">${ordernum}</td>

但是每当我调用 suitelet 来打印文件时,新字体都不会显示。我已完全按照 SuiteAnswers 的文章进行操作。我错过了什么? Class dtName 在其定义中使用相同的字体:

.dtName {
        border-top:1px solid black;
        border-right:1px solid black;
        border-left:1px solid black;
        valign:middle;
        font-family: times, serif;
  }

这是我一直试图让它工作的方法,但如果有一种方法可以在不需要导入自定义字体的情况下获得衬线,我也想知道。

netsuite freemarker font-family
1个回答
0
投票

事实证明我一开始就无法使用 Times New Roman,因为我们没有使用它的许可证。不过,我设法让“NotoSerif”中内置的 NetSuite 正常工作。我用定义 NotoSerif 的标签替换了我的 标签:

<link name="NotoSerif" type="font" subtype="opentype" src="${nsfont.notoserif_regular}" bytes="2"></link>

然后在我的 标签内的 标签中使用它:

<td align="center" colspan="6" style="padding-top: 10px;padding-bottom:10px;" class="headerinfo">
  <span style="font-family: 'NotoSerif'; font-size: 11pt;">${ordernum}</span>
</td>

之后我需要的衬线行就这样打印了。

© www.soinside.com 2019 - 2024. All rights reserved.