PDColorState color = context.getGraphicsState().getStrokingColor();
PDColorSpace colorSpace = color.getColorSpace();
log.info("handling color space " + colorSpace.toString());
if (colorSpace instanceof PDSeparation)
{
PDSeparation sep = (PDSeparation) colorSpace;
colorSpace = sep.getAlternateColorSpace();
log.info("now handling alternate color space " + colorSpace.toString());
if (colorSpace != null)
{
OperatorProcessor newOperator = null;
if (colorSpace instanceof PDDeviceGray)
{
newOperator = new SetStrokingGrayColor();
}
else if (colorSpace instanceof PDDeviceRGB)
{
newOperator = new SetStrokingRGBColor();
}
else if (colorSpace instanceof PDDeviceCMYK)
{
newOperator = new SetStrokingCMYKColor();
}
else if (colorSpace instanceof PDICCBased)
{
newOperator = new SetStrokingICCBasedColor();
}
else if (colorSpace instanceof PDCalRGB)
{
newOperator = new SetStrokingCalRGBColor();
}
else if (colorSpace instanceof PDSeparation)
{
newOperator = new SetStrokingSeparation();
}
if (newOperator != null)
{
newOperator.setContext(getContext());
newOperator.process(operator, sep.getColorValues().toList());
}
else
{
log.warn("Not supported colorspace "+colorSpace.getName()
+ " within operator "+operator.getOperation());