在XSL-FOP中嵌入Times New Roman

时间:2012-01-31 15:48:28

标签: xsl-fo apache-fop

我最近发现我办公室使用的商业印刷公司在其打印机上没有引用的字体。我在默认情况下使用Apache FOP库生成的PDF将字体设置为在XSL-FO转换期间引用的字体。尽管我努力强迫它们,但三种标准字体(Times New Roman,Courier和DejaVu)都不会嵌入。我已经尝试了link上的所有内容,甚至是here描述的旧方法。提前感谢您提供的任何输入。

我尝试修改fop.xconf的示例

<font embed-url="file:///C:/WINNT/Fonts/TIMES.TTF">
    <font-triplet name="Times Embed" style="normal" weight="normal"/>
</font>
<font embed-url="file:///C:/WINNT/Fonts/TIMESI.TTF">
    <font-triplet name="Times Embed I" style="italic" weight="normal"/>
</font>   

<!-- Times Roman -->
<font>
  <afp-font name="Times Roman" type="raster" codepage="T1V10500" encoding="Cp500">
    <afp-raster-font size="6" characterset="C0N20060" base14-font="TimesRoman"/>
    <afp-raster-font size="7" characterset="C0N20070" base14-font="TimesRoman"/>
    <afp-raster-font size="8" characterset="C0N20080" base14-font="TimesRoman"/>
    <afp-raster-font size="9" characterset="C0N20090" base14-font="TimesRoman"/>
    <afp-raster-font size="10" characterset="C0N20000" base14-font="TimesRoman"/>
    <afp-raster-font size="11" characterset="C0N200A0" base14-font="TimesRoman"/>
    <afp-raster-font size="12" characterset="C0N200B0" base14-font="TimesRoman"/>
    <afp-raster-font size="14" characterset="C0N200D0" base14-font="TimesRoman"/>
    <afp-raster-font size="16" characterset="C0N200F0" base14-font="TimesRoman"/>
    <afp-raster-font size="18" characterset="C0N200H0" base14-font="TimesRoman"/>
    <afp-raster-font size="20" characterset="C0N200J0" base14-font="TimesRoman"/>
    <afp-raster-font size="24" characterset="C0N200N0" base14-font="TimesRoman"/>
    <afp-raster-font size="30" characterset="C0N200T0" base14-font="TimesRoman"/>
    <afp-raster-font size="36" characterset="C0N200Z0" base14-font="TimesRoman"/>
  </afp-font>
    <font-triplet name="Times" style="normal" weight="normal"/>
    <font-triplet name="TimesRoman" style="normal" weight="normal"/>
    <font-triplet name="Times Roman" style="normal" weight="normal"/>
    <font-triplet name="Times-Roman" style="normal" weight="normal"/>
    <font-triplet name="Times New Roman" style="normal" weight="normal"/>
    <font-triplet name="TimesNewRoman" style="normal" weight="normal"/>
    <font-triplet name="serif" style="normal" weight="normal"/>
  </font>

1 个答案:

答案 0 :(得分:1)

如果他们本身不需要收到“pdf”,您可以将其转换为PCL,这只不过是对如何打印文件的描述。根据维基百科,它是“打印机语言的DeFacto标准”。 Ghostscript可以为你http://www.ghostscript.com/免费开源等等......

http://sourceforge.net/projects/ghostscript/forums/forum/5451/topic/3096129 - 有关如何进行pdf到pcl转换的有用说明:)

我希望这有帮助,我感到痛苦:)