Exemplo n.º 1
0
 /**
  * Returns a <CODE>PdfObject</CODE> as a <CODE>PdfBoolean</CODE>, resolving indirect references.
  *
  * <p>The object corresponding to the specified index is retrieved and resolved to a direct
  * object. If it is a <CODE>PdfBoolean</CODE>, it is cast down and returned as such. Otherwise
  * <CODE>null</CODE> is returned.
  *
  * @param idx The index of the <CODE>PdfObject</CODE> to be returned
  * @return the corresponding <CODE>PdfBoolean</CODE> object, or <CODE>null</CODE>
  */
 public PdfBoolean getAsBoolean(final int idx) {
   PdfBoolean bool = null;
   PdfObject orig = getDirectObject(idx);
   if (orig != null && orig.isBoolean()) bool = (PdfBoolean) orig;
   return bool;
 }
Exemplo n.º 2
0
 /**
  * Returns a <CODE>PdfObject</CODE> as a <CODE>PdfBoolean</CODE>, resolving indirect references.
  *
  * <p>The object associated with the <CODE>PdfName</CODE> given is retrieved and resolved to a
  * direct object. If it is a <CODE>PdfBoolean</CODE>, it is cast down and returned as such.
  * Otherwise <CODE>null</CODE> is returned.
  *
  * @param key A <CODE>PdfName</CODE>
  * @return the associated <CODE>PdfBoolean</CODE> object, or <CODE>null</CODE>
  */
 public PdfBoolean getAsBoolean(final PdfName key) {
   PdfBoolean bool = null;
   PdfObject orig = getDirectObject(key);
   if (orig != null && orig.isBoolean()) bool = (PdfBoolean) orig;
   return bool;
 }