Version User Scope of changes
Jun 17 2008, 6:34 PM EDT (current) jayaramanvs
Jun 17 2008, 6:28 PM EDT jayaramanvs 6 words added, 23 words deleted

Changes

Key:  Additions   Deletions
Installing MICR fonts in Oracle Apps.

Objective: To install MICR fonts so that oracle apps check printing program. MICR is Magnetic Ink Character Recognition. It is used in printing bank routing/account and check numbers to track and process bank checks. Using XML Publisher is straightforward but there are times that we can’t afford to use it. This document caters specifically for those configurations, which can’t use XML Publisher
Font basics
  • All licensed font come with 5type of files. If font has 3weights (normal, bold, italics) then you will have 3x5=15 files.
  • Each weight will have a separate font file.
  • Fonts are of two types by format – Type1 and TrueType. Nowadays unix systems support both Type1 and Truetype font files.
  • Truetype font files are with extension .ttf
  • Type1 font files comes in 3files : .AFM, .PFA, PFB (AFM – Adobe Font Metrics).
  • Spaces in fontnames will cause problems. Try to avoid using fonts which have spaces in names.
  • Spaces are removed in Unix at font names ->”PrecisionID MICR Demo” will be known as “PrecisionIDMICRDemo”. Unix also has quirky behaviour of converting everything to lower case. So you might be needed to setup alias at different levels. If possible, select font which doesn’t have any space in name.
Fonts used: IDAutomation® ‘s font IDAutomationMICR font. Size 12.

1 Installing fonts at various levels
2 On developer’s laptop
3 On unix.
4 On Oracle Apps level
4.1 Systems checks
4.2 For viewing proper PDF output
4.3 For printing in proper MICR font format
4.3.1 System design
4.3.2 Edit PASTA and printer files
4.3.3 Option1: Setup through pdftops
4.3.4 Option2: Setup through pd2ps - Ghostscript
4.3.5 Option3: Setup through acroread.
5 Configuring oracle apps printer setup
5.1 Create a new printer style called “Check Publisher”
5.2 Create a new printer driver “PASTA_CHECK”
5.3 Add printer style and printer driver to printer type
5.4 Configure concurrent programs
6 Appendix 15
6.1 Appexdix 1-A: Launching Reports6i from oracle apps tier
6.2 Appendix 1-B: micr2ps
6.3 Troubleshooting
7NOTES and REFERENCES 20

1 Installing fonts at various levels Generally fontfiles needs to be installed in 4places
  • On the laptop of developer or output viewing person
  • On unix
  • On Oracle Apps
  • On printer – in our case it’s not possible.

