The solution is not to use a DataInputStream. From the DataInputStream documentation:
Data input streams and data output streams represent Unicode strings in a format that is a slight modification of UTF-8. Use a FileInputStream. Best Regards, Paulo Soares > -----Original Message----- > From: Paul Cooley [SMTP:[EMAIL PROTECTED]] > Sent: Tuesday, March 19, 2002 22:35 > To: [EMAIL PROTECTED] > Subject: [iText-questions] Using the PdfReader(byte[]) constructor > > I have used IText now for over a year now and have > never quite come across this particular problem. > > I have a component which must take a > java.io.InputStream and then convert the InputStream > into a byte[] so the document can be read and then > appended to an existing pdf document. > > The PdfReader continues to throw: > java.io.IOException: PDF header signature not found. > at > com.lowagie.text.pdf.PRTokeniser.checkPdfHeader(PRTokeniser.java:159) > at > com.lowagie.text.pdf.PdfReader.readPdf(PdfReader.java:184) > at > com.lowagie.text.pdf.PdfReader.<init>(PdfReader.java:115) > at > com.bp.nagp.confirm.pdf_generator.ByteArrayTest.main(ByteArrayTest.java:80 > ) > > I get this particular error when reading the pdf from > a DataInputStream and constructing the propery byte[]. > The number of btyes in the array match those in the > file. However, the encodings appear to be different. > Any ideas? > > Thanks. > > __________________________________________________ > Do You Yahoo!? > Yahoo! Sports - live college hoops coverage > http://sports.yahoo.com/ > > _______________________________________________ > iText-questions mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/itext-questions _______________________________________________ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions