If Acrobat can open it, you have more than 1k of garbage before the pdf.

Paulo

----- Original Message ----- 
From: "peter_budo" <[EMAIL PROTECTED]>
To: <itext-questions@lists.sourceforge.net>
Sent: Tuesday, June 12, 2007 2:16 PM
Subject: [iText-questions] PDF header signature not found


>
> After opening PDF document I try to read page content and store it in 
> another
> PdfReader but I'm getting following error
>
> java.io.IOException: PDF header signature not found.
>    at com.lowagie.text.pdf.PRTokeniser.checkPdfHeader(Unknown Source)
>    at com.lowagie.text.pdf.PdfReader.readPdf(Unknown Source)
>    at com.lowagie.text.pdf.PdfReader.<init>(Unknown Source)
>    at com.lowagie.text.pdf.PdfReader.<init>(Unknown Source)
>    at TestMain.<init>(Test.java:38)
>    at Test.main(Test.java:17)
>
> Code as follows, where the bold part is the roubling line 38
>
> LinksMain()
> {
> File f = new File("Index-2pg.pdf");
>
> try
> {
> PdfReader reader = new PdfReader(f.getAbsolutePath() );
> PdfObject o;
> PdfDictionary d;
> PdfDictionary l;
> PdfName n;
>
> for(int a = 1; a <= reader.getNumberOfPages(); a ++)
> {
> PdfReader page = new PdfReader(reader.getPageContent(a));
> System.out.println("Page num - " + a);
> for(int i = 1; i < page.getXrefSize(); i++)
>
> Can somebody please explain what I'm doing wrong?


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to