I have an application that uses Apache FOP to generate PDF files. Everything works great, except Cyrillic letters in the generated PDF. As far as I understand, I am supposed
At the moment you are not using your configuration file, so the fonts are not configured and they are not embedded in the PDF output.
The URI
parameter in the FopFactoryBuilder
constructor is used to resolve relative URIs, not to load the configuration file.
As per embedding instructions, your code should have something similar to this:
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
...
DefaultConfigurationBuilder cfgBuilder = new DefaultConfigurationBuilder();
Configuration cfg = cfgBuilder.buildFromFile(new File("conf/conf.xml"));
FopFactoryBuilder fopFactoryBuilder = new FopFactoryBuilder(new File(".").toURI()).setConfiguration(cfg);
FopFactory fopFactory = fopFactoryBuilder.build();