0

I am using Apache FO in Java to generate PDF from XML. I have used TTF file format font in my code. But now I have to use OTF format.

I referred many URL's to get info how to create datamatrix for a OTF font. But could not find any.

Could someone tell me how to integrate OTF type format in XSL FO to generate PDF. Attaching the font documentation provided by apache.

Anant666
  • 416
  • 9
  • 26
  • 1
    What FOP Version are you using? Have you tried simply adding the OTF fonts to the config? Are you generating some more special pdf like PDF/Axxx? – Stefan Hegny Jun 12 '17 at 08:47
  • No there's nothing special about the PDF. It's just a .pdf extension. I am using version 2.0 for FOP – Anant666 Jun 12 '17 at 09:34
  • I haven't tried adding OTF font as it is into the fop.config file. The way by which I think we can do that is by creating the font datamatrix and placing the XML file into the fop.xconf file – Anant666 Jun 12 '17 at 09:41
  • right now I am referring [this](https://stackoverflow.com/questions/29379281/xsl-fo-how-to-add-helvetica-neue-fonts-and-output-to-pdf) – Anant666 Jun 12 '17 at 09:45
  • Font metrics (the XML files you are talking about) are **no more needed** in recent versions of FOP; the question you linked refers to an older version. You just have to configure the font in `fop.xconf`. – lfurini Jun 12 '17 at 09:48
  • @lfurini could you point at some URL which could help me to configure OTF font in fop.xconf file – Anant666 Jun 12 '17 at 09:59
  • Hello all I think I was wrong about the fop version. I opened the fop.xconf file which showed me which means we are using an older version for fop. – Anant666 Jun 12 '17 at 10:01
  • 1
    That version only refers to the configuration file format, it is *not* the version of FOP. If you don't know which FOP version you are using, type `fop -version` in a prompt from FOP's folder, latest FOP version is 2.2. OTF fonts can be configured just like "normal" TTF fonts, you can see [this old answer of mine](https://stackoverflow.com/a/28251945/4453460) for more details. – lfurini Jun 12 '17 at 10:25

0 Answers0