Class PDShading

  • All Implemented Interfaces:
    COSObjectable

    public class PDShading
    extends java.lang.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 Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String NAME
      The name of this object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean getAntiAlias()
      This will return a boolean flag indicating whether to antialias the shading pattern.
      PDColorSpace getColorSpace()
      This will return the Color Space.
      COSArray getCoords()
      Returns the coordinate array used by several of the gradient types.
      COSBase getCOSObject()
      Convert this standard java object to a COS object.
      COSArray getDomain()
      Returns the Domain array used by several of the gradient types.
      COSArray getExtend()
      Returns the Extend array used by several of the gradient types.
      PDFunction getFunction()
      Returns the function used by several of the gradient types.
      java.lang.String getName()
      This will return the name of the object.
      COSName getShadingName()
      This will return the name of this particular shading dictionary
      int getShadingType()
      This will return the ShadingType -- an integer between 1 and 7 that specifies the gradient type.
      java.lang.String toString()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • NAME

        public static final java.lang.String NAME
        The name of this object.
        See Also:
        Constant Field Values
    • Constructor Detail

      • PDShading

        public PDShading()
        Default constructor.
      • PDShading

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

      • getName

        public java.lang.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 java.io.IOException
        This will return the Color Space. Required in all Shading Dictionaries.
        Returns:
        The Color Space of the shading dictionary
        Throws:
        java.io.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 java.io.IOException
        Returns the function used by several of the gradient types. Interpretation depends on the ShadingType.
        Returns:
        The gradient function.
        Throws:
        java.io.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 java.lang.String toString()
        Overrides:
        toString in class java.lang.Object