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?
-- 
View this message in context: 
http://www.nabble.com/PDF-header-signature-not-found-tf3907501.html#a11078638
Sent from the iText - General mailing list archive at Nabble.com.


-------------------------------------------------------------------------
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