Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: retrive and display PDF file

Re: retrive and display PDF file

From: MarkyG <markg_at_mymail.tm>
Date: 13 Jun 2001 00:54:24 -0700
Message-ID: <ab87195e.0106122354.39bc6081@posting.google.com>

My *guess* is that not all of the PDF file from the database is being written back to the filesystem. I tried this once (albiet in PL/SQL and external procedures) and if the file is not written completely, you'll get errors in Acrobat.

Try loading a PDF file of a known size in the DB and saving it back to the filesystem and comparing byte sizes.

M

"Jian Cheng" <jcheng01_at_rochester.rr.com> wrote in message news:<G0AV6.14593$3y3.3220730_at_typhoon.nyroc.rr.com>...
> I am trying to write a java program to retrieve a PDF file stored in a LONG
> RAW column in Oracle and then save the file to local file system. The
> problem is the file can not been displayed within Acrobat Reader. Any
> advices will be appreciated.
>
> Here is part of the code:
>
> if (myResultSet.next ())
>
> {
>
> // Get the PDF data as a Stream from Oracle to the client
>
> InputStream PdfData = myResultSet.getBinaryStream (columnName);
>
> // Open a file to store the PDF data
>
> FileOutputStream file = new FileOutputStream ("Data.pdf");
>
> // Loop, reading from the stream and writing to the file
>
> int c;
>
> while ((c = PdfData.read ()) != -1)
>
> file.write (c);
>
> // Close the file
>
> file.close ();
>
>
> Jim
Received on Wed Jun 13 2001 - 02:54:24 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US