Sno Task level Person Time taken in last run (excl. troubleshooting)
1 On developer laptop Developer 1min
2 On unix level Unix system admin 10mins
3 On Oracle apps level AppsDBA/Sysadmin 40mins/10mins
4 On printer level -NA- -NA-
2 On developer’s laptop Give the .ttf files to the developer. Go to Start->Control Panel ->Fonts. Paste the ttf font file on the font folder. 3 On unix. a) Once you have downloaded the font files in your laptop. Open the .pfa file in Notepad. If the contents come in continous lines, it should be saved in MS-DOS/ASCII format. b) If it is continous format, open the .pfa file in Wordpad. Save it as MS-DOS/ASCII file format. c) ftp the files (.AFM,.PFA, .PFB) to the server using ascii format
C:\> ftp hom204.cvrd.br ftp> mkdir /tmp/micr_font_dir ftp> ascii ftp> put XXXX.afm ftp> put XXXX.pfa ftp> put XXXX.pfb ftp> bye
d) Ask the Unix admin to install the fonts. Fonts are tied to DISPLAY server. That means its perfectly possible that you might not be able to see fonts installed if you are using different DISPLAY variable (eventhough you are using just terminal not GUI).
What unix admins normally do? Its always better to ask unix admin to do, even if you have root access, as they know font standards for the system better. If you want to do by yourself, you are attempting the following at your own risk. a) export PATH=$PATH:/usr/openwin/bin b) export DISPLAY=hom204:1.0 – Reports server should be using the same display server. c) xset –q --It lists the font directories
bash-2.05$ export PATH=$PATH:/usr/openwin/bin bash-2.05$ xset -q Keyboard Control: auto repeat: on key click percent: 0 LED mask: 00000000 auto repeating keys: 00f0af03e0ff77f2 ff7bf0ff1ff8df03 1100000000000000 0000000000000000 bell percent: 50 bell pitch: 400 bell duration: 100 Pointer Control: acceleration: 2/1 threshold: 4 Screen Saver: prefer blanking: yes allow exposures: yes timeout: 600 cycle: 600 Colors: default colormap: 0x21 BlackPixel: 1 WhitePixel: 0 Font Path: /usr/openwin/lib/X11/fonts/Type1/,/usr/openwin/lib/X11/fonts/Type1/sun/,
/usr/openwin/lib/X11/fonts/F3bitmaps/,/usr/openwin/lib/X11/fonts/Speedo/,
/usr/openwin/lib/X11/fonts/misc/,/usr/openwin/lib/X11/fonts/75dpi/,/usr/open
win/lib/X11/fonts/100dpi/,/etc/openwin/fontadm_fonts/,/usr/sfw/share/ghost
script/fonts/,/usr/openwin/lib/locale/zh_TW.BIG5/X11/fonts/TT/,/usr/openwi
n/lib/locale/zh/X11/fonts/TrueType/,
Bug Mode: compatibility mode is disabled DPMS (Energy Star): Display is not capable of DPMS FBPM (Frame Buffer Power Management): System is not capable of FBPM
d) Copy the font files (.afm,.pfa,.pfb) in one of the appropriate directories. e) In fonts.dir and fonts.scale file (these would be present inside every font dir listed in xset –q), add the following lines f) IDAutomationMICR.pfa -adobe-idautomationmicr-r-normal--0-0-0-0-m-0-iso8859-1 g) Increase the count on the first line of the file by 1 : eg 89 to 90 h) Make sure you stress to Unix admin that it should be ISO8859-1 format. Oracle apps wont recognise any other format. i) Save both the files – fonts.dir and fonts.scale. j) Rehash all the font files using : xset fp rehash k) Clear all the cache using: fc-cache –f l) Bounce the display server m) Check if the font is listed using: xlsfonts –u | grep micr
bash-2.05$ xlsfonts -u | grep micr -adobe-idautomationmicr-normal-r-normal--0-0-0-0-m-0-iso8859-1


4 On Oracle Apps level

4.1 Systems checks

a) First check if the font is installed properly a. export PATH=$PATH:/usr/openwin/bin b. export DISPLAY=hom204:1.0 c. xlsfonts – u | grep micr
bash-2.05$ xlsfonts -u | grep micr -adobe-idautomationmicr-normal-r-normal--0-0-0-0-m-0-iso8859-1
If you want to check if rdf contains proper fontnames, check Appexdix 1-A: Launching Reports6i from oracle apps tier

4.2 For viewing proper PDF output

Oracle reports uses built in Oracle PDF driver to create pdfs. If PDF driver doesn’t find fonts it will substitute someother fonts in pdf. So it is necessary to have font files available at $ORACLE_HOME too and map to proper fontnames (as unix converts all font entries to lowercase) a) cd $ORACLE_HOME/guicommon6/tk60/admin b) vi uifont.ali c) Edit [Global] to put lowercase to actualcase mapping
#=============================================================== [ Global ] # Put mappings for all surfaces here. idautomationmicr = IDAutomationMICR
d) cd $ORACLE_HOME/guicommon6/tk60/admin/AFM e) cp $<FONT_FTPDIR>/IDAutomationMICR.adm IDAutomationMICR – Files under AFM dir do not have .afm extension
bash-2.05$ pwd /proj02/ebsdev/product/806/guicommon6/tk60/admin/AFM bash-2.05$ ls -ld IDAutomationMICR -rwxr-xr-x 1 appebsdev dba 4807 Mar 17 15:11 IDAutomationMICR

4.3 For printing in proper MICR font format

Unfortunately we werent allowed install MICR fonts in printer directly. So we need to send font files along with the postscript files. So we have two steps in this area a) Embed the fontfiles in the output files b) Convert the pdf into postscript files. Now for the constraints, a) PDF printing can’t be done directly. Oracle apps doesn’t have facility. You need to use pasta printing setup along with thirdparty tools b) We need to use freeware utlity to convert pdf to postscript. This comes to 3 options discussed in metalink notes. a. Pdf2ps – www.ghostscript.com b. Pdftops –www.foolabs.com c. Acroread – www.adobe.com

4.3.1 System design

Reports Oracle apps printing setup Uifont.ali uiprint.txt pasta_check.cfg
Oracle pdf drv
PASTA
Reports6i


Pdf file
Pdftops/pdf2ps


~/.xpdfrc default.ppd Ps file PRINTER Greenfile – output files from preceding stage Bluefile - configuration file used in the current stage

