Tabnine Logo
PDAppearanceEntry.isSubDictionary
Code IndexAdd Tabnine to your IDE (free)

How to use
isSubDictionary
method
in
org.apache.pdfbox.pdmodel.interactive.annotation.PDAppearanceEntry

Best Java code snippets using org.apache.pdfbox.pdmodel.interactive.annotation.PDAppearanceEntry.isSubDictionary (Showing top 13 results out of 315)

origin: apache/pdfbox

  /**
   * Returns the entry as an appearance subdictionary.
   *
   * @throws IllegalStateException if this entry is not an appearance subdictionary
   */
  public Map<COSName, PDAppearanceStream> getSubDictionary()
  {
    if (!isSubDictionary())
    {
      throw new IllegalStateException("This entry is not an appearance subdictionary");
    }

    COSDictionary dict = entry;
    Map<COSName, PDAppearanceStream> map = new HashMap<>();

    for (COSName name : dict.keySet())
    {
      COSBase value = dict.getDictionaryObject(name);

      // the file from PDFBOX-1599 contains /null as its entry, so we skip non-stream entries
      if (value instanceof COSStream)
      {
        map.put(name, new PDAppearanceStream((COSStream) value));
      }
    }

    return new COSDictionaryMap<>(map, dict);
  }
}
origin: apache/pdfbox

/**
 * Returns the appearance stream for this annotation, if any. The annotation state is taken into account, if
 * present.
 */
public PDAppearanceStream getNormalAppearanceStream()
{
  PDAppearanceDictionary appearanceDict = getAppearance();
  if (appearanceDict == null)
  {
    return null;
  }
  PDAppearanceEntry normalAppearance = appearanceDict.getNormalAppearance();
  if (normalAppearance == null)
  {
    return null;
  }
  if (normalAppearance.isSubDictionary())
  {
    COSName state = getAppearanceState();
    return normalAppearance.getSubDictionary().get(state);
  }
  else
  {
    return normalAppearance.getAppearanceStream();
  }
}
origin: apache/pdfbox

/**
 * Get the annotations normal appearance.
 * 
 * <p>
 * This will get the annotations normal appearance. If this is not existent
 * an empty appearance entry will be created.
 * 
 * @return the appearance entry representing the normal appearance.
 */
private PDAppearanceEntry getNormalAppearance()
{
  PDAppearanceDictionary appearanceDictionary = getAppearance();
  PDAppearanceEntry normalAppearanceEntry = appearanceDictionary.getNormalAppearance();
  if (normalAppearanceEntry.isSubDictionary())
  {
    //TODO replace with "document.getDocument().createCOSStream()" 
    normalAppearanceEntry = new PDAppearanceEntry(new COSStream());
    appearanceDictionary.setNormalAppearance(normalAppearanceEntry);
  }
  return normalAppearanceEntry;
}

origin: apache/pdfbox

/**
 * Get the annotations down appearance.
 * 
 * <p>
 * This will get the annotations down appearance. If this is not existent an
 * empty appearance entry will be created.
 * 
 * @return the appearance entry representing the down appearance.
 */
PDAppearanceEntry getDownAppearance()
{
  PDAppearanceDictionary appearanceDictionary = getAppearance();
  PDAppearanceEntry downAppearanceEntry = appearanceDictionary.getDownAppearance();
  if (downAppearanceEntry.isSubDictionary())
  {
    //TODO replace with "document.getDocument().createCOSStream()" 
    downAppearanceEntry = new PDAppearanceEntry(new COSStream());
    appearanceDictionary.setDownAppearance(downAppearanceEntry);
  }
  return downAppearanceEntry;
}
origin: apache/pdfbox

/**
 * Get the annotations rollover appearance.
 * 
 * <p>
 * This will get the annotations rollover appearance. If this is not
 * existent an empty appearance entry will be created.
 * 
 * @return the appearance entry representing the rollover appearance.
 */
PDAppearanceEntry getRolloverAppearance()
{
  PDAppearanceDictionary appearanceDictionary = getAppearance();
  PDAppearanceEntry rolloverAppearanceEntry = appearanceDictionary.getRolloverAppearance();
  if (rolloverAppearanceEntry.isSubDictionary())
  {
    //TODO replace with "document.getDocument().createCOSStream()" 
    rolloverAppearanceEntry = new PDAppearanceEntry(new COSStream());
    appearanceDictionary.setRolloverAppearance(rolloverAppearanceEntry);
  }
  return rolloverAppearanceEntry;
}
origin: org.verapdf/pdfbox-validation-model

