Link to home
Start Free TrialLog in
Avatar of Joana
Joana

asked on

URGENT - PDF Format

Hiya

We are running reports 6.0 on teh web.  When it downloads to PDF to view words that are in 8pt and have a 'w' go weird e.g.

Lo wer Hutt
He weria
 It leave a gap after the lower case 'w'

it does not do this for fonts in 10pt up or if the font is Times New Roman (happens for Arial)  
- easy solution would be to change the font but clients want this size and font.   Any Ideas?
Avatar of kretzschmar
kretzschmar
Flag of Germany image

seems to be a font problem
Avatar of mnicoras
mnicoras

Hi,

we have almost the same problem but with a web-based application, written and Java and using some API functions to create PDF documents. The fonts Arial is one which should be "loaded". So we need to put the OS fonts in the font directory of our application and it works. So I think that's something similar here. Take a look which fonts are already used and installed trough Reports 6.0. Hope it helps. I don't have Reports 6.0 so far, so I cannot help more than that but the behavior it's like my former problem.

best regards,
Marius Nicoras
Note that Oracle's PDF writer does not embed the fonts in the PDF. The fonts are simply labelled as "Times" or "Helvetica" and then it is up to the Acrobat Reader to interpret them using the clients fonts.

Depending on the Acrobat Reader there is an option for showing this mapping. For example, I have 5.0 and it is under File - Document Properties - Fonts.

Having said that, the problem you may be facing is one of incorrect font metrics as well. Is the Reports server on Unix or NT? What patchsets have you applied?
The problem may also be one of font translation.

Your developer may have one set of fonts, and your server may have another. Note that fonts are like software programs, they have versions and they can have bugs!!! For example, the metric on the "W" for the font on the reports server may be incorrect.

Microsoft provides a tool for viewing the version details of a font file. It is called the "Microsoft OpenType font properties extension". Check the microsoft site.

When you convert/compile, or when you open and save a report, Oracle sometimes performs font translation if it cannot find a font on the local client.

Oracle has some docs about when font translation occurs, but they're incorrect. The best way to check the font translation is to look at a report converted to text (compile the report to text rather than an REP).

Open the text file in any text editor and search for a field name such as "B_TITLE1" there are a number of fields associated with it. One will be a format tag. Search for the properties of this format tag. This should give a font name. Compare this font name to the font name you see in Reports Builder. If you have a discrepency, then you know that font translation is occurring.
Avatar of Joana

ASKER

Looked in Acrobat Reader and it does have Arial and teh report server is Unix

this error happens when the report is run from the web > saved to the cache>and then displayed on the screen>and printed out(both on screen and printout shows the space)

If saved, or printed directly to the printer, it does not happen???

Using Oracle Reports Version 6.0.8.11.3
This sounds like reports is not using the correct metrics file.

How have you set up your Arial font mapping? What have you got in the uifont.ali file and your PPD file for Arial? The PDF writer uses the current setting of the TK_PRINTER variable to determine the printer in uiprint.txt. It then matches either the [PDF] or generic section of the uifont.ali file to determine which printer font to use (which are in the PPD file for TK_PRINTER). From this, it chooses a font metrics file from your AFM directory.

Avatar of Joana

ASKER

The only file i could find on the server was the uifont.ali

tk_printer, ppd, afm, uiprint are not there

this is the uifont file -

#
# $Header: uifont.ali@@/main/2 \
# Checked in on Sun Feb 22 17:41:15 PST 1998 by hwang \
# Copyright (c) 1997, 1998 by Oracle Corporation. All Rights Reserved. \
# $ Copyr (c) 1995 Oracle
#
#  Copyright (c) Oracle Corporation 1995, 1997, 1998.
#  All Rights Reserved.

/* See readme.ali for usage instructions. */
/* MS Windows uifont.ali */

[ Global ]

"Terwinal 993".....     = "Terwinal 993".....we8iso8859p1

/* Convert JEUC to SJIS for all fonts */
.....jeuc               = .....sjis

