Examples of PDColorSpace


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

    {
        PDSeparation separation = (PDSeparation) pdcs;
        try
        {

            PDColorSpace altCol = separation.getAlternateColorSpace();
            if (altCol != null)
            {
                ColorSpaces acs = ColorSpaces.valueOf(altCol.getName());
                switch (acs)
                {
                case Separation:
                case DeviceN:
                case Pattern:
View Full Code Here

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

        // get default color space
        PreflightPath vPath = context.getValidationPath();
        PDResources resources = vPath.getClosestPathElement(PDResources.class);
        if (resources != null && resources.getColorSpaces() != null)
        {
            PDColorSpace defaultCS = null;

            Map<String, PDColorSpace> colorsSpaces = resources.getColorSpaces();
            if (pdcs.getName().equals(ColorSpaces.DeviceCMYK.getLabel()))
            {
                defaultCS = colorsSpaces.get("DefaultCMYK");
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 colorSpace = ColorSpaces.valueOf(based.getName());
            switch (colorSpace)
            {
            case Indexed:
            case Indexed_SHORT:
            case Pattern:
View Full Code Here

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

                {
                    /*
                     * The color space is unknown. Try to access the resources dictionary, the color space can be a
                     * reference.
                     */
                    PDColorSpace pdCS = (PDColorSpace) this.getColorSpaces().get(colorSpace);
                    if (pdCS != null)
                    {
                        cs = ColorSpaces.valueOf(pdCS.getName());
                        PreflightConfiguration cfg = context.getConfig();
                        ColorSpaceHelperFactory csFact = cfg.getColorSpaceHelperFact();
                        csHelper = csFact.getColorSpaceHelper(context, pdCS, ColorSpaceRestriction.ONLY_DEVICE);
                    }
                }

                if (cs == null)
                {
                    registerError("The ColorSpace is unknown", ERROR_GRAPHIC_UNEXPECTED_VALUE_FOR_KEY);
                    return;
                }
            }

            if (csHelper == null)
            {
                PDColorSpace pdCS = PDColorSpaceFactory.createColorSpace(csInlinedBase);
                PreflightConfiguration cfg = context.getConfig();
                ColorSpaceHelperFactory csFact = cfg.getColorSpaceHelperFact();
                csHelper = csFact.getColorSpaceHelper(context, pdCS, ColorSpaceRestriction.ONLY_DEVICE);
            }

View Full Code Here

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

        {
            result = validColorSpaceDestOutputProfile(expectedType);
        }
        else
        {
            PDColorSpace cs = colorState.getColorSpace();
            if (isDeviceIndependent(cs, expectedType))
            {
                result = true;
            }
            else
View Full Code Here

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

        catch (IllegalArgumentException e)
        {
            /*
             * The color space is unknown. Try to access the resources dictionary, the color space can be a reference.
             */
            PDColorSpace pdCS = (PDColorSpace) this.getColorSpaces().get(colorSpaceName);
            if (pdCS != null)
            {
                cs = ColorSpaces.valueOf(pdCS.getName());
                PreflightConfiguration cfg = context.getConfig();
                ColorSpaceHelperFactory csFact = cfg.getColorSpaceHelperFact();
                csHelper = csFact.getColorSpaceHelper(context, pdCS, ColorSpaceRestriction.NO_RESTRICTION);
            }
        }

        if (cs == null)
        {
            registerError("The ColorSpace is unknown", ERROR_GRAPHIC_UNEXPECTED_VALUE_FOR_KEY);
            return;
        }

        if (csHelper == null)
        {
            PDColorSpace pdCS = PDColorSpaceFactory.createColorSpace(COSName.getPDFName(colorSpaceName));
            PreflightConfiguration cfg = context.getConfig();
            ColorSpaceHelperFactory csFact = cfg.getColorSpaceHelperFact();
            csHelper = csFact.getColorSpaceHelper(context, pdCS, ColorSpaceRestriction.NO_RESTRICTION);
        }

View Full Code Here

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

    protected void checkColorSpace(PreflightContext context, PDPage page, PDShadingResources shadingRes)
            throws ValidationException
            {
        try
        {
            PDColorSpace pColorSpace = shadingRes.getColorSpace();
            PreflightConfiguration config = context.getConfig();
            ColorSpaceHelperFactory csFact = config.getColorSpaceHelperFact();
            ColorSpaceHelper csh = csFact.getColorSpaceHelper(context, pColorSpace, ColorSpaceRestriction.NO_PATTERN);
            csh.validate();
        }
View Full Code Here

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

        {
            try
            {
                PreflightConfiguration config = context.getConfig();
                ColorSpaceHelperFactory csFact = config.getColorSpaceHelperFact();
                PDColorSpace pdCS = PDColorSpaceFactory.createColorSpace(csImg);
                ColorSpaceHelper csh = csFact.getColorSpaceHelper(context, pdCS, ColorSpaceRestriction.NO_PATTERN);
                csh.validate();
            }
            catch (IOException e)
            {
View Full Code Here

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

            {
                colorspaces = new HashMap<String, PDColorSpace>();
                for (COSName csName : csDictionary.keySet())
                {
                    COSBase cs = csDictionary.getDictionaryObject(csName);
                    PDColorSpace colorspace = null;
                    try
                    {
                        colorspace = PDColorSpaceFactory.createColorSpace(cs);
                    }
                    catch (IOException exception)
View Full Code Here

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

            // [1.0, 0.0] -> invert the "color" values
            blackIsOne = !blackIsOne;
        }
        byte[] bufferData = null;
        ColorModel colorModel = null;
        PDColorSpace colorspace = getColorSpace();
        // most likely there is no colorspace as a CCITT-filter uses 1-bit values mapped to black/white
        // in some rare cases other colorspaces maybe used such as an indexed colorspace, see PDFBOX-1638
        if (colorspace instanceof PDIndexed)
        {
            PDIndexed csIndexed = (PDIndexed) colorspace;
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.