0

I am using XSLT to transform XML to XSL-FO and then create PDF from it (using Apache FOP). Unfortunately I have HTML encoded letters in XML like:

<TAG>wp&#322;yw</TAG>

How can I have Ł instead of &#322; in my output PDF?

alex
  • 10,900
  • 15
  • 70
  • 100
  • Maybe this can help you : http://stackoverflow.com/questions/17956218/xsl-fo-foreign-characters-polish-unicode-in-apache-fop-v-1-1 – potame Apr 23 '15 at 09:09
  • It seems to work properly. What is the Font face you want to use (Arial, Helvetica, ...)? Have you check it is installed on your computer? – potame Apr 23 '15 at 10:14
  • @potame I tried both Arial and Times. They are both installed. – alex Apr 23 '15 at 10:19

1 Answers1

0

It seems that configuration of FOP is not properly set. Edit or duplicate the file fop.xconf that you will find in the conf folder within your FOP installation directory.

In this file, locate the <renderer mime="application/pdf"> tag. Inside the <fonts> child tag, add <auto-detect/>. You should obtains a <renderer> configuration like this (I have removed all the commented text):

<renderer mime="application/pdf">
  <filterList>
    <!-- provides compression using zlib flate (default is on) -->
    <value>flate</value>

    <!-- encodes binary data into printable ascii characters (default off)
         This provides about a 4:5 expansion of data size -->
    <!-- <value>ascii-85</value> -->

    <!-- encodes binary data with hex representation (default off)
         This filter is not recommended as it doubles the data size -->
    <!-- <value>ascii-hex</value> -->
  </filterList>

  <fonts>
    <!-- ... lots of commented stuff in here ... -->

    <auto-detect/>

  </fonts>
</renderer>

Then you should invoke the fop command with the -c option, e.g.

 fop -c path/to/file/fop.xconf myfile.fo myfileout.pdf

And it should work properly (assuming the font face can properly render the specific character).

potame
  • 7,597
  • 4
  • 26
  • 33