pdf

Adding a true-type font to Reports Services while running Reports deployed on the web

Problem: A report, designed for generating PDF with the true-type font Univers in it, does not work while deployed on the web, and uses other fonts instead.
Cause: there’s no Univers installed in the Reports Services on Unix.
Solution: install the font and configure the Reports Service!  Sounds simple…

In the process of figuring this out, I had several error-messages, like rep-1352 (The fonts specified for this report cannot be found for the character set specified by NLS_LANG) , and rep-1 (nothing else…).
Took a lot of time to eliminate those errors, partly because there was a feature in the specified report what did’nt speed up the process of resolving this issue: embedded html. This caused for example the “rep-1″-error.

With special thanks to Marc Riesewijk, developer:

1. First, make a so called ‘AFM’-file of the font-files from your windows-client, which will be used to copy to the Linux-server.

In the case of Univers there are the following files in c:\windows\fonts:
-unvr55w.TTF
-unvr56w.TTF
-unvr57w.TTF
-unvr58w.TTF
-unvr65w.TTF
-unvr66w.TTF
-unvr67w.TTF
-unvr68w.TTF

m4s0n501
By |August 11th, 2009|Categories: App. Server|Tags: , , , |0 Comments

Creating PDF's with PL/SQL and itext

There are several ways to create PDF’s, on the client (e.g. PDFCreator) or on the middletier.
But to create PDF’s merely with packages in the database, that’s another story. Even Apex uses some Java on the middletier.
The product PLPDF on the other hand is a well known utility which provides this functionality (using open-source ‘itext’), but.. you have to pay for this.

So why not do it ourselves with itext, open-source (answer: a lot of work and knowledge of Java…).

What follows are the basics to use pl/sql in combination with ‘itext’.
1. Download itext-jar-file (itext-2.1.5.jar):

http://sourceforge.net/project/showfiles.php?group_id=15255&package_id=12596

Copy the jar-file to your database server

2. load these java-classes in the database.

grant create procedure to <owner>;
grant create table to <owner>;

loadjava -user exg/exg iText-2.1.5.jar

Some explanation about loadjava:
http://www.oracleutilities.com/OSUtil/loadjava.html

Check if it’s correctly loaded in the database:

select object_name, object_type, status
from dba_objects
where object_type like ‘%JAVA%’
and owner='<owner>’
and status <> ‘VALID’

3. A lot of Java is not valid, you need some other Java classes of ‘bouncycastle’ (encryption):

By |June 20th, 2009|Categories: Database|Tags: , , |0 Comments