Tuesday, March 17, 2015

EBS 12.2 -- Turkish Character problem in RDF - > PDF reports , garbage junk characters

In standard/default EBS 12.2 configuration, getting Reports PDF outputs which contain special characters(like turkish characters) is not supported.
That is ; by default you can not produce proper Report PDF outputs through Concurrent Requests if your characterset contains special characters.

In 12.2, Oracle Reports PDF is supported only for US7ASCII, WE8ISO8859P1 and WE8MSWIN1252 charactersets.

So, in order to get Oracle Reports PDF outputs, Oracle recommends using BI Publisher if your characterset is different than those 3 charactersets above.

On the other hand; there are solutions for getting proper PDF outputs from the Concurrent Programs which uses Oracle Reports in EBS 12.2..

Lets take a look at the related documents:

Ok here is a bunch of documents related to our subject..

Troubleshooting Guide for Font Aliasing / Font Subsetting / Font Embedding Issues (Doc ID 350971.1)
How to Know if Font Subsetting / Font Embedding Has Been Used by Oracle Reports when Generating a PDF output (Doc ID 882227.1)
How to Display Polish Language Specific Characters Correctly in PDF Report Output in Reports 11g (Doc ID 876163.1)
Master Note for Font Issues in Oracle Reports (Doc ID 1297012.1)

So, when you analyze these docs, you will see that what we need to do to solve this, is Font subsetting or Font Embedding..

Before giving the solution; lets review the related process in Oracle Reports;

When the report is run, first the reports engine looks in uifont.ali if there is a font mapping to be applied for the specified fonts.
Then it looks in the uiprint.txt file for the printer defined in TK_PRINTER and
in turn examines the PPD file which the uiprint.txt entry points to. The PPD is
a printer definition file with a lot of information about the capabilities of a
certain printer.
Finally it is necessary to provide an AFM file for each of the fonts
which contains the font metrics for the reports engine to generate the output
correct.


So,
In order to be able to format the output, Reports MUST have access to Font Metric information (AFM files for a "Postscript Printer" environment).
If "Font Metric" information is not available for a Font used in a report, Reports will "alias" this font with another Font for which Font Metric Information is available.
The file uifont.ali may be used to give "directives" for the font aliasing.
If there are no directives for a Font or if the directives cannot be used, Oracle Reports will look for the nearest matching font under the same character set which can be used instead.
This problem may occur when you develop your reports on a given platform type (Windows) and deploy it on another platform type (UNIX).



So, with the help the info above, it is not hard to say that our solution and thus our action plan will be against font files(ttf), uifont.ali and AFM files.

Note that: Following action plan was prepared for a Turkish EBS 12.2 environment.. 

In that environment , before correcting the AFM files, Reports PDF outputs were displayed with Greek characters ..
After correcting the AFM files, turkish characters were displayed as garbage characters.
Finally, after copying font files and modifying uifont.ali properly, the character problems were dissapeared.

Copy the font files ;

What we need to do is; make the reports executable to see and reach the necessary font files..
In case of turkish report "ALBANWTJ.ttf" font file can be used for this.
Just, cd $AU_TOP/resource and cp ALBANWTJ.ttf (or all the ttf files ) to one of the directorişes defined in $REPORTS_PATH.

Modify the uifont.ali;

Modify the uifont.ali file according to the fonts you used in the problematic Report..
Just open the report using a PDF viewer, and look for the fonts used in it. 
Note them down and make the necessary font mappings in uifont.ali..

cd $ORACLE_HOME/guicommon/tk/admin
vi uifont.ali

Add the mappings just after the PDF Subset Section;
For example, here I have mapped all the courier and Times fonts to the ALBANWTJ.ttf font, which includes turkish fonts..

[ PDF:Subset ]
Courier..... = "ALBANWTJ.ttf"
Times..... = "ALBANWTJ.ttf"

Once you are done with editing uifont.ali; control/check the uifont.ali file using mfontchk tool.

Linux with applmgr user> mfontchk
Parsing font alias file "/u01/install/APPS/fs2/EBSapps/10.1.2/guicommon/tk/admin/uifont.ali"

Successfully parsed font alias file

Correct AFM files;
The need is explained in the following document:
Symbol Characters ("Greek") Instead Of Expected Characters Are Displayed in Reports or Reports Parameter Form (Doc ID 300416.1)

So, set the EncodingScheme property in the font AFM file used to"FontSpecific" instead of "AdobeStandardEncoding" 

execute the following script;

