Package com.lowagie.text.pdf

Examples of com.lowagie.text.pdf.CMYKColor


        if (color instanceof FSRGBColor) {
            FSRGBColor rgb = (FSRGBColor)color;
            _color = new Color(rgb.getRed(), rgb.getGreen(), rgb.getBlue());
        } else if (color instanceof FSCMYKColor) {
            FSCMYKColor cmyk = (FSCMYKColor)color;
            _color = new CMYKColor(cmyk.getCyan(), cmyk.getMagenta(), cmyk.getYellow(), cmyk.getBlack());
        } else {
            throw new RuntimeException("internal error: unsupported color class " + color.getClass().getName());
        }
    }
View Full Code Here


                new float[]{.929f, .357f, 1, .298f}, new float[]{.631f, .278f, 1, .027f}, 1.048f);
            PdfFunction function2 = PdfFunction.type2(writer, new float[]{0, 1}, null,
                new float[]{.929f, .357f, 1, .298f}, new float[]{.941f, .4f, 1, .102f}, 1.374f);
            PdfFunction function3 = PdfFunction.type3(writer, new float[]{0, 1}, null,
                new PdfFunction[]{function1, function2}, new float[]{.708f}, new float[]{1, 0, 0, 1});
            PdfShading shading = PdfShading.type3(writer, new CMYKColor(0, 0, 0, 0),
                new float[]{0, 0, .096f, 0, 0, 1}, null, function3, new boolean[]{true, true});
            PdfContentByte cb = writer.getDirectContent();
            cb.moveTo(316.789f, 140.311f);
            cb.curveTo(303.222f, 146.388f, 282.966f, 136.518f, 279.122f, 121.983f);
            cb.lineTo(277.322f, 120.182f);
View Full Code Here

            PdfContentByte cb = writer.getDirectContent();
           
            // step 5: we instantiate PdfSpotColor
           
            // Note: I made up these names unless someone give me a PANTONE swatch as gift (phillip@formstar.com)
            PdfSpotColor spc_cmyk = new PdfSpotColor("PANTONE 280 CV", new CMYKColor(0.9f, .2f, .3f, .1f));
            PdfSpotColor spc_rgb = new PdfSpotColor("PANTONE 147", new Color(114, 94, 38));
            PdfSpotColor spc_g = new PdfSpotColor("PANTONE 100 CV", new GrayColor(0.9f));
           
            // Stroke a rectangle with CMYK alternate
            cb.setColorStroke(spc_cmyk, .5f);
View Full Code Here

            PdfPatternPainter pat = cb.createPattern(15, 15, null);
            pat.rectangle(5, 5, 5, 5);
            pat.fill();
            pat.sanityCheck();
           
            PdfSpotColor spc_cmyk = new PdfSpotColor("PANTONE 280 CV", new CMYKColor(0.9f, .2f, .3f, .1f));
            SpotColor spot = new SpotColor(spc_cmyk, 0.25f);
            tp.setPatternFill(pat, spot, .9f);
            tp.rectangle(0, 0, 400, 300);
            tp.fill();
            tp.sanityCheck();
View Full Code Here

        if (color instanceof FSRGBColor) {
            FSRGBColor rgb = (FSRGBColor)color;
            _color = new Color(rgb.getRed(), rgb.getGreen(), rgb.getBlue());
        } else if (color instanceof FSCMYKColor) {
            FSCMYKColor cmyk = (FSCMYKColor)color;
            _color = new CMYKColor(cmyk.getCyan(), cmyk.getMagenta(), cmyk.getYellow(), cmyk.getBlack());
        } else {
            throw new RuntimeException("internal error: unsupported color class " + color.getClass().getName());
        }
    }
View Full Code Here

            PdfPatternPainter pat = cb.createPattern(15, 15, null);
            pat.rectangle(5, 5, 5, 5);
            pat.fill();
            pat.sanityCheck();
           
            PdfSpotColor spc_cmyk = new PdfSpotColor("PANTONE 280 CV", new CMYKColor(0.9f, .2f, .3f, .1f));
            SpotColor spot = new SpotColor(spc_cmyk, 0.25f);
            tp.setPatternFill(pat, spot, .9f);
            tp.rectangle(0, 0, 400, 300);
            tp.fill();
            tp.sanityCheck();
View Full Code Here

                new float[]{.929f, .357f, 1, .298f}, new float[]{.631f, .278f, 1, .027f}, 1.048f);
            PdfFunction function2 = PdfFunction.type2(writer, new float[]{0, 1}, null,
                new float[]{.929f, .357f, 1, .298f}, new float[]{.941f, .4f, 1, .102f}, 1.374f);
            PdfFunction function3 = PdfFunction.type3(writer, new float[]{0, 1}, null,
                new PdfFunction[]{function1, function2}, new float[]{.708f}, new float[]{1, 0, 0, 1});
            PdfShading shading = PdfShading.type3(writer, new CMYKColor(0, 0, 0, 0),
                new float[]{0, 0, .096f, 0, 0, 1}, null, function3, new boolean[]{true, true});
            PdfContentByte cb = writer.getDirectContent();
            cb.moveTo(316.789f, 140.311f);
            cb.curveTo(303.222f, 146.388f, 282.966f, 136.518f, 279.122f, 121.983f);
            cb.lineTo(277.322f, 120.182f);
View Full Code Here

            PdfContentByte cb = writer.getDirectContent();
           
            // step 5: we instantiate PdfSpotColor
           
            // Note: I made up these names unless someone give me a PANTONE swatch as gift (phillip@formstar.com)
            PdfSpotColor spc_cmyk = new PdfSpotColor("PANTONE 280 CV", new CMYKColor(0.9f, .2f, .3f, .1f));
            PdfSpotColor spc_rgb = new PdfSpotColor("PANTONE 147", new Color(114, 94, 38));
            PdfSpotColor spc_g = new PdfSpotColor("PANTONE 100 CV", new GrayColor(0.9f));
           
            // Stroke a rectangle with CMYK alternate
            cb.setColorStroke(spc_cmyk, .5f);
View Full Code Here

        if (color instanceof FSRGBColor) {
            FSRGBColor rgb = (FSRGBColor) color;
            _color = new Color(rgb.getRed(), rgb.getGreen(), rgb.getBlue());
        } else if (color instanceof FSCMYKColor) {
            FSCMYKColor cmyk = (FSCMYKColor) color;
            _color = new CMYKColor(cmyk.getCyan(), cmyk.getMagenta(), cmyk.getYellow(), cmyk.getBlack());
        } else {
            throw new RuntimeException("internal error: unsupported color class " + color.getClass().getName());
        }
    }
View Full Code Here

TOP

Related Classes of com.lowagie.text.pdf.CMYKColor

Copyright © 2018 www.massapicom. 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.