Examples of PDShadingType2


Examples of org.apache.pdfbox.pdmodel.graphics.shading.PDShadingType2

            fdict.setItem(COSName.C1, c1);
            fdict.setInt(COSName.N, 1);
            PDFunctionType2 func = new PDFunctionType2(fdict);

            // axial shading with attributes
            PDShadingType2 axialShading = new PDShadingType2(new COSDictionary());
            axialShading.setColorSpace(PDDeviceRGB.INSTANCE);
            axialShading.setShadingType(PDShading.SHADING_TYPE2);
            COSArray coords1 = new COSArray();
            coords1.add(COSInteger.get(100));
            coords1.add(COSInteger.get(400));
            coords1.add(COSInteger.get(400));
            coords1.add(COSInteger.get(600));
            axialShading.setCoords(coords1);
            axialShading.setFunction(func);

            // radial shading with attributes
            PDShadingType3 radialShading = new PDShadingType3(new COSDictionary());
            radialShading.setColorSpace(PDDeviceRGB.INSTANCE);
            radialShading.setShadingType(PDShading.SHADING_TYPE3);
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.graphics.shading.PDShadingType2

            fdict.setItem(COSName.C0, c0);
            fdict.setItem(COSName.C1, c1);
            fdict.setInt(COSName.N, 1);
            PDFunctionType2 func = new PDFunctionType2(fdict);

            PDShadingType2 shading = new PDShadingType2(new COSDictionary());

            // shading attributes
            shading.setColorSpace(PDDeviceRGB.INSTANCE);
            shading.setShadingType(PDShadingType2.SHADING_TYPE2);
            COSArray coords = new COSArray();
            coords.add(COSInteger.get(100));
            coords.add(COSInteger.get(400));
            coords.add(COSInteger.get(400));
            coords.add(COSInteger.get(600));
            shading.setCoords(coords);
            shading.setFunction(func);

            // create and add to shading resources
            page.setResources(new PDResources());
            Map<String, PDShadingResources> shadings = new HashMap<String, PDShadingResources>();
            shadings.put("sh1", (PDShadingResources) shading);
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.