Class PDShading

java.lang.Object
org.apache.pdfbox.pdmodel.graphics.PDShading
All Implemented Interfaces:
COSObjectable

public class PDShading extends Object implements COSObjectable
This class represents a Shading Pattern color space. See section 4.6.3 of the PDF 1.7 specification.
Version:
$Revision: 1.0 $
Author:
Daniel wilson
  • Field Details

  • Constructor Details

    • PDShading

      public PDShading()
      Default constructor.
    • PDShading

      public PDShading(COSName name, COSDictionary shading)
      Constructor.
      Parameters:
      shading - The shading dictionary.
  • Method Details

    • getName

      public String getName()
      This will return the name of the object.
      Returns:
      The name of the object.
    • getCOSObject

      public COSBase getCOSObject()
      Convert this standard java object to a COS object.
      Specified by:
      getCOSObject in interface COSObjectable
      Returns:
      The cos object that matches this Java object.
    • getShadingName

      public COSName getShadingName()
      This will return the name of this particular shading dictionary
      Returns:
      The name of the shading dictionary
    • getShadingType

      public int getShadingType()
      This will return the ShadingType -- an integer between 1 and 7 that specifies the gradient type. Required in all Shading Dictionaries.
      Returns:
      The Shading Type
    • getColorSpace

      public PDColorSpace getColorSpace() throws IOException
      This will return the Color Space. Required in all Shading Dictionaries.
      Returns:
      The Color Space of the shading dictionary
      Throws:
      IOException
    • getAntiAlias

      public boolean getAntiAlias()
      This will return a boolean flag indicating whether to antialias the shading pattern.
      Returns:
      The antialias flag, defaulting to False
    • getCoords

      public COSArray getCoords()
      Returns the coordinate array used by several of the gradient types. Interpretation depends on the ShadingType.
      Returns:
      The coordinate array.
    • getFunction

      public PDFunction getFunction() throws IOException
      Returns the function used by several of the gradient types. Interpretation depends on the ShadingType.
      Returns:
      The gradient function.
      Throws:
      IOException
    • getDomain

      public COSArray getDomain()
      Returns the Domain array used by several of the gradient types. Interpretation depends on the ShadingType.
      Returns:
      The Domain array.
    • getExtend

      public COSArray getExtend()
      Returns the Extend array used by several of the gradient types. Interpretation depends on the ShadingType. Default is {false, false}.
      Returns:
      The Extend array.
    • toString

      public String toString()
      Overrides:
      toString in class Object