Package com.sun.pdfview.pattern

Examples of com.sun.pdfview.pattern.PDFShader


    /**
     * build a shader from a dictionary.
     */
    private void doShader(PDFObject shaderObj) throws IOException {
        PDFShader shader = PDFShader.getShader(shaderObj, resources);

        cmds.addPush();

        Rectangle2D bbox = shader.getBBox();
        if (bbox != null) {
            cmds.addFillPaint(shader.getPaint());
            cmds.addPath(new GeneralPath(bbox), PDFShapeCmd.FILL);
        }

        cmds.addPop();
    }
View Full Code Here


    /**
     * build a shader from a dictionary.
     */
    private void doShader(PDFObject shaderObj) throws IOException {
        PDFShader shader = PDFShader.getShader(shaderObj, this.resources);

        this.cmds.addPush();

        Rectangle2D bbox = shader.getBBox();
        if (bbox != null) {
            this.cmds.addFillPaint(shader.getPaint());
            this.cmds.addPath(new GeneralPath(bbox), PDFShapeCmd.FILL);
        }
        else {
          //if no bounding box is set, use the default user space
            this.cmds.addFillPaint(shader.getPaint());
            this.cmds.addPath(new GeneralPath(this.cmds.getBBox()), PDFShapeCmd.FILL);
        }

        this.cmds.addPop();
    }
View Full Code Here

TOP

Related Classes of com.sun.pdfview.pattern.PDFShader

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.