Method from org.apache.pdfbox.pdmodel.graphics.PDShading Detail: |
public boolean getAntiAlias() {
return DictShading.getBoolean("AntiAlias",false);
}
This will return a boolean flag indicating whether to antialias the shading pattern. |
public COSBase getCOSObject() {
return COSName.getPDFName( getName() );
}
Convert this standard java object to a COS object. |
public PDColorSpace getColorSpace() throws IOException {
return PDColorSpaceFactory.createColorSpace(DictShading.getDictionaryObject("ColorSpace"));
}
This will return the Color Space.
Required in all Shading Dictionaries. |
public COSArray getCoords() {
return (COSArray)(DictShading.getDictionaryObject("Coords"));
}
Returns the coordinate array used by several of the gradient types. Interpretation depends on the ShadingType. |
public COSArray getDomain() {
return (COSArray)(DictShading.getDictionaryObject("Domain"));
}
Returns the Domain array used by several of the gradient types. Interpretation depends on the ShadingType. |
public COSArray getExtend() {
COSArray arExtend=(COSArray)(DictShading.getDictionaryObject("Extend"));
if (arExtend == null)
{
arExtend = new COSArray();
arExtend.add(COSBoolean.FALSE);
arExtend.add(COSBoolean.FALSE);
}
return arExtend;
}
Returns the Extend array used by several of the gradient types. Interpretation depends on the ShadingType.
Default is {false, false}. |
public PDFunction getFunction() throws IOException {
return PDFunction.create(DictShading.getDictionaryObject("Function"));
}
Returns the function used by several of the gradient types. Interpretation depends on the ShadingType. |
public String getName() {
return NAME;
}
This will return the name of the object. |
public COSName getShadingName() {
return shadingname;
}
This will return the name of this particular shading dictionary |
public int getShadingType() {
return DictShading.getInt("ShadingType");
}
This will return the ShadingType -- an integer between 1 and 7 that specifies the gradient type.
Required in all Shading Dictionaries. |
public String toString() {
String sColorSpace;
String sFunction;
try
{
sColorSpace = getColorSpace().toString();
}catch (IOException e)
{
sColorSpace = "Failure retrieving ColorSpace: " + e.toString();
}
try
{
sFunction = getFunction().toString();
}catch(IOException e)
{
sFunction = "n/a";
}
String s = "Shading " + shadingname + "\n"
+ "\tShadingType: " + getShadingType() + "\n"
+ "\tColorSpace: " + sColorSpace + "\n"
+ "\tAntiAlias: " + getAntiAlias() + "\n"
+ "\tCoords: " + getCoords().toString() + "\n"
+ "\tDomain: " + getDomain().toString() + "\n"
+ "\tFunction: " + sFunction + "\n"
+ "\tExtend: " + getExtend().toString() + "\n"
+ "\tRaw Value:\n" +
DictShading.toString();
return s;
}
|