0

I have created PDF file from xsl file, but my cyrillic letters replaced by # symbol. What can I do? Please if you can give exact answers with exact examples. Thank you!!!

This is simple piece of my code that uses cyrillic letters:

     <fo:table-cell padding="1em" text-align="center">
        <fo:block >
          <fo:leader leader-pattern="rule" leader-length="80%" rule-    style="solid" rule-thickness="1pt" />
          <fo:block xml:lang="RU" font-family="Times New Roman" text- align="center">(подпись)</fo:block>
        </fo:block>
      </fo:table-cell>
  • Possible duplicate of [Apache FOP Displaying ### with SunSim](http://stackoverflow.com/questions/25895984/apache-fop-displaying-with-sunsim) – lfurini Oct 11 '16 at 11:34
  • You have to configure the "Times New Roman" font you want to use. – lfurini Oct 11 '16 at 11:35

1 Answers1

0

Just create .xml file

<?xml version="1.0"?>
<fop version="1.0">
<renderers>
<renderer mime="application/pdf">
    <fonts>
        <directory>C:\Windows\Fonts</directory>
    </fonts>
</renderer>
</renderers>
</fop>

And add this two lines of code in your java file:

File userConfig = new File("src/main/java/view/userConfig.xml");
FopFactory fopFactory = FopFactory.newInstance(userConfig);
  • Note that FOP will take some time to configure all the fonts in `C:\Windows\Fonts` (only the first time, though). – lfurini Oct 12 '16 at 17:58