#!/bin/sh
cd $ORACLE_HOME/guicommon/tk/admin/
mkdir AFM2
cd AFM 
for filename in *
do
sed "s/EncodingScheme AdobeStandardEncoding/EncodingScheme FontSpecific/" $filename > ../AFM2/$filename
done
cd ..
mv AFM AFM_org_bck
mv AFM2 AFM

Once everyting is configured properly, it is good to restart concurrent managers (just in case)
When your report will display the characters properly, just open the document in Acrobat Reader and display the fonts, you will see that font subsetting works :)

Before font subsetting :
As you see below, fonts are not changed to ALBANWTJ, also the output had junk characters.


After  a successful font subsetting:  The fonts are mapped to ALBANWTJ and no more Turkish character problems in the output.


9 comments :

  1. Thanks Erman for your great info.

    But I want to print reports on continuous forms on Epson LQ-2190 dot matrix printer.
    The font is very bad. How to resolve this issue?

    ReplyDelete
  2. Thanks Erman for your great info.

    But I want to print reports on continuous forms on Epson LQ-2190 dot matrix printer.
    The font is very bad. How to resolve this issue?

    ReplyDelete
  3. Hi Ilyas,

    What do you mean by continuous Forms?

    ReplyDelete
  4. Make sure your Printer is configured properly with a characterset containing the characters you are trying to print and also make sure you are using the correct OS driver for your printer.

    ReplyDelete
  5. Hi Erman,

    Thanks for Sharing your thoughts on how to print Multi Language using Oracle Report. We have exact situation where our report is currently getting the output in English version of PDF but we need to use the same report to print the Lables in English and Polish.

    We tried to change the report (using report builder 10g) and modified the lables in English and Polish (WayBill pasazerów
    ).

    But the output we are getting it as pasazerów

    I appreciate your inputs on this.

    Krishna

    ReplyDelete
  6. Hi Krishna,

    Did you try to solution suggested above? I mean the solution which is based on modifying the server side font files(ttf), uifont.ali and AFM files...

    ReplyDelete
  7. Hi Erman,

    Thanks for your reply.

    I am concerned about following commands where it may effect existing working Eglish version of the PDFs.



    cd $ORACLE_HOME/guicommon/tk/admin
    mkdir AFM2
    cd AFM

    #!/bin/sh
    for filename in *
    do
    sed "s/EncodingScheme AdobeStandardEncoding/EncodingScheme FontSpecific/" $filename > ./AFM2/$FILENAME

    done
    mv AFM AFM_org_bck
    mv AFM2 AFM


    I did the following.



    Step1

    downloded "Nadyezhda.ttf" from internet and placed in $OH/gui*/tk/admin/AFM

    Step2

    I have added in $OH/gui*/tk/admin/uifont.ali

    [ PDF:Subset ]
    Times="Nadyezhda"

    Step3: Bounced concurrent Manager

    Stpep4: In Report builder I used the font "Nadyezhda" where I need the Polish Characters.

    Step 5: Run the report in Oracle EBS

    Please advise if I am missing any steps.

    Thanks for your help.

    ReplyDelete
  8. I am wondering if we change only on one font "Nadyezhda" by replacing the Encoding scheme with Font specfic instead of changing all the fonts?

    ReplyDelete
  9. First,

    The TTF files should be available in REPORTS_PATH , so either copy the TTF files to a directory in REPORTS_PATH or add the directory of TTF files to the REPORTS_PATH.

    Here is an example EBS 12.2 REPORTS_PATH, which is pointed by $REPORTS_PATH env variable:

    [applmgr@demoorcl ~]$ echo $REPORTS_PATH
    /u01/oracle/CLONE/fs2/EBSapps/appl/au/12.0.0/plsql:/u01/oracle/CLONE/fs2/EBSapps/appl/fnd/12.0.0/reports:/u01/oracle/CLONE/fs2/EBSapps/appl/au/12.0.0/graphs

    So, copy your ttf files to one of the directories available in your REPORTS_PATH and then rety.

    Retry with this... If it fails, then use the following to ensure font subsetting is in use ->
    How to Know if Font Subsetting / Font Embedding Has Been Used by Oracle Reports when Generating a PDF output (Doc ID 882227.1)

    2) As for uifont.ali ->

    If there is any reference for these fonts in section "Global Font Mapping", remove these settings (for Arial, Times New Roman, Courier New, there is already a mapping on Unix platforms. It is important to remove these, otherwise the subsetting will not work for these fonts even when "PDF Subsetting" area is correct)

    ReplyDelete