3

我正在尝试使用 odt 模板通过 Freemarker 生成 PDF 文件。我在我的操作系统(Windows 7)中添加了字体 code128.ttf 我在 Microsoft Office Word 2010 中创建了 ODT 模板。在此模板中我创建了字段:${MyBarcode.stringForBarcode},并通过 Word 工具为该字段应用了字体 code128.ttf . 接下来我将模板保存为 *.ODT 文件。

然后我尝试使用变换:

Options options = Options.getTo(ConverterTypeTo.PDF).via(ConverterTypeVia.ODFDOM);
IXDocReport report = getReport(uniqueTemplateId, templateContent);
report.convert(contextMap, options, outPdfFile);

但是当我打开结果文件(PDF)时,该字段为空。我认为字体在转换时没有转移。

也许你知道如何通过 Freemarker 和 ODT 模板生成带有条形码的 PDF 吗?

4

0 回答 0