/* Mac Fonts */
"Avant Garde"           = Arial
"New Century Schlbk"    = "Times New Roman"
"New York"              = "Times New Roman"
Bookman                 = "Times New Roman"

/* Motif fonts */

lucidatypewriter        = "Courier New"
lucidabright            = "Times New Roman"
fixed                   = "Courier New"

/* Cue card fonts */
cuecard                 = Arial.8.Plain.Medium.Normal
cuecardFixed            = "Courier New"..Plain.Medium.Normal


[ Printer ]

/* Mac Fonts */
"Avant Garde"           = "Avant Garde"
"New Century Schlbk"    = "New Century Schoolbook"

/* Motif fonts */
courier                 = "Courier New"
times                   = "Times New Roman"

[ Display ]
I'm not sure how much of this you already know, so I'll just try doing a brain dump.

When reports runtime prepares a PDF report it uses a PDF writer. The writer uses postscript printer definition or HP printer definition to figure out things like resolution and available fonts.

The PDF writer is a part of the GUI Common Toolkit. There is an environment variable that controls where the toolkit looks for its initialization files. I think this environment variable is something like TK60 or TK_UNKNOWN, but I can't remember.

The two most important files are the uiprint.txt file and the uifont.ali file. In the uiprint.txt file, you specify what PPD (Postscript Printer Definition) or HPD (HP Printer Definition) file is associated with what printer and what Unix device it is associated to. Despite what the docs say, it must be a real device and a real printer (lpr should work on it), even if the PPD/HPD does not match. PPD files are found in the TK60/admin/PPD directory.

Evironment variables are set in the script that starts the reports server. This is usually something like reports60_server and is found in the ORACLE_HOME for developer 6i.

Each PPD file defines what fonts are available to it (you can edit the PPD file and look at the list). If the PPD does not contain a font requested by a report, the PDF writer uses the contents of the uifont.ali to try to map a font in the PPD file to the font requested (it looks first in the PDF section then in the Global section). The PDF writer then uses the Adobe Font Metrics file corresponding to the PPD font to return information to the Reports runtime about how much room a character takes.

The printer used is defined by the TK_PRINTER and PRINTER variables in your reports60_server shell script.

