- For individual users
- Instant access to solutions
- Ask your tech questions
- Start your 30-day Free Trial
Main Topics
Browse All TopicsHi,
My company is running on Oracle Applications R11.5.10.
I am trying to create a custom form and register it against the application.
This form should facilitate to display PDF documents stored in database tables
to the user for viewing only.
The forms Version is 6i.
Any immediate help would be great.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: stephenmrajPosted on 2006-02-21 at 16:44:03ID: 16014591
if you have the images in a BLOB, its quite easy. Here is an example that
id=55>Clic k Me</a>
_html';
om/pls/ask /f? p=4950: 8:::NO::F4 950_P8_DIS PLAYID:232 814159006
loads a GIF into the datbase and displays it. You would of course change the
mime type and the name of the procedure from .gif to .pdf. Then you will be
able to use HTML like:
<a href=/dcd/owa/image.pdf?p_
to retrieve "document 55" for example.
The following code just created a demo table and loads an image into it -- you
already have the pdfs loaded so its not 100% relevant to your problem
create table demo
( id int primary key,
theBlob blob
)
/
create or replace directory my_files as '/export/home/tkyte/public
declare
l_blob blob;
l_bfile bfile;
begin
insert into demo values ( 1, empty_blob() )
returning theBlob into l_blob;
l_bfile := bfilename( 'MY_FILES', 'aria.gif' );
dbms_lob.fileopen( l_bfile );
dbms_lob.loadfromfile( l_blob, l_bfile,
dbms_lob.getlength( l_bfile ) );
dbms_lob.fileclose( l_bfile );
end;
/
Now here is the package that can retrieve the pdf (or anything for that
matter. Just keep adding procedures that are named after the file type like
.doc, .pdf, .xls and so on. Some browsers really want the extension in the URL
to be "correct")
create or replace package image_get
as
procedure gif( p_id in demo.id%type );
end;
/
create or replace package body image_get
as
procedure gif( p_id in demo.id%type )
is
l_lob blob;
l_amt number default 30;
l_off number default 1;
l_raw raw(4096);
begin
select theBlob into l_lob
from demo
where id = p_id;
-- make sure to change this for your type!
owa_util.mime_header( 'image/gif' );
begin
loop
dbms_lob.read( l_lob, l_amt, l_off, l_raw );
-- it is vital to use htp.PRN to avoid
-- spurious line feeds getting added to your
-- document
htp.prn( utl_raw.cast_to_varchar2( l_raw ) );
l_off := l_off+l_amt;
l_amt := 4096;
end loop;
exception
when no_data_found then
NULL;
end;
end;
end;
/
URl:http://asktom.oracle.c