Class PdfObjectParseUtil

java.lang.Object
org.loboevolution.pdfview.action.PdfObjectParseUtil

public class PdfObjectParseUtil extends Object
************************************************************************** Utility class for parsing values from a PDFObject

Author Katja Sondermann

Since:
08.07.2009 **************************************************************************
  • Constructor Details

    • PdfObjectParseUtil

      public PdfObjectParseUtil()
  • Method Details

    • parseStringFromDict

      public static String parseStringFromDict(String key, PDFObject parent, boolean mandatory) throws IOException
      ********************************************************************** Parse a String value with the given key from parent object. If it's mandatory and not available, an exception will be thrown.
      Parameters:
      key - a String object.
      parent - a PDFObject object.
      mandatory - a boolean.
      Returns:
      String - can be null if not mandatory
      Throws:
      IOException - if any.
    • parseBooleanFromDict

      public static boolean parseBooleanFromDict(String key, PDFObject parent, boolean mandatory) throws IOException
      ********************************************************************** Parse a Boolean value with the given key from parent object. If it's mandatory and not available, an exception will be thrown.
      Parameters:
      key - a String object.
      parent - a PDFObject object.
      mandatory - a boolean.
      Returns:
      boolean - false if not available and not mandatory
      Throws:
      IOException - if any.
    • parseIntegerFromDict

      public static int parseIntegerFromDict(String key, PDFObject parent, boolean mandatory) throws IOException
      ********************************************************************** Parse a integer value with the given key from parent object. If it's mandatory and not available, an exception will be thrown.
      Parameters:
      key - a String object.
      parent - a PDFObject object.
      mandatory - a boolean.
      Returns:
      int - returns "0" in case the value is not a number
      Throws:
      IOException - if any.
    • parseDestination

      public static PDFDestination parseDestination(String key, PDFObject parent, PDFObject root, boolean mandatory) throws IOException
      ********************************************************************** Parse a destination object
      Parameters:
      key - a String object.
      parent - a PDFObject object.
      root - a PDFObject object.
      mandatory - a boolean.
      Returns:
      PDFDestination - can be null if not mandatory
      Throws:
      IOException - if any.