/** * Make sure that this object is dereferenced. Use the cache of * an indirect object to cache the dereferenced value, if possible. */ public PDFObject dereference() throws IOException { if (type == INDIRECT) { PDFObject obj = null; if (cache != null) { obj = (PDFObject) cache.get(); } if (obj == null || obj.value == null) { if (owner == null) { System.out.println("Bad seed (owner==null)! Object=" + this); } obj = owner.dereference((PDFXref)value, getDecrypter()); cache = new SoftReference<PDFObject>(obj); } return obj; } else { // not indirect, no need to dereference return this; } }
/** * Make sure that this object is dereferenced. Use the cache of * an indirect object to cache the dereferenced value, if possible. */ public PDFObject dereference() throws IOException { if (type == INDIRECT) { PDFObject obj = null; if (cache != null) { obj = (PDFObject) cache.get(); } if (obj == null || obj.value == null) { if (owner == null) { System.out.println("Bad seed (owner==null)! Object=" + this); } obj = owner.dereference((PDFXref)value, getDecrypter()); cache = new SoftReference<PDFObject>(obj); } return obj; } else { // not indirect, no need to dereference return this; } } /**
/** * Make sure that this object is dereferenced. Use the cache of * an indirect object to cache the dereferenced value, if possible. * @param fromCacheOnly If set to true, only the cache is checked and no real work is done. */ public PDFObject dereference(boolean fromCacheOnly) throws IOException { if (type == INDIRECT) { PDFObject obj = null; if (cache != null) { obj = (PDFObject) cache.get(); } if (obj == null || obj.value == null) { if (owner == null) { throw new IOException("Bad seed (owner==null)! Object=" + this); } if (!fromCacheOnly) { obj = owner.dereference((PDFXref)value, getDecrypter()); cache = new SoftReference<PDFObject>(obj); } } return obj; } else { // not indirect, no need to dereference return this; } }
return PDFObject.nullObj; PDFXref compRef = new PDFXref(compId, 0); PDFObject compObj = dereference(compRef, decrypter); int first = compObj.getDictionary().get("First").getIntValue(); int n = compObj.getDictionary().get("N").getIntValue();
dereference(entry.getStream(), getDefaultDecrypter()); if (stream == null || stream.getType() != PDFObject.STREAM || !"ObjStm".equals(stream.getDictRef("Type").getStringValue())) { throw new PDFParseException(entry.getStream().getObjectNumber() +