Solved

URGENT - PDF Format

Posted on 2002-07-10
21
1,520 Views
Last Modified: 2013-12-03
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?
0
Comment
Question by:Joana
21 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7145224
seems to be a font problem
0
 
LVL 3

Expert Comment

by:mnicoras
ID: 7145432
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
0
 
LVL 3

Expert Comment

by:rkogelhe
ID: 7145477
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?
0
 
LVL 3

Expert Comment

by:rkogelhe
ID: 7145494
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.
0
 

Author Comment

by:Joana
ID: 7152880
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
0
 
LVL 3

Expert Comment

by:rkogelhe
ID: 7155146
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.

0
 

Author Comment

by:Joana
ID: 7155771
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 ]
0
 
LVL 3

Expert Comment

by:rkogelhe
ID: 7158166
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.
0
 
LVL 3

Expert Comment

by:rkogelhe
ID: 7158167
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.
0
 
LVL 3

Expert Comment

by:rkogelhe
ID: 7158172
Sorry ... virtual stutter ;)
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 3

Expert Comment

by:rkogelhe
ID: 7158177
BTW. Your uifont.ali file looks suspiciously like it was built for Windows.
0
 

Author Comment

by:Joana
ID: 7163958
[ PDF ]  dosn't work - does this only go with 9i??
0
 
LVL 3

Expert Comment

by:rkogelhe
ID: 7169229
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.
0
 
LVL 3

Expert Comment

by:rkogelhe
ID: 7169243
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
0
 
LVL 3

Expert Comment

by:rkogelhe
ID: 7169261
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:

0
 
LVL 3

Expert Comment

by:rkogelhe
ID: 7169274
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].
0
 

Author Comment

by:Joana
ID: 7176226
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
0
 
LVL 3

Expert Comment

by:rkogelhe
ID: 7176855
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.
0
 

Author Comment

by:Joana
ID: 7192107
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?
0
 
LVL 3

Accepted Solution

by:
rkogelhe earned 200 total points
ID: 7195715
Could your MODE system parameter be set to character instead of bitmap? Still that should just change the length of the fields, not the display of them.

Have you tried setting a different default font in the template?
0
 

Author Comment

by:Joana
ID: 7199979
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
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now