4.3.2 Edit PASTA and printer files

a) Identify which printer you want to test. Eg RBPN12A
b)
Check if printer is setup in unix level using: lpstat –a RBPN12A

appebsdev@hom204 $ lpstat –a I840 accepting requests since Mar 18 15:06 2008 Q853 accepting requests since Mar 18 15:06 2008 W094 accepting requests since Mar 18 15:06 2008 RBPN12A accepting requests since Mar 18 15:06 2008 RBPN12B accepting requests since Mar 18 15:06 2008 HP4050 accepting requests since Mar 18 15:06 2008 P450 accepting requests since Mar 18 15:06 2008 P435 accepting requests since Mar 18 15:06 2008 P493 accepting requests since Mar 18 15:06 2008 PCDD accepting requests since Mar 18 15:06 2008 TLP2824 accepting requests since Mar 18 15:06 2008 pt450 accepting requests since Mar 18 15:06 2008 yp450t accepting requests since Mar 18 15:06 2008 yp435 accepting requests since Mar 18 15:06 2008 yp493 accepting requests since Mar 18 15:06 2008 ypcdd accepting requests since Mar 18 15:06 2008
c) Test the printer d) echo “Hello” > testfile e) lpr –P RBPN12A testfile
appebsdev@hom204 $ echo "hello" > testfile appebsdev@hom204 $ lpr -P RBPN12A testfile ;lpstat -p RBPN12A printer RBPN12A faulted printing RBPN12A-0. enabled since Mar 18 15:14 2008. available. Windows LPD Server Printer \\10.32.192.200\RBPN12A Owner Status Jobname Job-Id Size Pages Priority ---------------------------------------------------------------------------- appebsdev ( Waiting testfile 254 6 0 1
f) If printout comes then the printer is good at unix level. g) Now configure Oracle Apps printer setup for PASTA. h) (Note 356501.1 "How to Setup Pasta Quickly and Effectively".) i) Configure your $ORACLE_HOME/guicommon6/tk60/admin/uiprint.txt for your identified printer. If your printer manufacturer didn’t give ppd file, you can use default.ppd.
#Not A Printer:ASCII:1:Configure your uiprint.txt file:none: RBPN12A:PostScript2::rbpn12a.ppd
j) When a tool converts from pdf to ps it uses ppd file (postscript printer defintion) for the particular printer it is going to send. If it can’t find a particular ppd file it will use default.ppd. k) If you are using manufacturer ppd file, copy the IDAutomationMICR line mentioned in the below step 4.3.2.l.c l) If you are using default.ppd a. $ORACLE_HOME/guicommon6/tk60/admin/PPD b. cp data462.ppd data462check.ppd c. Vi data462check.ppd and add your fontline IDAutomationMICR
*% Font Information ===================== *DefaultFont: Courier *Font Courier: Standard "(001.004)" Standard ROM *Font Courier-Bold: Standard "(001.001)" Standard ROM *Font Courier-BoldOblique: Standard "(001.001)" Standard ROM *Font Courier-Oblique: Standard "(001.001)" Standard ROM *Font Helvetica: Standard "(001.001)" Standard ROM *Font Helvetica-Bold: Standard "(001.001)" Standard ROM *Font Helvetica-BoldOblique: Standard "(001.001)" Standard ROM *Font Helvetica-Oblique: Standard "(001.001)" Standard ROM *Font Symbol: Special "(001.001)" Special ROM *Font IDAutomationMICR: Standard "(001.001)" Standard ROM *Font Times-Bold: Standard "(001.001)" Standard ROM *Font Times-BoldItalic: Standard "(001.001)" Standard ROM *Font Times-Italic: Standard "(001.001)" Standard ROM *Font Times-Roman: Standard "(001.001)" Standard ROM *?FontQuery: " save /str 100 string dup 0 (fonts/) putinterval def
d. cp default.ppd defaultcheck.ppd -- e. vi defaultcheck.ppd f. Change the “Include” in the beginning of the file from data462.ppd to data462check.ppd. g. Vi uiprint.txt to change the printers default.ppd to defaultcheck.ppd m) Now you need to install either acroread, pdf2ps or pdftops.

4.3.3 Option1: Setup through pdftops

a) Download pdftops (xpdf) for solaris from www.foolabs.com
b)
Go through INSTALL file and ask Unixadmin to install under /usr/local/bin

c) cp $<XPDF_INSTALL_DIR>/sample-xpdfrc $HOME/.xpdfrc
d)
vi $HOME/.xpdfrc

