Examples of PDColorSpace


Examples of org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace

    {
        COSName name = (COSName)arguments.get(0);

        try
        {
            PDColorSpace cs = context.getResources().getColorSpace(name);
            context.getGraphicsState().setStrokingColorSpace(cs);
            context.getGraphicsState().setStrokingColor(cs.getInitialColor());
        }
        catch (PDColorSpace.MissingException e)
        {
            LOG.error("Missing color space: " + name.getName());
        }
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace

public class SetStrokingDeviceCMYKColor extends SetStrokingColor
{
    @Override
    public void process(Operator operator, List<COSBase> arguments) throws IOException
    {
        PDColorSpace cs = context.getResources().getColorSpace(COSName.DEVICECMYK);
        context.getGraphicsState().setStrokingColorSpace(cs);
        super.process(operator, arguments);
    }
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace

     * @param arguments List
     * @throws IOException If the color space cannot be read.
     */
    public void process(Operator operator, List<COSBase> arguments) throws IOException
    {
        PDColorSpace cs = context.getResources().getColorSpace(COSName.DEVICERGB);
        context.getGraphicsState().setStrokingColorSpace(cs);
        super.process(operator, arguments);
    }
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace

    /**
     * Returns an AWT paint for the given PDColor.
     */
    private Paint getPaint(PDColor color) throws IOException
    {
        PDColorSpace colorSpace = color.getColorSpace();
        if (!(colorSpace instanceof PDPattern))
        {
            float[] rgb = colorSpace.toRGB(color.getComponents());
            return new Color(rgb[0], rgb[1], rgb[2]);
        }
        else
        {
            PDPattern patternSpace = (PDPattern)colorSpace;
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace

     * @throws IOException If an error occurs while processing the font.
     */
    public void process(PDFOperator operator, List<COSBase> arguments) throws IOException
    {
        PDColorState colorInstance = context.getGraphicsState().getNonStrokingColor();
        PDColorSpace colorSpace = colorInstance.getColorSpace();

        if (colorSpace != null)
        {
            PDIndexed indexed = (PDIndexed) colorSpace;
            colorSpace = indexed.getBaseColorSpace();
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace

     * @param arguments List
     * @throws IOException If an error occurs while processing the font.
     */
    public void process(PDFOperator operator, List<COSBase> arguments) throws IOException
    {
        PDColorSpace colorSpace = context.getGraphicsState().getStrokingColor().getColorSpace();
        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();
            }
            else if (colorSpace instanceof PDDeviceN)
            {
                newOperator = new SetStrokingDeviceN();
            }
            else if (colorSpace instanceof PDPattern)
            {
                newOperator = new SetStrokingPattern();
            }
            else if (colorSpace instanceof PDIndexed)
            {
                newOperator = new SetStrokingIndexed();
            }
            else if (colorSpace instanceof PDLab)
            {
                newOperator = new SetStrokingLabColor();
            }

            if (newOperator != null)
            {
                newOperator.setContext(getContext());
                newOperator.process(operator, arguments);
            }
            else
            {
                LOG.info("Not supported colorspace "+colorSpace.getName()
                        + " within operator "+operator.getOperation());
            }
        }
        else
        {
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace

     * @throws IOException If an error occurs while processing the font.
     */
    public void process(PDFOperator operator, List<COSBase> arguments) throws IOException
    {
        PDColorState colorInstance = context.getGraphicsState().getStrokingColor();
        PDColorSpace colorSpace = colorInstance.getColorSpace();

        if (colorSpace != null)
        {
            PDIndexed indexed = (PDIndexed) colorSpace;
            colorSpace = indexed.getBaseColorSpace();
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace

     * @param arguments List
     * @throws IOException If an error occurs while processing the font.
     */
    public void process(PDFOperator operator, List<COSBase> arguments) throws IOException
    {
        PDColorSpace colorSpace = context.getGraphicsState().getNonStrokingColor().getColorSpace();
        if (colorSpace != null)
        {
            OperatorProcessor newOperator = null;
            if (colorSpace instanceof PDDeviceGray)
            {
                newOperator = new SetNonStrokingGrayColor();
            }
            else if (colorSpace instanceof PDDeviceRGB)
            {
                newOperator = new SetNonStrokingRGBColor();
            }
            else if (colorSpace instanceof PDDeviceCMYK)
            {
                newOperator = new SetNonStrokingCMYKColor();
            }
            else if (colorSpace instanceof PDICCBased)
            {
                newOperator = new SetNonStrokingICCBasedColor();
            }
            else if (colorSpace instanceof PDCalRGB)
            {
                newOperator = new SetNonStrokingCalRGBColor();
            }  
            else if (colorSpace instanceof PDSeparation)
            {
                newOperator = new SetNonStrokingSeparation();
            }
            else if (colorSpace instanceof PDDeviceN)
            {
                newOperator = new SetNonStrokingDeviceN();
            }
            else if (colorSpace instanceof PDPattern)
            {
                newOperator = new SetNonStrokingPattern();
            }
            else if (colorSpace instanceof PDIndexed)
            {
                newOperator = new SetNonStrokingIndexed();
            }
            else if (colorSpace instanceof PDLab)
            {
                newOperator = new SetNonStrokingLabColor();
            }

            if (newOperator != null)
            {
                newOperator.setContext(getContext());
                newOperator.process(operator, arguments);
            }
            else
            {
                LOG.warn("Not supported colorspace "+colorSpace.getName()
                        + " within operator "+operator.getOperation());
            }
        }
        else
        {
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace

                context.addValidationError(new ValidationError(ERROR_GRAPHIC_INVALID_COLOR_SPACE_MISSING,
                        "DestOutputProfile is missing"));
                return;
            }

            PDColorSpace altColor = deviceN.getAlternateColorSpace();
            if (altColor != null)
            {
                processAllColorSpace(altColor);
            }
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace

    protected void processIndexedColorSpace(PDColorSpace pdcs)
    {
        PDIndexed indexed = (PDIndexed) pdcs;
        try
        {
            PDColorSpace based = indexed.getBaseColorSpace();
            ColorSpaces cs = ColorSpaces.valueOf(based.getName());
            if (cs == ColorSpaces.Indexed || cs == ColorSpaces.Indexed_SHORT)
            {
                context.addValidationError(new ValidationError(ERROR_GRAPHIC_INVALID_COLOR_SPACE_INDEXED,
                        "Indexed color space can't be used as Base color space"));
                return;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.