Solved

Generating pdf using oracle reports

Posted on 2008-10-30
4
1,173 Views
Last Modified: 2013-12-11
We need to generate a pdf file using the images stored in the tables. Images are stored in the BFILE format and our website is in PL/SQL. So we know we can generate pdf files using oracle reports. what are steps to be followed . We need to do this in the code of PL/SQL(programatically). Has anyone done this before ? Please help with an answer.
0
Comment
Question by:shami4u
  • 2
4 Comments
 
LVL 21

Expert Comment

by:oleggold
ID: 22887166
0
 
LVL 21

Accepted Solution

by:
oleggold earned 500 total points
ID: 22887195
Quating from the above
to  have jave code to work with frr pdf writing options like Ghostscript You need the following
create or replace and compile 
java source named "Util" 
as 
package createpdf;
import java.io.FileOutputStream;
import java.io.IOException;
 
import com.lowagie.text.*;
import com.lowagie.text.pdf.PdfWriter;
 
public class Util extends Object 
  {
    public static void Create_Pdf(String args[]) 
      {
	  Document document = new Document();
	  try {
	        PdfWriter.getInstance(document, new FileOutputStream("d:\\Doc.pdf"));
	        document.open();
	        document.add(new Paragraph(args[0]));
	      } 
	  catch (DocumentException de) 
             {
	        System.err.println(de.getMessage());
	     } 
	  catch (IOException ioe) 
             {
	        System.err.println(ioe.getMessage());
	     }
	  document.close();
       }
   };
 
create or replace function CREATE_NEW_PDF(p_src in varchar2) return varchar2 
as 
language java 
name 'Util.Create_Pdf(java.lang.String) return String'; 
 
 
 
 
And also I have executed: 
 
 
 
BEGIN 
dbms_java.grant_permission('<DB_USER>','java.io.FilePermission','$ORACLE_BASE','write'); 
dbms_java.grant_permission('<DB_USER>','java.lang.RuntimePermission','*', 'writeFileDescriptor' ); 
END; 
 

Open in new window

0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
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 set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

821 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