You're right. I think I've nailed it down. After recompiling PdfName, I
see that it is blowing up on line 782 of PdfName. This is where it has this
piece of code:
778 public PdfName(String name) {
779 super(PdfObject.NAME);
780 int length = name.length();
781 if (length > 127) {
782 throw new IllegalArgumentException("The name is too long (" +
bytes.length +").");
783 }
The NullPointerException is actually happening on the "throw new
IllegalArgumentException". bytes is null.
The problem with the PDF is that we had a checkbox whose export value was
greater than 127 bytes.
-----Original Message-----
From: Paulo Soares [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 06, 2004 5:07 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [iText-questions] NullPointerException in PdfReader
It's probably a broken PDF (just because it opens in Acrobat doesn't
mean it's 100% correct). You may try with the version at itextpdf.sf.net
that has some more tricks to read broken PDFs.
Best Regards,
Paulo Soares
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of [EMAIL PROTECTED]
> Sent: Wednesday, October 06, 2004 3:22 AM
> To: [EMAIL PROTECTED]
> Subject: [iText-questions] NullPointerException in PdfReader
>
> Hi,
>
> We've been succesfully using i-text for several months now to
> merge PDF
> templates and FDF Files, but have suddenly run into a
> problem. I assume it
> is a problem with the source PDF template we are using, but I
> be sure. I'm
> using version 1.02b. With this particular PDF, when I construct the
> PdfReader as follows:
>
> PdfReader reader = new PdfReader(somePdfFileVar);
>
> I get this:
>
> java.lang.NullPointerException
> at com.lowagie.text.pdf.PdfName.<init>(Unknown Source)
> at com.lowagie.text.pdf.PdfReader.readDictionary(Unknown Source)
> at com.lowagie.text.pdf.PdfReader.readPRObject(Unknown Source)
> at com.lowagie.text.pdf.PdfReader.readDictionary(Unknown Source)
> at com.lowagie.text.pdf.PdfReader.readPRObject(Unknown Source)
> at com.lowagie.text.pdf.PdfReader.readDictionary(Unknown Source)
> at com.lowagie.text.pdf.PdfReader.readPRObject(Unknown Source)
> at com.lowagie.text.pdf.PdfReader.readDocObj(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)
>
> Any ideas what this might be or how I can figure this one out?
>
> Jay Eckert
>
> Director of Internet Development
> Delphi Technology, Inc.
> 732-418-0008 x3286
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: IT Product Guide on
> ITManagersJournal
> Use IT products in your business? Tell us what you think of
> them. Give us
> Your Opinions, Get Free ThinkGeek Gift Certificates! Click to
> find out more
> http://productguide.itmanagersjournal.com/guidepromo.tmpl
> _______________________________________________
> iText-questions mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions