5 Replies Latest reply on Jul 2, 2015 1:47 PM by muifarlo

    ORDS and arabic characters

    muifarlo

      Hi,

       

      I'm using ORDS for the generation of PDF for APEX reports.

      My problem is that database contains arabic words and the generated PDF files don't show the arabic charaters that are shown by the APEX report but ##### instead.

      The ORDS is running on a Tomcat 8 but I also tried it with the ORDS in the standalone mode. Same result.

       

      In the Tomcat logs I see warnings that the font used by ORDS doesn't contain the arabic characters:

           org.apache.fop.events.LoggingEventListener.processEvent Glyph "ب" (0x628, afii57416) not available in font "Helvetica"

       

      The data that which is generated by APEX contains the arabic characters:

        <?xml version="1.0" encoding="UTF-8"?>

        <apexListnerFOP>

          <DOCUMENT>

          <ROWSET>

            <ROW>

               <BRAND>بي ام دبليو</BRAND>

               <COLOR>ابيض حليبي</COLOR>

       

      So far I haven't found any hint how and where I could change the font used by ORDS.

      I also tried to set the encoding through Java options "-Djava.encoding=UTF-8" 

       

      Does anyone know how to change the font settings for ORDS?

       

      Regards

      Michael

        • 1. Re: ORDS and arabic characters
          Kiran Pawar

          Hi Michael,

          muifarlo wrote:


          I'm using ORDS for the generation of PDF for APEX reports.

          My problem is that database contains arabic words and the generated PDF files don't show the arabic charaters that are shown by the APEX report but ##### instead.

          The ORDS is running on a Tomcat 8 but I also tried it with the ORDS in the standalone mode. Same result.

          In the Tomcat logs I see warnings that the font used by ORDS doesn't contain the arabic characters:

              org.apache.fop.events.LoggingEventListener.processEvent Glyph "ب" (0x628, afii57416) not available in font "Helvetica"

          So far I haven't found any hint how and where I could change the font used by ORDS.

          I also tried to set the encoding through Java options "-Djava.encoding=UTF-8"

          Does anyone know how to change the font settings for ORDS?

              Do you happen to see the following white-paper : http://www.oracle.com/technetwork/developer-tools/apex/learnmore/custom-pdf-reports-1953918.pdf

              The "Prerequisites" section has a note:

          Note: APEX Listener 2.0.2 supports only the Base - 14 fonts. To configure additional fonts, see this document: http://xmlgraphics.apache.org/fop/0.95/fonts.html

              And regarding changing font settings for ORDS, the following thread might also help : Apex Listener prints ### instead of cyrillic symbols

           

          Regards,

          Kiran

          • 2. Re: ORDS and arabic characters
            muifarlo

            Hi Kiran,

             

            I have seen the thread "Apex Listener prints ### instead of cyrillic symbols" and I have tried it prior writing here

            but it didn't have any effect on Oracle Rest Data Service 3.0.1.

             

            For some reason ORDS decides/chooses to use font "Helvetica". Why "Helvetica" and not "Arial"?

            The Tomcat8 & Oracle APEX is running on Windows Server 2008 and there exists now font "Helvetica" in the Windows font folder "C:\Windows\Fonts"

            Windows does not support font "Helvetica" by default. If you want to use that font you have to buy it from 3rd party.

             

            So the question is where I can define/switch to use font "Arial" instead. It can't be that ORDS decides on itself which font it uses.

             

            Regards

            Michael

            • 3. Re: ORDS and arabic characters
              muifarlo

              Hi Kiran,

               

              I found a listing that describes the possible settings of the default.xml config file

              https://docs.oracle.com/cd/E56351_01/doc.30/e56293/config_file.htm

              The parameter "fop.configfile" is not described and although I have added the parameter anyway

              the content of the referenced fop.xml is not considered at all.

               

              Regards

              Michael

              • 4. Re: Re: ORDS and arabic characters
                Kiran Pawar

                Hi Michael,

                muifarlo wrote:


                I found a listing that describes the possible settings of the default.xml config file

                https://docs.oracle.com/cd/E56351_01/doc.30/e56293/config_file.htm

                The parameter "fop.configfile" is not described and although I have added the parameter anyway

                the content of the referenced fop.xml is not considered at all.

                    Yes, the Oracle Documentation says nothing about the parameter "fop.configfile", but the Oracle White Paper suggests that there is way to add fonts.

                Do you happen to see the following white-paper : http://www.oracle.com/technetwork/developer-tools/apex/learnmore/custom-pdf-reports-1953918.pdf

                The "Prerequisites" section has a note:

                Note: APEX Listener 2.0.2 supports only the Base - 14 fonts. To configure additional fonts, see this document: http://xmlgraphics.apache.org/fop/0.95/fonts.html

                     So, I suggest that your should raise SR with Oracle Support for this issue.

                 

                Regards,

                Kiran

                • 5. Re: ORDS and arabic characters
                  muifarlo

                  Hi Kiran,

                   

                  I managed to get it working but I'm not sure that the deployment package of Oracle Rest Data Service 3.0.1 is correct.

                   

                  The version of Apache FOP is contained in the WAR file of Oracle Rest Data Service is version 1.0.

                  According to the Apache FOP home page https://xmlgraphics.apache.org/fop/1.1/ the support for Arabic, Hebrew and other languages was added in version 1.1

                   

                  "This is Version 1.1 of Apache FOP. FOP 1.1 contains many bug fixes and a number of improvements, including important features such as support for

                  Complex Scripts (e.g., Arabic, Hebrew, Indic, and Southeast Asian scripts)."

                   

                  So I replaced the FOP jar 1.0 by version 1.1 and "xmlgraphics-commons-1.4.jar" with "xmlgraphics-commons-1.5.jar".

                   

                  In the config file "defaults.xml" I added this entry:

                  <entry key="fop.configfile">E:\OracleRestDataService\config\ords\fop.xml</entry>

                   

                  In the FOP config file "fop.xml" I added a mapping from Helvetica to Arial:

                   

                  <fop version="1.0" encoding="UTF-8">

                    <strict-configuration>true</strict-configuration>

                    <fonts>

                      <substitutions>

                           <substitution>

                              <from font-family="Helvetica" />

                              <to font-family="Arial"  />

                           </substitution>

                      </substitutions>

                    </fonts>

                    <renderers>

                      <renderer mime="application/pdf">

                        <filterList>

                          <value>flate</value>

                        </filterList>

                        <fonts>                          

                          <font kerning="yes" embed-url="C:\Windows\fonts\arial.ttf">

                                <font-triplet name="Arial" style="normal" weight="normal"/>

                          </font>                    

                        </fonts>

                        <stroke-text>false</stroke-text>

                      </renderer>

                    </renderers>

                  </fop>

                   

                  Regards

                  Michael