e) Add two important parameters. – list of font directories and enable font embedding
[snip] fontDir /usr/openwin/lib/X11/fonts/misc fontDir /usr/openwin/lib/X11/fonts/TrueType [snip] #urlCommand "netscape -remote 'openURL(%s)'" psEmbedType1Fonts yes
f) cd $FND_TOP/resource/
g) cp pasta.cfg pasta_check.cfg
h)
vi pasta_check.cfg

i)
Under preprocessing enable pdftops by removing semicolon in the beginning of the line.

%%%% ======== Default settings ==================== %%%%
%% The options in this default section can be overridden by the options

%% in the language and territory sections below. [DEFAULT] [..snipped…]
% Preprocess for PDF output

% This is an example for PDF output to print.

; Xpdf
preprocess=pdftops {infile} {outfile}
; Ghost Script

; preprocess=pdf2ps {infile} {outfile}

; Acrobat

; preprocess=acroread -toPostScript -pairs {infile} {outfile}

4.3.4 Option2: Setup through pd2ps - Ghostscript

a) Download ghostscript from www.ghostscript.com
b) Go through installation instructions and ask unix admin to install the ghostscript.
c) Ghostscript (a.k.a gs) works well with ttf files
d) vi $ORACLE_HOME/bin/micr2ps
e)
Copy and paste the script as in Appendix 1-B: micr2ps

f) mkdir /export/home/appsebsdev/fonts/
g) Copy IDAutomationMICR.ttf to /export/home/appsebsdev/fonts/
h)
cd $FND_TOP/resource/

i) cp pasta.cfg pasta_check.cfg
j) vi pasta_check.cfg
k) Under preprocessing section, copy pdf2ps line. And change pdf2ps to micr2ps and remove the semicolon in beginning of the line.
%%%% ================= Default settings ============================ %%%% %% The options in this default section can be overridden by the options %% in the language and territory sections below. [DEFAULT] [..snipped…] % Preprocess for PDF output % This is an example for PDF output to print. ; Xpdf ; preprocess=pdftops {infile} {outfile} ; Ghost Script ; preprocess=pdf2ps {infile} {outfile} preprocess=micr2ps {infile} {outfile} ; Acrobat ; preprocess=acroread -toPostScript -pairs {infile} {outfile}

4.3.5 Option3: Setup through acroread.

a) It has not been tested, as acroread could not embed fonts. Make sure you bounce both the CM and Report server at this point to reflect at Oracle apps level
5 Configuring oracle apps printer setup

5.1 Create a new printer style called “Check Publisher”

System Administrator(R)-->Install->Printers->Style

5.2 Create a new printer driver “PASTA_CHECK”

System Administrator(R)-->Install->Printers->Driver Arguments: -pn$PROFILES$.PRINTER -f$PROFILES$.FILENAME -c$PROFILES$.CONC_COPIES -Fpasta_check.cfg

5.3 Add printer style and printer driver to printer type

System Administrator(R)-->Install->Printers->Type Query for “–PASTA%” under Printer type Insert a new record under printer drivers Style: Check Publisher Driver: PASTA_CHECK

5.4 Configure concurrent programs

System Administrator(R)-->Concurrent->Program->Define Change Output format: PDF Output Style: Check Publisher Output Printer: RBPN12A You should be all set to view outputs and print outputs in MICR!!!

6 Appendix

6.1 Appexdix 1-A: Launching Reports6i from oracle apps tier




6.2 Appendix 1-B: micr2ps


#!/bin/sh #
$Id: pdf2ps 8107 2007-07-05 19:04:29Z till $

# Convert PDF to PostScript.

# This definition is changed on install to match the
# executable name set in the makefile GS_EXECUTABLE=gs
gs="<REPLACE_WITH_GS_EXEC_PATH>"

if test ! -x "$gs"; then
gs="$GS_EXECUTABLE"
fi
GS_EXECUTABLE="$gs"
OPTIONS=""
while true

do

