Class PdfObjectParseUtil

java.lang.Object
org.openpdf.renderer.action.PdfObjectParseUtil

public class PdfObjectParseUtil extends Object
Utility class for parsing values from a PDFObject
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 -
      parent -
      mandatory -
      Returns:
      String - can be null if not mandatory
      Throws:
      IOException - - in case of a parsing error
    • 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 -
      parent -
      mandatory -
      Returns:
      boolean - false if not available and not mandatory
      Throws:
      IOException
    • 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 -
      parent -
      mandatory -
      Returns:
      int - returns "0" in case the value is not a number
      Throws:
      IOException
    • parseDestination

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