voyent
NullPointer Exception while Ink Annotation processing  XML
Forum Index -> ICEpdf General
Author Message
sam_louis

Joined: 01/Apr/2010 00:00:00
Messages: 7
Offline


I tried to create a jira but got an error of
"Assignee: The default assignee does NOT have ASSIGNABLE permission OR Unassigned issues are turned off.
"

When calling getPageImage for page 1
the InkAnnotation line
java.lang.NullPointerException
at java.awt.geom.Path2D.append(Unknown Source)
at org.icepdf.core.pobjects.annotations.InkAnnotation.init(InkAnnotation.java:80)
at org.icepdf.core.pobjects.Page.initPageAnnotations(Page.java:307)
at org.icepdf.core.pobjects.Page.init(Page.java:349)
at org.icepdf.core.pobjects.Document.getPageImage(Document.java:1105)
at xxxx


The relevant code is this:
inkPath = new GeneralPath();
for (List<Number> inkList : inkLists) {
GeneralPath inkPath = null;
for (int i = 0, max = inkList.size() - 1; i < max; i += 2) {
if (inkPath == null) {
inkPath = new GeneralPath();
inkPath.moveTo(inkList.get(i).floatValue(), inkList.get(i + 1).floatValue());
} else {
inkPath.lineTo(inkList.get(i).floatValue(), inkList.get(i + 1).floatValue());
}
}
inkPaths.append(inkPath, false);
}
if the inkList.size is empty the inkPath will be null at the inkPaths.append and will cause an NPE
 Filename Understanding Sanctuary Cities-gvulv287mxw1_1e2flplabhjin.pdf [Disk] Download
 Description
 Filesize 987 Kbytes
 Downloaded:  8 time(s)

 
Forum Index -> ICEpdf General
Go to:   
Powered by JForum 2.1.7ice © JForum Team