0% found this document useful (0 votes)
25 views4 pages

PL/PDF Guide for Oracle Reporting

The document is a guide for using the PL/PDF package to create PDF files in an Oracle database environment. It covers installation steps, initializing the PL/PDF application, and creating a simple PDF document with text content. Additionally, it includes instructions for storing the generated PDF in a database table.

Uploaded by

chinweizueze
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views4 pages

PL/PDF Guide for Oracle Reporting

The document is a guide for using the PL/PDF package to create PDF files in an Oracle database environment. It covers installation steps, initializing the PL/PDF application, and creating a simple PDF document with text content. Additionally, it includes instructions for storing the generated PDF in a database table.

Uploaded by

chinweizueze
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Reporting in your Oracle database

PL/PDF
Getting Started
V4.0.0

[Link] 1 info@[Link]
Reporting in your Oracle database

Contents
1. Introduction .......................................................................................
................................ ....................... 3
2. First steps ..........................................................................................
................................ .......................... 3
3. Creating first word document.............................................................
document ............................. 3

[Link] 2 info@[Link]
Reporting in your Oracle database

1. Introduction
PL/PDF is a PL/SQL package collection that
t you can use to create PDF files. This guide
will help you from the beginning to generate your first PL/PDF generated PDF sample file.

2. First steps
First, you need to install an Oracle Database on your system. The easiest way is to
download the Oracle Express Edition.
Edition After you finished the installation, you can
download the PL/OFFX software from the following link: PL/PDF download.
download To install the
latest version of PL/OFFX please use the install guide, called plpdf_install_v400.pdf.
_install_v400.pdf. You
also need a PL/SQL Developer
eveloper environment, or you can use the SQL Plus application and a
text editor.

3. Creating first word document


After you finished the installation start the PL/SQL Developer or a simple text editor
and let’s begin:
create or replace procedure PDF_Example is

The l_pdf variable is a requirement. This variable will contain the pdf file after the
generation is finished.
l_pdf blob;
begin

When you want to create PDF files with the PL/PDF application, you need to start with the
Init procedure. This procedure will initialize the whole application
tion environment. It has got
three optional parameters.. The p_unit, which specifies the measurement unit. Its default
value is millimeter (mm). The p_orientation which specifies the page orientation for the
whole document. The default
efault value is portrait. The p_format specifies the page size
format. The default value is A4.
A4 If the default values are right for you, the only line you
need is this:
[Link]();

Now the PL/PDF is initialized. In PL/PDF


PDF you can create several types of content. These
contents always belong to a page. The page
p is a container element. The
T second step is,
to create a new page. The newPage procedure
procedure has one optional parameter which
specifies the page orientation. The default usage is.
[Link];

Before you add any text to the page, you need to call the setPrintFont procedure. These
three parameters are optional, but it’s highly recommended to fill them. The p_family
specifies the font family name. Tha p_style specifies the text style. The null value means
the regular style. The p_size specifies the font size.
size. The measurement unit of that is
always point.
[Link](
p_family => 'Arial',
'Arial'
p_style => null,,
p_size => 12
);

In PL/PDF you have some ways to write text into the document. If you have a page and
set the font properties then you can print text with the PrintoutText procedure. The p_x

[Link] 3 info@[Link]
Reporting in your Oracle database

and p_y parameters specify the position from


f the top left corner of the page. The p_txt
contains the text data.

[Link](
p_x => 20,
p_y => 30,
p_txt => 'InitDefault example'
);

The sample document is finished.


finish Now, you can generate the pdf file into a simple blob
variable. The SendDoc
ndDoc procedure will help you with that. It has only one parameter which
specifies the target blob variable for the result file.
[Link](
p_blob => l_pdf
pdf
);

This is an optional step. After the file generated, d, you need to store it. The PL/PDF
installkit provides you a sample store table, called STORE_BLOB. The stored blob is a fully
compatible docx file.
insert into store_blob(blob_file,created_date,filename)
values (l_pdf,sysdate
sysdate,'[Link]');
commit;

If you use PL/SQL Developer, you can download the file. When you save it to a local file
system
em use the qualified file name, for example:
e [Link].

The generated
erated example file in Acrobat Reader:
Reader

[Link] 4 info@[Link]

You might also like