Class PDColorSpaceFactory

java.lang.Object
org.apache.pdfbox.pdmodel.graphics.color.PDColorSpaceFactory

public final class PDColorSpaceFactory extends Object
This class represents a color space in a pdf document.
Version:
$Revision: 1.11 $
Author:
Ben Litchfield
  • Method Details

    • createColorSpace

      public static PDColorSpace createColorSpace(COSBase colorSpace) throws IOException
      This will create the correct color space given the name.
      Parameters:
      colorSpace - The color space object.
      Returns:
      The color space.
      Throws:
      IOException - If the color space name is unknown.
    • createColorSpace

      public static PDColorSpace createColorSpace(COSBase colorSpace, Map<String,PDColorSpace> colorSpaces) throws IOException
      This will create the correct color space given the name.
      Parameters:
      colorSpace - The color space object.
      colorSpaces - The ColorSpace dictionary from the current resources, if any.
      Returns:
      The color space.
      Throws:
      IOException - If the color space name is unknown.
    • createColorSpace

      public static PDColorSpace createColorSpace(COSBase colorSpace, Map<String,PDColorSpace> colorSpaces, Map<String,PDPatternResources> patterns) throws IOException
      This will create the correct color space given the name.
      Parameters:
      colorSpace - The color space object.
      colorSpaces - The ColorSpace dictionary from the current resources, if any.
      patterns - The patterns dictionary from the current resources, if any
      Returns:
      The color space.
      Throws:
      IOException - If the color space name is unknown.
    • createColorSpace

      public static PDColorSpace createColorSpace(String colorSpaceName) throws IOException
      This will create the correct color space given the name.
      Parameters:
      colorSpaceName - The name of the colorspace.
      Returns:
      The color space.
      Throws:
      IOException - If the color space name is unknown.
    • createColorSpace

      public static PDColorSpace createColorSpace(String colorSpaceName, Map<String,PDColorSpace> colorSpaces) throws IOException
      This will create the correct color space given the name.
      Parameters:
      colorSpaceName - The name of the colorspace.
      colorSpaces - The ColorSpace dictionary from the current resources, if any.
      Returns:
      The color space.
      Throws:
      IOException - If the color space name is unknown.
    • createColorSpace

      public static PDColorSpace createColorSpace(PDDocument doc, ColorSpace cs) throws IOException
      This will create the correct color space from a java colorspace.
      Parameters:
      doc - The doc to potentiall write information to.
      cs - The awt colorspace.
      Returns:
      The color space.
      Throws:
      IOException - If the color space name is unknown.