【问题标题】:how to give current directory path in xml file如何在xml文件中给出当前目录路径
【发布时间】:2015-06-11 07:41:49
【问题描述】:

我创建了一个项目。并创建文件夹层次结构,如 xml->conf->font

在 conf 文件夹中我放了我的 XCONF 文件,在字体文件夹中我放了我的字体(ttf 文件)

现在我想参考 XCONF 文件中的字体。请给我解决方案: 我的 XCONF 文件

<?xml version="1.0" encoding="utf-8" ?>
<fop>
<renderers>
<renderer mime="application/pdf">
 <fonts>
 <directory>/font</directory>
 <directory recursive="true">/font</directory>
   <auto-detect/>
    <font embed-url="/font/grotesque-mt-1361500685.ttf">
    <font-triplet name="GrotesqueMT" style="normal" weight="normal"/>
    </font>

    <font embed-url="/font/grotesquemt-light.ttf">
    <font-triplet name="GrotesqueMT-Light" style="normal" weight="normal"/>
  </font>

  <font embed-url="/font/grotesquemt-bold.ttf">
    <font-triplet name="GrotesqueMT-Bold" style="normal" weight="bold"/>
  </font>


 </fonts>
</renderer>

我收到以下异常: 使用 embed-url '/font/grotesque-mt-1361500685.ttf 解析字体失败

【问题讨论】:

    标签: java html xml spring xslt


    【解决方案1】:

    您可以尝试embed-url="./font/...ttf"embed-url="font/...ttf"。前导 / 正常标识一个绝对 URL。您的 url 指向文件系统根目录上的字体目录。

    最好的问候马乔

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-03-26
      • 1970-01-01
      • 2014-08-19
      • 2019-02-18
      • 1970-01-01
      相关资源
      最近更新 更多