I am using the following Python code for iText evaluating purposes.

import sys
from com.itextpdf.text.pdf import PdfReader;
from com.itextpdf.text.pdf.parser import PdfReaderContentParser;

reader = PdfReader(sys.argv[0])
parser = PdfReaderContentParser(reader)
for i in range(reader.getNumberOfPages()):
    print i

sucmac:aspose-pdf-kit-4 ajung$  /opt/jython-2.5.2/bin/jython extract.py
anzeige.pdf 
Traceback (most recent call last):
  File "extract.py", line 5, in <module>
    reader = PdfReader(sys.argv[0])
        at 
com.itextpdf.text.pdf.PRTokeniser.checkPdfHeader(PRTokeniser.java:205)
        at com.itextpdf.text.pdf.PdfReader.readPdf(PdfReader.java:494)
        at com.itextpdf.text.pdf.PdfReader.<init>(PdfReader.java:169)
        at com.itextpdf.text.pdf.PdfReader.<init>(PdfReader.java:158)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at
org.python.core.PyReflectedConstructor.constructProxy(PyReflectedConstructor.java:210)

com.itextpdf.text.exceptions.InvalidPdfException:
com.itextpdf.text.exceptions.InvalidPdfException: PDF header signature not
found.

I receive the same error with all PDF files as input that I could
find....why?

-aj

--
View this message in context: 
http://itext-general.2136553.n4.nabble.com/PDF-header-signature-not-found-with-all-PDF-files-tp4112795p4112795.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to