private static String getN_type(PDAnnotation annot) {
  PDAppearanceDictionary appearanceDictionary = annot.getAppearance();
  if (appearanceDictionary != null) {
    PDAppearanceEntry normalAppearance = appearanceDictionary.getNormalAppearance();
    if (normalAppearance == null) {
      return null;
    } else if (normalAppearance.isSubDictionary()) {
      return DICT;
    } else {
      return STREAM;
    }
  }
  return null;
}
origin: org.apache.pdfbox/pdfbox

  /**
   * Returns the entry as an appearance subdictionary.
   *
   * @throws IllegalStateException if this entry is not an appearance subdictionary
   */
  public Map<COSName, PDAppearanceStream> getSubDictionary()
  {
    if (!isSubDictionary())
    {
      throw new IllegalStateException();
    }

    COSDictionary dict = (COSDictionary) entry;
    Map<COSName, PDAppearanceStream> map = new HashMap<COSName, PDAppearanceStream>();

    for (COSName name : dict.keySet())
    {
      COSBase value = dict.getDictionaryObject(name);

      // the file from PDFBOX-1599 contains /null as its entry, so we skip non-stream entries
      if (value instanceof COSStream)
      {
        map.put(name, new PDAppearanceStream((COSStream) value));
      }
    }

    return new COSDictionaryMap<COSName, PDAppearanceStream>(map, dict);
  }
}
origin: com.github.lafa.pdfbox/pdfbox

  /**
   * Returns the entry as an appearance subdictionary.
   *
   * @throws IllegalStateException if this entry is not an appearance subdictionary
   */
  public Map<COSName, PDAppearanceStream> getSubDictionary()
  {
    if (!isSubDictionary())
    {
      throw new IllegalStateException();
    }

    COSDictionary dict = (COSDictionary) entry;
    Map<COSName, PDAppearanceStream> map = new HashMap<>();

    for (COSName name : dict.keySet())
    {
      COSBase value = dict.getDictionaryObject(name);

      // the file from PDFBOX-1599 contains /null as its entry, so we skip non-stream entries
      if (value instanceof COSStream)
      {
        map.put(name, new PDAppearanceStream((COSStream) value));
      }
    }

    return new COSDictionaryMap<>(map, dict);
  }
}
origin: org.apache.pdfbox/pdfbox

/**
 * Returns the appearance stream for this annotation, if any. The annotation state is taken into account, if
 * present.
 */
public PDAppearanceStream getNormalAppearanceStream()
{
  PDAppearanceDictionary appearanceDict = getAppearance();
  if (appearanceDict == null)
  {
    return null;
  }
  PDAppearanceEntry normalAppearance = appearanceDict.getNormalAppearance();
  if (normalAppearance == null)
  {
    return null;
  }
  if (normalAppearance.isSubDictionary())
  {
    COSName state = getAppearanceState();
    return normalAppearance.getSubDictionary().get(state);
  }
  else
  {
    return normalAppearance.getAppearanceStream();
  }
}
origin: com.github.lafa.pdfbox/pdfbox

/**
 * Returns the appearance stream for this annotation, if any. The annotation state is taken into account, if
 * present.
 */
public PDAppearanceStream getNormalAppearanceStream()
{
  PDAppearanceDictionary appearanceDict = getAppearance();
  if (appearanceDict == null)
  {
    return null;
  }
  PDAppearanceEntry normalAppearance = appearanceDict.getNormalAppearance();
  if (normalAppearance == null)
  {
    return null;
  }
  if (normalAppearance.isSubDictionary())
  {
    COSName state = getAppearanceState();
    return normalAppearance.getSubDictionary().get(state);
  }
  else
  {
    return normalAppearance.getAppearanceStream();
  }
}
origin: com.github.lafa.pdfbox/pdfbox

/**
 * Get the annotations down appearance.
 * 
 * <p>
 * This will get the annotations down appearance. If this is not existent an
 * empty appearance entry will be created.
 * 
 * @return the appearance entry representing the down appearance.
 */
PDAppearanceEntry getDownAppearance()
{
  PDAppearanceDictionary appearanceDictionary = getAppearance();
  PDAppearanceEntry appearanceEntry = appearanceDictionary.getDownAppearance();
  if (appearanceEntry.isSubDictionary())
  {
    appearanceEntry = new PDAppearanceEntry(new COSStream());
    appearanceDictionary.setDownAppearance(appearanceEntry);
  }
  return appearanceEntry;
}
origin: com.github.lafa.pdfbox/pdfbox

/**
 * Get the annotations rollover appearance.
 * 
 * <p>
 * This will get the annotations rollover appearance. If this is not
 * existent an empty appearance entry will be created.
 * 
 * @return the appearance entry representing the rollover appearance.
 */
PDAppearanceEntry getRolloverAppearance()
{
  PDAppearanceDictionary appearanceDictionary = getAppearance();
  PDAppearanceEntry appearanceEntry = appearanceDictionary.getRolloverAppearance();
  if (appearanceEntry.isSubDictionary())
  {
    appearanceEntry = new PDAppearanceEntry(new COSStream());
    appearanceDictionary.setRolloverAppearance(appearanceEntry);
  }
  return appearanceEntry;
}

origin: com.github.lafa.pdfbox/pdfbox

/**
 * Get the annotations normal appearance.
 * 
 * <p>
 * This will get the annotations normal appearance. If this is not existent
 * an empty appearance entry will be created.
 * 
 * @return the appearance entry representing the normal appearance.
 */
private PDAppearanceEntry getNormalAppearance()
{
  PDAppearanceDictionary appearanceDictionary = getAppearance();
  PDAppearanceEntry appearanceEntry = appearanceDictionary.getNormalAppearance();
  if (appearanceEntry.isSubDictionary())
  {
    appearanceEntry = new PDAppearanceEntry(new COSStream());
    appearanceDictionary.setNormalAppearance(appearanceEntry);
  }
  return appearanceEntry;
}

org.apache.pdfbox.pdmodel.interactive.annotationPDAppearanceEntryisSubDictionary

Javadoc

Returns true if this entry is an appearance subdictionary.

Popular methods of PDAppearanceEntry

  • <init>
    Constructor for reading.
  • getAppearanceStream
    Returns the entry as an appearance stream.
  • getCOSObject
  • getSubDictionary
    Returns the entry as an appearance subdictionary.
  • isStream
    Returns true if this entry is an appearance stream.

Popular in Java

  • Updating database using SQL prepared statement
  • setScale (BigDecimal)
  • addToBackStack (FragmentTransaction)
  • getSupportFragmentManager (FragmentActivity)
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now