case "$1" in
-?*) OPTIONS="$OPTIONS
$1" ;;
*) break ;;
esac
shift done
if [ $# -eq 2 ]
then
outfile=$2
elif [ $# -eq 1 ]
then
outfile=`basename "$1" \.pdf`.ps
temp_file=`basename "$1" \.pdf`.ts
else
echo "Usage: `basename $0` [-dASCII85EncodePages=false] [-dLanguageLevel=1|2|3] input.pdf [output.ps]" 1>&2
exit 1

fi
# Doing an initial 'save' helps keep fonts from being flushed between pages.

# We have to include the options twice because -I only takes effect if it

# appears before other options. exec "$GS_EXECUTABLE" -q -dSAFER -dNOPAUSE -dBATCH -sDEVICE=pdfwrite "-sOutputFile=$temp_file" -sFONTPATH=/export/home/appsebsdev/fonts/ -dCompatibilityLevel =1.3 -dPDFSETTINGS=/screen -c .setpdfwrite -f "$1" exec "$GS_EXECUTABLE" $OPTIONS -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pswrite "-sOutputFile=$outfile" $OPTIONS -c save pop -f "$temp_file"



6.3 Troubleshooting

Make sure you are systematic and clear each stage before next stage. Stage1: On developer’s laptop There is no troubleshooting available as of now Stage2: On unix level Few basic checks for printer to be working 1. Check if printer is getting listed: lpstat –a 2. Check /etc/printcap or /etc/printers.conf for server address/IP address and try pinging it 3. Check the status of printer: lpstat –p <PRINTER> 4. Check by printing a textfile: lpr –P <PRINTER> <_text_file> 5. If nothing works, call unix admin Stage3: On unix/printer level Few basic checks for printer to be printing MICR fonts from unix level Problem could be either printer is not capable of printing MICR fonts even supplied to the printer (case1) or fonts are not installed in unix server properly(case2). For case1:
  1. From laptop use MICR font to type some numbers in MSWordDoc.
  2. Save the document
  3. Use PDF printer driver (like CutePDF) to print/produce pdf document.
  4. Open pdf document in Adobe reader and check File>Document Properties.->Fonts tab.
  5. Check if fonts are named with embedded tag. That proves the font files are embedded in the pdffile.
  6. ftp the pdffile to unix server.
  7. Use one of the three commands to convert it to postscript file
  8. pdftops /tmp/testfile1.pdf –output file will be /tmp/testfile1.ps
  9. pdf2ps /tmp/testfile1.pdf /tmp/testfile1.ps
  10. acroread –toPostScript /tmp/testfile1.pdf
  11. Print the file to printer: lpr –P <PRINTER> /tmp/testfile1.ps
  12. The above should print MICR font page.
For case2: Open any unix GUI text editing tool like openoffice or even use reports builder (see appendix 1-A) and check if font is getting listed in LOV. If not, call UNIX admin. Stage4: On oracle apps level
  1. export DEBUG_SLFIND=/tmp/reportfont.log
  2. export REPORTS60_NO_DUMMY_PRINTER="YES"
  3. export TK_PRINT_STATUS="echo %n is valid"
  4. cat /dev/null > /tmp/reportfont.log; rwrun60 userid=apps/orcapps2007 report=/proj02/ebsdev/applmgr/1159/xbol/11.5.0/reports/US/MODULE2.rdf batch=yes destype=file desname=/tmp/testidauto2.pdf desformat=PDF

  1. vi /tmp/reportfont.log and check the debug messages what file it is reading and where fonts are getting picked up.
  2. vi /tmp/testidauto2.pdf and check if font is properly mentioned in file or substituted.


7 NOTES and REFERENCES
Printing on Unix with Oracle Reports6i
http://download-west.oracle.com/docs/html/B10314_01/pbr_uxprt.htm#1006875

Ghostscript PDF writer tips
http://www.ghostscript.com/~ghostgum/pdftips.htm
Ghostscript Home
http://pages.cs.wisc.edu/~ghost/
Embedding fonts in linux
http://colinm.org/tips/latex
Xpdfrc man page
http://linux.die.net/man/5/xpdfrc
Pdftops man page
http://linux.die.net/man/1/pdftops
Note:333504.1: How To Print Concurrent Requests in PDF Format

Note:356501.1 How to Setup Pasta Quickly and Effectively
Note:404958.1 Understanding and Implementing direct printing of PDF using Ghostscript

Note:338990.1 How To Print XML Publisher PDF Reports Via The Concurrent Manager?

Note:419463.1 Pdf Report Prints in Portrait vs Landscape -Pdf2ps Vs Pdftops

Note:460002.1 Not Able To Print Pdf Documents

Note:204272.1 Restrictions in Reports 6i PDF output and New Features in Reports 9i/10G

Note:466531.1 How To Implement An AFM / PFA Barcode or MICR Font Within A UTF8 EBS Instance

Note:551630.1 How to setup, map, and print custom reports with a barcode / MICR font

Note:171464.1 How To Set Up OCR and Barcode Fonts To Work With Oracle Reports On UNIX?

Note:356221.1 A Practical Methodology on Porting Reports from Windows to Unix with Different Fonts