le 15/01/2003 � 08:39 Joe Simoes a �crit :

>Hi,
>
>I have an application where I must combine multiple pdf files into a
>single pdf.
>The pdfs are retrieved from an Oracle table that stores the files as
>BLOBs.  I
>read each file into a byte[] which is then placed into a Vector.  I
>modified the
>"concat.java" program found at your site to handle the concatenation
of the
>files by passing in the Vector of byte arrays.
>
>I receive an error each time I try to use the PdfReader constructor
with
>the
>byte[] parameter.  Below is a sample piece of code that throws the
same
>exception.  This example is different from what I described above but
it
>throws
>the same exception: "java.io.IOException: PDF startxref not found."
This
>is
>strange because the number of bytes read in exactly matches the number
of
>bytes
>in the file.

i use the same architecture, and i successfully read PDF from an
inputstream with the byte[] parameter. the only difference is that i
loop on the instruction that copy in the byte array :
                                InputStream input = blob.getInstream();
                                byte[] contenu = new byte[blob.getBufferSize()];
                                int longueur = -1;
                                while ((longueur = input.read(contenu)) != -1) {
                                }

so i am absolutely certain that the whole content of the inputstream
has been copied to the byte array.

you should check this, because a fileInputStream is asynchronous, so
there is chances the stream can not be read in only one pass.



--
S�bastien LAFORET - Sully Group



-------------------------------------------------------
This SF.NET email is sponsored by: Take your first step towards giving
your online business a competitive advantage. Test-drive a Thawte SSL
certificate - our easy online guide will show you how. Click here to get
started: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0027en
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to