/** * Displays an XObject using the registered handler for this XObject's subtype * @param xobjectName the name of the XObject to retrieve from the resource dictionary */ private void displayXObject(PdfName xobjectName) throws IOException { PdfDictionary xobjects = resources.getAsDict(PdfName.XOBJECT); PdfObject xobject = xobjects.getDirectObject(xobjectName); PdfStream xobjectStream = (PdfStream)xobject; PdfName subType = xobjectStream.getAsName(PdfName.SUBTYPE); if (xobject.isStream()){ XObjectDoHandler handler = xobjectDoHandlers.get(subType); if (handler == null) handler = xobjectDoHandlers.get(PdfName.DEFAULT); handler.handleXObject(this, xobjectStream, xobjects.getAsIndirectObject(xobjectName)); } else { throw new IllegalStateException(MessageLocalization.getComposedMessage("XObject.1.is.not.a.stream", xobjectName)); } }
/** * Displays an XObject using the registered handler for this XObject's subtype * @param xobjectName the name of the XObject to retrieve from the resource dictionary */ private void displayXObject(PdfName xobjectName) throws IOException { PdfDictionary xobjects = resources.getAsDict(PdfName.XOBJECT); PdfObject xobject = PdfReader.getPdfObjectRelease(xobjects.get(xobjectName)); PdfStream xobjectStream = (PdfStream)xobject; PdfName subType = xobjectStream.getAsName(PdfName.SUBTYPE); if (xobject.isStream()){ XObjectDoHandler handler = xobjectDoHandlers.get(subType); if (handler == null) handler = xobjectDoHandlers.get(PdfName.DEFAULT); handler.handleXObject(this, xobjectStream, xobjects.getAsIndirectObject(xobjectName),markedContentStack); } else { throw new IllegalStateException(MessageLocalization.getComposedMessage("XObject.1.is.not.a.stream", xobjectName)); } }
/** * Gets a reference to the normal appearance of a field. * * @param name the field name * @return a reference to the /N entry of the /AP dictionary or <CODE>null</CODE> if the field is not found */ public PdfIndirectReference getNormalAppearance(String name) { getSignatureNames(); name = getTranslatedFieldName(name); Item item = fields.get(name); if (item == null) return null; PdfDictionary merged = item.getMerged(0); PdfDictionary ap = merged.getAsDict(PdfName.AP); if (ap == null) return null; PdfIndirectReference ref = ap.getAsIndirectObject(PdfName.N); if (ref == null) return null; return ref; }
/** * Gets a reference to the normal appearance of a field. * * @param name the field name * @return a reference to the /N entry of the /AP dictionary or <CODE>null</CODE> if the field is not found */ public PdfIndirectReference getNormalAppearance(String name) { getSignatureNames(); name = getTranslatedFieldName(name); Item item = fields.get(name); if (item == null) return null; PdfDictionary merged = item.getMerged(0); PdfDictionary ap = merged.getAsDict(PdfName.AP); if (ap == null) return null; PdfIndirectReference ref = ap.getAsIndirectObject(PdfName.N); if (ref == null) return null; return ref; }
while ((ref = wd.getAsIndirectObject(PdfName.PARENT)) != null) { wd = wd.getAsDict( PdfName.PARENT ); PdfArray kids = wd.getAsArray(PdfName.KIDS);
while ((ref = wd.getAsIndirectObject(PdfName.PARENT)) != null) { wd = wd.getAsDict( PdfName.PARENT ); if(wd == null) break;
PdfIndirectReference iInfo = reader.getTrailer().getAsIndirectObject(PdfName.INFO); if (iInfo != null) { skipInfo = iInfo.getNumber();
PdfIndirectReference iInfo = reader.getTrailer().getAsIndirectObject(PdfName.INFO); if (iInfo != null) { skipInfo = iInfo.getNumber();