RBolotov wrote:
> And sure thing, if PDF does not contain any optional content groups with
> radio button behavior, field OCGRadioGroup becomes null. I added
> if (OCGRadioGroup == null)
> OCGRadioGroup = new PdfArray();
> after line 1606 in PdfStamperImp, rebuilt iText with ant and the problem was
> resolved. Can't say if it'll affect anything else...
>
> P.S. I used iText 5.0.6, downloaded from svn about a week ago (last
> wednesday to be exact).
Thanks!
I must have been using radio groups in all my test samples.
If only somebody had sent me a sample that allowed me to reproduce the
problem, I'd have seen the error.
But now you've solved it, and I want to thank you for that.
Your change was uploaded to the SVN repository:
Revision: 4658
http://itext.svn.sourceforge.net/itext/?rev=4658&view=rev
Date: 2011-01-25 10:40:13 +0000 (Tue, 25 Jan 2011)
Log Message:
-----------
Avoiding a NullPointerException as suggested by R Bolotov on the mailing list
(24/01/2011 18:31)
Modified Paths:
--------------
trunk/src/core/com/itextpdf/text/pdf/PdfStamperImp.java
Modified: trunk/src/core/com/itextpdf/text/pdf/PdfStamperImp.java
===================================================================
--- trunk/src/core/com/itextpdf/text/pdf/PdfStamperImp.java 2011-01-24
12:48:42 UTC (rev 4657)
+++ trunk/src/core/com/itextpdf/text/pdf/PdfStamperImp.java 2011-01-25
10:40:13 UTC (rev 4658)
@@ -1604,6 +1604,8 @@
}
documentOCG.addAll(ocgmap.values());
OCGRadioGroup = d.getAsArray(PdfName.RBGROUPS);
+ if (OCGRadioGroup == null)
+ OCGRadioGroup = new PdfArray();
OCGLocked = d.getAsArray(PdfName.LOCKED);
if (OCGLocked == null)
OCGLocked = new PdfArray();
------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
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