AFM files are found in the TK60/admin/AFM directory and _are_ case-sensetive. They need to exactly match the font in the PPD file, just as the font in the PPD file must match the requested font. You can create AFM files for Arial from your TrueType windows fonts using third party tools (look in the fonts section of SourceForge). You can also edit the PPD files and add what fonts you like (even if they don't exist on the real printer).

My advice is to make sure your printer is set up correctly in the uiprint.txt file, that your printer contains a font corresponding to arial (or close to it, like helvetica) and that the associated AFM file exists, then add a [PDF] section to your uifont.ali file and map Arial = arial. I don't recommend changing the global section, because this will effect other types of reports (Motif and HTML/CSS) and that's a whole other can of worms.
I'm not sure how much of this you already know, so I'll just try doing a brain dump.

When reports runtime prepares a PDF report it uses a PDF writer. The writer uses postscript printer definition or HP printer definition to figure out things like resolution and available fonts.

The PDF writer is a part of the GUI Common Toolkit. There is an environment variable that controls where the toolkit looks for its initialization files. I think this environment variable is something like TK60 or TK_UNKNOWN, but I can't remember.

The two most important files are the uiprint.txt file and the uifont.ali file. In the uiprint.txt file, you specify what PPD (Postscript Printer Definition) or HPD (HP Printer Definition) file is associated with what printer and what Unix device it is associated to. Despite what the docs say, it must be a real device and a real printer (lpr should work on it), even if the PPD/HPD does not match. PPD files are found in the TK60/admin/PPD directory.

Evironment variables are set in the script that starts the reports server. This is usually something like reports60_server and is found in the ORACLE_HOME for developer 6i.

Each PPD file defines what fonts are available to it (you can edit the PPD file and look at the list). If the PPD does not contain a font requested by a report, the PDF writer uses the contents of the uifont.ali to try to map a font in the PPD file to the font requested (it looks first in the PDF section then in the Global section). The PDF writer then uses the Adobe Font Metrics file corresponding to the PPD font to return information to the Reports runtime about how much room a character takes.

The printer used is defined by the TK_PRINTER and PRINTER variables in your reports60_server shell script.

AFM files are found in the TK60/admin/AFM directory and _are_ case-sensetive. They need to exactly match the font in the PPD file, just as the font in the PPD file must match the requested font. You can create AFM files for Arial from your TrueType windows fonts using third party tools (look in the fonts section of SourceForge). You can also edit the PPD files and add what fonts you like (even if they don't exist on the real printer).

My advice is to make sure your printer is set up correctly in the uiprint.txt file, that your printer contains a font corresponding to arial (or close to it, like helvetica) and that the associated AFM file exists, then add a [PDF] section to your uifont.ali file and map Arial = arial. I don't recommend changing the global section, because this will effect other types of reports (Motif and HTML/CSS) and that's a whole other can of worms.
Sorry ... virtual stutter ;)
BTW. Your uifont.ali file looks suspiciously like it was built for Windows.
Avatar of Joana

ASKER

[ PDF ]  dosn't work - does this only go with 9i??
Nope, the PDF section should work. I'm using 6i. PDF should override anything else too.

I'm at work and I just checked our uifont.ali file. We have
for Arial:

[ Global ]
Arial = arial

[ PDF ]
Arial = Arial

but note that our AFM directory has the files ArialMT, Arial-BoldMT, Arial-BoldItalicMT, and Arial-ItalicMT with correct "FullName" tags (for example the Arial-BoldItalic file has the FullName tag "Arial Bold Italic") corresponding to the font requested in our PDF reports(generated from Windows TrueType files using a 3rd party utility). And there are the following entries in our PPD file:

+%=== Font Information =======================
*Font ArialMT: Standard "(001.006S)" Standard ROM
*Font Arial-BoldMT: Standard "(001.006S)" Standard ROM
*Font Arial-ItalicMT: Standard "(001.006S)" Standard ROM
*Font Arial-BoldItalicMT: Standard "(001.006S)" Standard ROM

You can copy an AFM file for a font that is close in appearance to the one you need (for example "Helvetica" for "Arial"), but make sure that the Font Information section corresponds exactly to the AFM file name, and that the FullName and FamilyName correspond to what is requested in your report.

Note also that if you open the report in Unix via X and save it or compile it, Oracle will perform font translation using the available X fonts, and you will usually lose the "Arial" descriptor in the format tags.
If you compile a report from the command line, you do not lose the "Arial" tag and font translation does not occur.

Use the following script to compile to REX and you can view the font tags that will appear in your REP.

#
CON=celman/celmandev@v8_c7d5
FILE=`echo $1 | cut -d. -f1`
EXT=`echo $1 | cut -d. -f2`
rwcon60 USERID=$CON STYPE=RDFFILE SOURCE=$1 DTYPE=REXFILE DEST=$FILE LOGFILE=$LOGFILE OVERWRITE=YES BATCH=YES
Our reports server startup script has these toolkit settings:

REPORTS60_NO_DUMMY_PRINTER=YES; export REPORTS60_NO_DUMMY_PRINTER
TK_PRINT_STATUS=echo; export TK_PRINT_STATUS
TK_PRINTER=CUSTOM; export TK_PRINTER
PRINTER=CUSTOM; export PRINTER
TK60_FONTALIAS=$ORACLE_BASE/ias/1.0.2.2/6iserver/guicommon6/tk60/admin; export TK60_FONTALIAS
ORACLE_HPD=$ORACLE_BASE/ias/1.0.2.2/6iserver/guicommon6/tk60/admin/HPD; export ORACLE_HPD
ORACLE_UNKNOWN=$ORACLE_BASE/ias/1.0.2.2/6iserver/guicommon6/tk60/admin; export ORACLE_UNKNOWN

Our uiprint.txt file contains:

#
CUSTOM:PostScript:2:Custom LJ5 with Arial:custom.ppd:
c7pr0454:PostScript:2:HP LaserJet 5M near L3 Pillar 5:custom.ppd:

Details on gettint TrueType fonts to work in PDF docs under Unix:

1)     Download the t1 library (t1lib-1.3.1-bin.zip), freetype library (freetype-2.0.5-bin.zip), and the TrueType to PostScript utility (ttf2pt1-3.4.0-bin.zip) from any source that supports the GNU project such as sourceforge.net. Install them in the directory \ttf
2)     Copy the TrueType fonts from c:\orant\fonts to the \ttf\bin directory
3)     Create a file using dir /b > convert.bat and use a regular expression find and replace capable text editor to change each line to say "ttf2pt1filename.ttf".
4)     Run convert.bat
5)     Use "find "FontName" *.AFM > convert2.bat" to create a file with all each filename and each FontName.
6)     Create the directory \ttf\bin\AFM
7)     Use a regular expression find and replace capable text editor to change each line to say "move filename.TTF.afm AFM\FontName". Note that the filename must be exactly the same as the FontName field in the file.
8)     Execute convert2.bat
9)     ftp (ascii) the AFM directory to $ORACLE_HOME/guicommon6/tk60/admin/AFM
10)     In Unix, do an "ls -1 > include.txt" of the AFM directory
11)     Use sed or the above editor to make each line like " *Font FontName: Standard "(001.006S)" Standard ROM"
12)     In the admin/PPD directory, copy the default.ppd file to custom.ppd.
13)     Change the fonts section of this file to have the include.txt file instead.
14)     Make sure that uiprint.txt contains the custom.ppd definition.
15)     Make sure that TK_PRINTER and PRINTER env vars for Reports Server are set to the custom.ppd printer from uiprint.txt. Make sure that TK_PRINT_STATUS is set to echo.
16)     For each font family that has a Global section alias in uifont.ali to convert to lowercase (for HTML X fonts), add a FamilyName=FamilyName under the [ PDF ] section of uifont.ali. For example, if you have Arial=arial under [Global], add Arial=Arial under [PDF].
Avatar of Joana

ASKER

Sorry seams i got the report server wrong ( i think)  Our server person was impressed with your answers and asked if u could relate it to windows
Ahh, NT is much easier (and overall a better platform for a reports server). There is an integration in the fonts between the screen and the printer and so what you see is really what you get.

The PDF writer for NT doesn't need font metrics and immediately has all the fonts available that are available to NT (I think).

So my comment about converting to text is your best bet. On the _server_, convert the RDF in question to REX and look at the resulting text file. Find a field that you know from the report (using its name) and look at its format tag. Look for that format tag in the file. The font that it uses will be the font that reports runtime uses on the server for rendering the PDF.

Now if it shows Arial 8 still, then there may be a bug in the Font. Try downloading the utility from Microsoft that I mentioned and look at the font file versions.

Also, there is a utility somewhere called "flint" that looks at a font and examines it for errors. Note that most fonts have errors of one sort or another, but that doesn't stop you from using them.
Avatar of Joana

ASKER

Arg Back Again..

We have narrowed it down to an actual Template problem that is screwing with the Arial font - in all size points.  If we move the report to a new template or to no template then it works fine.  Problem is we can't find anywhere in the template that would be causing it to screw with a font?  Any ideas?
ASKER CERTIFIED SOLUTION
Avatar of rkogelhe
rkogelhe

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Joana

ASKER

Sorry fixed Now :-)

Turned out to be some weird error with the wizard.  Whatever the first field is put onto the report by the wizard in ANY arial font makes the space error happen...solution make the fields a different font first then change them to Arial and it dosn't happen.  It fix the ones that were already broken i have to change the footer text (first text fields on report) to 9 point and then back to 8 and all is fine - weird but true :-)  Thanks for all your help :-)

Jo